struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "fea jabi" <zy...@hotmail.com>
Subject errorStyleClass not working
Date Mon, 17 Jul 2006 15:44:49 GMT
struts-config
<form-bean name="Form" type="org.apache.struts.validator.DynaValidatorForm" 
dynamic="true">
             <form-property name="hrs" type="java.util.ArrayList"/>
....................
.....................
</form-bean>


JSP:

        <html:form action="DispatchAction.do" method="post">
            <fmt:setBundle var="appbundle" basename="MessageResources"/>

            <logic:messagesPresent message="true">
                <UL>
                 <html:messages id="error" message="true">
                    <LI><c:out value="${error}"/></LI>
                 </html:messages>
                </UL>
            </logic:messagesPresent>

<display:table name="sessionScope.Form.hrs" id="rows" 
requestURI="PrepareAction.do" >

....................
.......................
<display:column titleKey="lbl.hrs">
         <c:set var="ggggg" value="hrs[${rows_rowNum -1}].adHrs"/>

         <c:if test="${rows.adHrs != null}">
                 <html:text property="<%= 
pageContext.getAttribute("ggggg").toString() %>" 
errorStyleClass="errormsg"/>
         </c:if>
</display:column>

</display:table>

</html:form>

validation.xml

    <formset>
        <form name="Form" >
            <field property="adHrs" indexedListProperty="hrs" 
depends="integer,validwhen">
                <msg name="integer" key="lbl.notvalid"/>
                <msg name="validwhen" key="lbl.notvalid"/>
                <var>
                    <var-name>test</var-name>
                    <var-value>(*this* >= 0)</var-value>
                </var>
            </field>
        </form>
    </formset>


the error messages does display at the top. But the input field is not 
highlighted.

The messages are getting displayed only when the messages="true" is given as 
below
<logic:messagesPresent message="true">

<html:messages id="error" message="true">

not sure why this has to be given either.

Need help with highlighting too.

Thanks.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message