struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eugenebalt <eugeneb...@yahoo.com>
Subject Struts 1.3 errorStyleClass Not Working (Error Field Highlighting)
Date Tue, 07 Jul 2015 16:05:37 GMT
The errorStyleClass attribute on the <html:text> Struts 1.3 tag is not
working for me. It's supposed to highlight the error fields accumulated
correctly in the ActionErrors collection.

In the output HTML I see the error style isn't included. It only has the
original class that came from styleClass. The error highlighting should be
in pink color, as below.

JSP: note the "has-error" errorStyleClass

    <html:text styleId="startDate"
       styleClass="dateValue" errorStyleClass="has-error" 
       size="20" name="formBean"
       property="actionFormBean.startDate"
       readOnly="${readOnly}" maxlength="10" />

CSS

.has-error {
    background-color: pink;
}

In the output HTML, the new error style is *not* included.

<input type="text" name="actionFormBean.startDate" maxlength="10" size="20"
value="" id="startDate" class="dateValue" title="Date in MM/DD/YYYY format">

Server-Side Accumulation of messages in ActionErrors:

ActionErrors errors = form.validate(mapping, request);
saveErrors(request, errors);

Display of errors in the JSP

    <logic:messagesPresent message="false">
        <div class="errors_div">
        <html:messages id="aMsg" message="false">
            <logic:present name="aMsg">
                
                <div class="errors">
                    <bean:write name="aMsg" filter="false" />
                </div>
            </logic:present>
        </html:messages>
        </div>
    </logic:messagesPresent>

Thanks a lot for any help



--
View this message in context: http://struts.1045723.n5.nabble.com/Struts-1-3-errorStyleClass-Not-Working-Error-Field-Highlighting-tp5717942.html
Sent from the Struts - User mailing list archive at Nabble.com.

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


Mime
View raw message