You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by fea jabi <zy...@hotmail.com> on 2006/07/17 17:44:49 UTC

errorStyleClass not working

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


Re: errorStyleClass not working

Posted by Niall Pemberton <ni...@gmail.com>.
See "1. Why have two JSP tags that do the same job?":

http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html

..and follow the link to the Wiki regarding ActionErrors/ActionMessages:

http://wiki.apache.org/struts/ActionErrorsAndActionMessages

Niall

On 7/19/06, fea jabi <zy...@hotmail.com> wrote:
> Yah, in the JSP where the errorStyleClass is working I am using <html:errors
> property="name"/>
>
> So, do I have to use html:errors? not html:messages?
>
> yes, I am using DynaValidatorForm but calling validate from action class.
> The validation is done in validator.xml
>
> In dispath action class I have
> ActionMessages messages = (ActionMessages)frm.validate( mapping, request );
>         if ( messages != null && !messages.isEmpty() ) {
>             saveMessages(request, messages);
>             return (mapping.findForward("validationFailed"));
>         }
>
> Should I be saving action errors instead of ActionMessages?
>
> Thanks.
>
>
>
> >From: "David Friedman" <hu...@ix.netcom.com>
> >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> >To: "Struts Users Mailing List" <us...@struts.apache.org>
> >Subject: RE: errorStyleClass not working
> >Date: Wed, 19 Jul 2006 14:51:48 -0400
> >
> >There is something odd going on here.
> >
> >In the JSP's where the html:messages and errorStyleClass are working, do
> >you
> >have html:messages setting 'message="true"'?   This is odd because that
> >changes the key from Globals.MESSAGE_KEY to Global.ERROR_KEY.  Action1 Html
> >tags perform error lookups (I just checked the SVN repos) using in the
> >Globals.ERROR_KEY, not the Globals.MESSAGE_KEY.  That makes me wonder:
> >
> >Are the error messages you are seeing on this page (the page where
> >errorStyleClass is not working) the ones you saved INSIDE your action or
> >are
> >you 100% sure these are validation errors from the DynaValidatorForm?
> >
> >What do you see when you remove the 'message="true"' from your
> >html:messages
> >tag and then run your action?
> >
> >See this page for what I'm talking about:
> >http://husted.com/struts/tips/017.html
> >
> >Take a look at your logic:messagesPresent tag doing the same thing.  This
> >is
> >the current SVN java code ( just a snippet ) that is important:
> >
> >public class MessagesPresentTag extends ConditionalTagBase {
> >     /**
> >      * If this is set to 'true', then the <code>Globals.MESSAGE_KEY</code>
> >      * will be used to retrieve the messages from scope.
> >      */
> >     protected String message = null;
> >
> >     public MessagesPresentTag() {
> >         name = Globals.ERROR_KEY;
> >     }
> >// ....... End of snippet, lots cut but you get the idea that
> >// you are changing the keys to NOT use the Globals.ERROR_KEY
> >// that I believe errorStyleClass is using.
> >}
> >
> >Regards,
> >David
> >
> >-----Original Message-----
> >From: fea jabi [mailto:zyxrm@hotmail.com]
> >Sent: Wednesday, July 19, 2006 1:57 PM
> >To: user@struts.apache.org
> >Subject: RE: errorStyleClass not working
> >
> >
> >yes, using 1.2.7 version of  struts. This(errorStyleClass) does work in
> >another page though whose property is in Form-bean.
> >
> >But here in this page, I have the arraylist in the form-bean, and the
> >arraylist contains the list of objects whose one of the attribute is shown
> >in the input field. probably something is missing here.
> >
> >actually showing the messages. I can see the message entered value is not
> >valid.
> >
> >             <logic:messagesPresent message="true">
> >                 <UL>
> >                  <html:messages id="error" message="true">
> >                     <span class="errors"><LI><c:out
> >value="${error}"/></LI></span>
> >                  </html:messages>
> >                 </UL>
> >             </logic:messagesPresent>
> >
> >
> > >From: "David Friedman" <hu...@ix.netcom.com>
> > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> > >To: "Struts Users Mailing List" <us...@struts.apache.org>
> > >Subject: RE: errorStyleClass not working
> > >Date: Wed, 19 Jul 2006 13:36:10 -0400
> > >
> > >I see your final output does not list the class="..." attribute.  What
> > >version of struts are you using?  Accoring to the release notes, only
> > >versions 1.2.7 and above have the errorStyleClass attributes in them.
> >Are
> > >you sure your version supports errorStyleClass?  And we ARE talking the
> > >output of your html:text tag on a page which also shows the actual
> >errors,
> > >via the html:errors tag, right?
> > >
> > >Regards,
> > >David
> > >
> > >-----Original Message-----
> > >From: fea jabi [mailto:zyxrm@hotmail.com]
> > >Sent: Wednesday, July 19, 2006 1:28 PM
> > >To: user@struts.apache.org
> > >Subject: RE: errorStyleClass not working
> > >
> > >
> > >Thanks for helping me.
> > >
> > >The web page has
> > >
> > ><input type="text" name="hrs[0].adHrs" value="12">
> > >
> > ><input type="text" name="hrs[1].adHrs" value="dgsadg">
> > >
> > >................
> > >
> > >
> > > >You said "nested page".  Are you including one page inside another or
> >do
> > > >you
> > > >simply mean "nested inside a displaytag library tag"?
> > >
> > >I mean "nested inside a displaytag library tag".
> > >
> > >trying to validate the user entered values, here the 2nd one i.e
> > >name="hrs[1].adHrs" checking if user entered numeric value. I am getting
> > >the
> > >error msg back too. But only the errorStyleClass is not working.
> > >
> > >Thanks.
> > >
> > >
> > > >From: "David Friedman" <hu...@ix.netcom.com>
> > > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> > > >To: "Struts Users Mailing List" <us...@struts.apache.org>
> > > >Subject: RE: errorStyleClass not working
> > > >Date: Wed, 19 Jul 2006 13:12:17 -0400
> > > >
> > > >I was asking what your html:text tag outputs.  Can you post what it
> >puts
> > > >into your web page (when you view the source of the generated page?)
> >You
> > > >know, the generated html code: (example below)
> > > >
> > > ><input type="text" name="something" value="some value" class="errormsg"
> > >/>
> > > >
> > > >For what it is worth, your css class definition worked fine in a test
> > >page
> > > >/
> > > >form of mine.
> > > >
> > > >You said "nested page".  Are you including one page inside another or
> >do
> > > >you
> > > >simply mean "nested inside a displaytag library tag"?
> > > >
> > > >Regards,
> > > >David
> > > >
> > > >-----Original Message-----
> > > >From: fea jabi [mailto:zyxrm@hotmail.com]
> > > >Sent: Wednesday, July 19, 2006 12:53 PM
> > > >To: user@struts.apache.org
> > > >Subject: RE: errorStyleClass not working
> > > >
> > > >
> > > >Thanks for your response.
> > > >
> > > > >a) Have you checked your output to make sure the class is set in the
> > >html
> > > > >when an error occurs?
> > > >
> > > >what class are you talking about here?
> > > >
> > > >yes, the css is embeded and the errormsg is also in there. It works
> >fine
> > >in
> > > >other pages. except for this nested page.
> > > >
> > > >.errormsg{
> > > >color: red;
> > > >background: inherit;
> > > >font-size: 11px;
> > > >border: 1px solid red;
> > > >padding: 3px;
> > > >}
> > > >
> > > >Hoping to get an answer for this. Thanks.
> > > >
> > > >
> > > > >From: "David Friedman" <hu...@ix.netcom.com>
> > > > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> > > > >To: "Struts Users Mailing List" <us...@struts.apache.org>
> > > > >Subject: RE: errorStyleClass not working
> > > > >Date: Wed, 19 Jul 2006 12:18:24 -0400
> > > > >
> > > > >a) Have you checked your output to make sure the class is set in the
> > >html
> > > > >when an error occurs?
> > > > >
> > > > >b) What is the CSS you specify for that "errormsg" style definition?
> > > > >
> > > > >c) Have you embedded your style definition in the web page to ensure
> >it
> > > >is
> > > > >loaded properly?  FireFox has a good plugin called "web developer"
> >that
> > > > >includes a live CSS editor so you can make sure your css is loaded
> >and
> > > > >"adjust" it to see how different changes alter your page appearance.
> > > > >
> > > > >Regards,
> > > > >David
> > > > >
> > > > > >From: "fea jabi" <zy...@hotmail.com>
> > > > > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> > > > > >To: user@struts.apache.org
> > > > > >Subject: errorStyleClass not working
> > > > > >Date: Mon, 17 Jul 2006 11:44:49 -0400
> > > > > >
> > > > > >.......................
> > > > > ><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>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >For additional commands, e-mail: user-help@struts.apache.org
> >
>
> _________________________________________________________________
> Is your PC infected? Get a FREE online computer virus scan from McAfee(r)
> Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


RE: errorStyleClass not working

Posted by fea jabi <zy...@hotmail.com>.
After saving the ActionErrors in action class.
and giving
<logic:messagesPresent>
                <UL>
                 <html:messages id="error">
                    <span class="errors"><LI><c:out 
value="${error}"/></LI></span>
                 </html:messages>
                </UL>
            </logic:messagesPresent>

made the highlighting to work right.

I tried to validate in Action class to check if validate was working right.


When to use the ActionMessages and when to use ActionErrors.

Thanks a lot for your help.


>From: "fea jabi" <zy...@hotmail.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: user@struts.apache.org
>Subject: RE: errorStyleClass not working
>Date: Wed, 19 Jul 2006 15:06:02 -0400
>
>Yah, in the JSP where the errorStyleClass is working I am using 
><html:errors property="name"/>
>
>So, do I have to use html:errors? not html:messages?
>
>yes, I am using DynaValidatorForm but calling validate from action class. 
>The validation is done in validator.xml
>
>In dispath action class I have
>ActionMessages messages = (ActionMessages)frm.validate( mapping, request );
>        if ( messages != null && !messages.isEmpty() ) {
>            saveMessages(request, messages);
>            return (mapping.findForward("validationFailed"));
>        }
>
>Should I be saving action errors instead of ActionMessages?
>
>Thanks.
>
>
>
>>From: "David Friedman" <hu...@ix.netcom.com>
>>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>>To: "Struts Users Mailing List" <us...@struts.apache.org>
>>Subject: RE: errorStyleClass not working
>>Date: Wed, 19 Jul 2006 14:51:48 -0400
>>
>>There is something odd going on here.
>>
>>In the JSP's where the html:messages and errorStyleClass are working, do 
>>you
>>have html:messages setting 'message="true"'?   This is odd because that
>>changes the key from Globals.MESSAGE_KEY to Global.ERROR_KEY.  Action1 
>>Html
>>tags perform error lookups (I just checked the SVN repos) using in the
>>Globals.ERROR_KEY, not the Globals.MESSAGE_KEY.  That makes me wonder:
>>
>>Are the error messages you are seeing on this page (the page where
>>errorStyleClass is not working) the ones you saved INSIDE your action or 
>>are
>>you 100% sure these are validation errors from the DynaValidatorForm?
>>
>>What do you see when you remove the 'message="true"' from your 
>>html:messages
>>tag and then run your action?
>>
>>See this page for what I'm talking about:
>>http://husted.com/struts/tips/017.html
>>
>>Take a look at your logic:messagesPresent tag doing the same thing.  This 
>>is
>>the current SVN java code ( just a snippet ) that is important:
>>
>>public class MessagesPresentTag extends ConditionalTagBase {
>>     /**
>>      * If this is set to 'true', then the 
>><code>Globals.MESSAGE_KEY</code>
>>      * will be used to retrieve the messages from scope.
>>      */
>>     protected String message = null;
>>
>>     public MessagesPresentTag() {
>>         name = Globals.ERROR_KEY;
>>     }
>>// ....... End of snippet, lots cut but you get the idea that
>>// you are changing the keys to NOT use the Globals.ERROR_KEY
>>// that I believe errorStyleClass is using.
>>}
>>
>>Regards,
>>David
>>
>>-----Original Message-----
>>From: fea jabi [mailto:zyxrm@hotmail.com]
>>Sent: Wednesday, July 19, 2006 1:57 PM
>>To: user@struts.apache.org
>>Subject: RE: errorStyleClass not working
>>
>>
>>yes, using 1.2.7 version of  struts. This(errorStyleClass) does work in
>>another page though whose property is in Form-bean.
>>
>>But here in this page, I have the arraylist in the form-bean, and the
>>arraylist contains the list of objects whose one of the attribute is shown
>>in the input field. probably something is missing here.
>>
>>actually showing the messages. I can see the message entered value is not
>>valid.
>>
>>             <logic:messagesPresent message="true">
>>                 <UL>
>>                  <html:messages id="error" message="true">
>>                     <span class="errors"><LI><c:out
>>value="${error}"/></LI></span>
>>                  </html:messages>
>>                 </UL>
>>             </logic:messagesPresent>
>>
>>
>> >From: "David Friedman" <hu...@ix.netcom.com>
>> >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>> >To: "Struts Users Mailing List" <us...@struts.apache.org>
>> >Subject: RE: errorStyleClass not working
>> >Date: Wed, 19 Jul 2006 13:36:10 -0400
>> >
>> >I see your final output does not list the class="..." attribute.  What
>> >version of struts are you using?  Accoring to the release notes, only
>> >versions 1.2.7 and above have the errorStyleClass attributes in them.  
>>Are
>> >you sure your version supports errorStyleClass?  And we ARE talking the
>> >output of your html:text tag on a page which also shows the actual 
>>errors,
>> >via the html:errors tag, right?
>> >
>> >Regards,
>> >David
>> >
>> >-----Original Message-----
>> >From: fea jabi [mailto:zyxrm@hotmail.com]
>> >Sent: Wednesday, July 19, 2006 1:28 PM
>> >To: user@struts.apache.org
>> >Subject: RE: errorStyleClass not working
>> >
>> >
>> >Thanks for helping me.
>> >
>> >The web page has
>> >
>> ><input type="text" name="hrs[0].adHrs" value="12">
>> >
>> ><input type="text" name="hrs[1].adHrs" value="dgsadg">
>> >
>> >................
>> >
>> >
>> > >You said "nested page".  Are you including one page inside another or 
>>do
>> > >you
>> > >simply mean "nested inside a displaytag library tag"?
>> >
>> >I mean "nested inside a displaytag library tag".
>> >
>> >trying to validate the user entered values, here the 2nd one i.e
>> >name="hrs[1].adHrs" checking if user entered numeric value. I am getting
>> >the
>> >error msg back too. But only the errorStyleClass is not working.
>> >
>> >Thanks.
>> >
>> >
>> > >From: "David Friedman" <hu...@ix.netcom.com>
>> > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>> > >To: "Struts Users Mailing List" <us...@struts.apache.org>
>> > >Subject: RE: errorStyleClass not working
>> > >Date: Wed, 19 Jul 2006 13:12:17 -0400
>> > >
>> > >I was asking what your html:text tag outputs.  Can you post what it 
>>puts
>> > >into your web page (when you view the source of the generated page?)  
>>You
>> > >know, the generated html code: (example below)
>> > >
>> > ><input type="text" name="something" value="some value" 
>>class="errormsg"
>> >/>
>> > >
>> > >For what it is worth, your css class definition worked fine in a test
>> >page
>> > >/
>> > >form of mine.
>> > >
>> > >You said "nested page".  Are you including one page inside another or 
>>do
>> > >you
>> > >simply mean "nested inside a displaytag library tag"?
>> > >
>> > >Regards,
>> > >David
>> > >
>> > >-----Original Message-----
>> > >From: fea jabi [mailto:zyxrm@hotmail.com]
>> > >Sent: Wednesday, July 19, 2006 12:53 PM
>> > >To: user@struts.apache.org
>> > >Subject: RE: errorStyleClass not working
>> > >
>> > >
>> > >Thanks for your response.
>> > >
>> > > >a) Have you checked your output to make sure the class is set in the
>> >html
>> > > >when an error occurs?
>> > >
>> > >what class are you talking about here?
>> > >
>> > >yes, the css is embeded and the errormsg is also in there. It works 
>>fine
>> >in
>> > >other pages. except for this nested page.
>> > >
>> > >.errormsg{
>> > >color: red;
>> > >background: inherit;
>> > >font-size: 11px;
>> > >border: 1px solid red;
>> > >padding: 3px;
>> > >}
>> > >
>> > >Hoping to get an answer for this. Thanks.
>> > >
>> > >
>> > > >From: "David Friedman" <hu...@ix.netcom.com>
>> > > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>> > > >To: "Struts Users Mailing List" <us...@struts.apache.org>
>> > > >Subject: RE: errorStyleClass not working
>> > > >Date: Wed, 19 Jul 2006 12:18:24 -0400
>> > > >
>> > > >a) Have you checked your output to make sure the class is set in the
>> >html
>> > > >when an error occurs?
>> > > >
>> > > >b) What is the CSS you specify for that "errormsg" style definition?
>> > > >
>> > > >c) Have you embedded your style definition in the web page to ensure 
>>it
>> > >is
>> > > >loaded properly?  FireFox has a good plugin called "web developer" 
>>that
>> > > >includes a live CSS editor so you can make sure your css is loaded 
>>and
>> > > >"adjust" it to see how different changes alter your page appearance.
>> > > >
>> > > >Regards,
>> > > >David
>> > > >
>> > > > >From: "fea jabi" <zy...@hotmail.com>
>> > > > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>> > > > >To: user@struts.apache.org
>> > > > >Subject: errorStyleClass not working
>> > > > >Date: Mon, 17 Jul 2006 11:44:49 -0400
>> > > > >
>> > > > >.......................
>> > > > ><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>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>
>_________________________________________________________________
>Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ 
>Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
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


RE: errorStyleClass not working

Posted by fea jabi <zy...@hotmail.com>.
Yah, in the JSP where the errorStyleClass is working I am using <html:errors 
property="name"/>

So, do I have to use html:errors? not html:messages?

yes, I am using DynaValidatorForm but calling validate from action class. 
The validation is done in validator.xml

In dispath action class I have
ActionMessages messages = (ActionMessages)frm.validate( mapping, request );
        if ( messages != null && !messages.isEmpty() ) {
            saveMessages(request, messages);
            return (mapping.findForward("validationFailed"));
        }

Should I be saving action errors instead of ActionMessages?

Thanks.



>From: "David Friedman" <hu...@ix.netcom.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Subject: RE: errorStyleClass not working
>Date: Wed, 19 Jul 2006 14:51:48 -0400
>
>There is something odd going on here.
>
>In the JSP's where the html:messages and errorStyleClass are working, do 
>you
>have html:messages setting 'message="true"'?   This is odd because that
>changes the key from Globals.MESSAGE_KEY to Global.ERROR_KEY.  Action1 Html
>tags perform error lookups (I just checked the SVN repos) using in the
>Globals.ERROR_KEY, not the Globals.MESSAGE_KEY.  That makes me wonder:
>
>Are the error messages you are seeing on this page (the page where
>errorStyleClass is not working) the ones you saved INSIDE your action or 
>are
>you 100% sure these are validation errors from the DynaValidatorForm?
>
>What do you see when you remove the 'message="true"' from your 
>html:messages
>tag and then run your action?
>
>See this page for what I'm talking about:
>http://husted.com/struts/tips/017.html
>
>Take a look at your logic:messagesPresent tag doing the same thing.  This 
>is
>the current SVN java code ( just a snippet ) that is important:
>
>public class MessagesPresentTag extends ConditionalTagBase {
>     /**
>      * If this is set to 'true', then the <code>Globals.MESSAGE_KEY</code>
>      * will be used to retrieve the messages from scope.
>      */
>     protected String message = null;
>
>     public MessagesPresentTag() {
>         name = Globals.ERROR_KEY;
>     }
>// ....... End of snippet, lots cut but you get the idea that
>// you are changing the keys to NOT use the Globals.ERROR_KEY
>// that I believe errorStyleClass is using.
>}
>
>Regards,
>David
>
>-----Original Message-----
>From: fea jabi [mailto:zyxrm@hotmail.com]
>Sent: Wednesday, July 19, 2006 1:57 PM
>To: user@struts.apache.org
>Subject: RE: errorStyleClass not working
>
>
>yes, using 1.2.7 version of  struts. This(errorStyleClass) does work in
>another page though whose property is in Form-bean.
>
>But here in this page, I have the arraylist in the form-bean, and the
>arraylist contains the list of objects whose one of the attribute is shown
>in the input field. probably something is missing here.
>
>actually showing the messages. I can see the message entered value is not
>valid.
>
>             <logic:messagesPresent message="true">
>                 <UL>
>                  <html:messages id="error" message="true">
>                     <span class="errors"><LI><c:out
>value="${error}"/></LI></span>
>                  </html:messages>
>                 </UL>
>             </logic:messagesPresent>
>
>
> >From: "David Friedman" <hu...@ix.netcom.com>
> >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> >To: "Struts Users Mailing List" <us...@struts.apache.org>
> >Subject: RE: errorStyleClass not working
> >Date: Wed, 19 Jul 2006 13:36:10 -0400
> >
> >I see your final output does not list the class="..." attribute.  What
> >version of struts are you using?  Accoring to the release notes, only
> >versions 1.2.7 and above have the errorStyleClass attributes in them.  
>Are
> >you sure your version supports errorStyleClass?  And we ARE talking the
> >output of your html:text tag on a page which also shows the actual 
>errors,
> >via the html:errors tag, right?
> >
> >Regards,
> >David
> >
> >-----Original Message-----
> >From: fea jabi [mailto:zyxrm@hotmail.com]
> >Sent: Wednesday, July 19, 2006 1:28 PM
> >To: user@struts.apache.org
> >Subject: RE: errorStyleClass not working
> >
> >
> >Thanks for helping me.
> >
> >The web page has
> >
> ><input type="text" name="hrs[0].adHrs" value="12">
> >
> ><input type="text" name="hrs[1].adHrs" value="dgsadg">
> >
> >................
> >
> >
> > >You said "nested page".  Are you including one page inside another or 
>do
> > >you
> > >simply mean "nested inside a displaytag library tag"?
> >
> >I mean "nested inside a displaytag library tag".
> >
> >trying to validate the user entered values, here the 2nd one i.e
> >name="hrs[1].adHrs" checking if user entered numeric value. I am getting
> >the
> >error msg back too. But only the errorStyleClass is not working.
> >
> >Thanks.
> >
> >
> > >From: "David Friedman" <hu...@ix.netcom.com>
> > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> > >To: "Struts Users Mailing List" <us...@struts.apache.org>
> > >Subject: RE: errorStyleClass not working
> > >Date: Wed, 19 Jul 2006 13:12:17 -0400
> > >
> > >I was asking what your html:text tag outputs.  Can you post what it 
>puts
> > >into your web page (when you view the source of the generated page?)  
>You
> > >know, the generated html code: (example below)
> > >
> > ><input type="text" name="something" value="some value" class="errormsg"
> >/>
> > >
> > >For what it is worth, your css class definition worked fine in a test
> >page
> > >/
> > >form of mine.
> > >
> > >You said "nested page".  Are you including one page inside another or 
>do
> > >you
> > >simply mean "nested inside a displaytag library tag"?
> > >
> > >Regards,
> > >David
> > >
> > >-----Original Message-----
> > >From: fea jabi [mailto:zyxrm@hotmail.com]
> > >Sent: Wednesday, July 19, 2006 12:53 PM
> > >To: user@struts.apache.org
> > >Subject: RE: errorStyleClass not working
> > >
> > >
> > >Thanks for your response.
> > >
> > > >a) Have you checked your output to make sure the class is set in the
> >html
> > > >when an error occurs?
> > >
> > >what class are you talking about here?
> > >
> > >yes, the css is embeded and the errormsg is also in there. It works 
>fine
> >in
> > >other pages. except for this nested page.
> > >
> > >.errormsg{
> > >color: red;
> > >background: inherit;
> > >font-size: 11px;
> > >border: 1px solid red;
> > >padding: 3px;
> > >}
> > >
> > >Hoping to get an answer for this. Thanks.
> > >
> > >
> > > >From: "David Friedman" <hu...@ix.netcom.com>
> > > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> > > >To: "Struts Users Mailing List" <us...@struts.apache.org>
> > > >Subject: RE: errorStyleClass not working
> > > >Date: Wed, 19 Jul 2006 12:18:24 -0400
> > > >
> > > >a) Have you checked your output to make sure the class is set in the
> >html
> > > >when an error occurs?
> > > >
> > > >b) What is the CSS you specify for that "errormsg" style definition?
> > > >
> > > >c) Have you embedded your style definition in the web page to ensure 
>it
> > >is
> > > >loaded properly?  FireFox has a good plugin called "web developer" 
>that
> > > >includes a live CSS editor so you can make sure your css is loaded 
>and
> > > >"adjust" it to see how different changes alter your page appearance.
> > > >
> > > >Regards,
> > > >David
> > > >
> > > > >From: "fea jabi" <zy...@hotmail.com>
> > > > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> > > > >To: user@struts.apache.org
> > > > >Subject: errorStyleClass not working
> > > > >Date: Mon, 17 Jul 2006 11:44:49 -0400
> > > > >
> > > > >.......................
> > > > ><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>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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


RE: errorStyleClass not working

Posted by David Friedman <hu...@ix.netcom.com>.
There is something odd going on here.

In the JSP's where the html:messages and errorStyleClass are working, do you
have html:messages setting 'message="true"'?   This is odd because that
changes the key from Globals.MESSAGE_KEY to Global.ERROR_KEY.  Action1 Html
tags perform error lookups (I just checked the SVN repos) using in the
Globals.ERROR_KEY, not the Globals.MESSAGE_KEY.  That makes me wonder:

Are the error messages you are seeing on this page (the page where
errorStyleClass is not working) the ones you saved INSIDE your action or are
you 100% sure these are validation errors from the DynaValidatorForm?

What do you see when you remove the 'message="true"' from your html:messages
tag and then run your action?

See this page for what I'm talking about:
http://husted.com/struts/tips/017.html

Take a look at your logic:messagesPresent tag doing the same thing.  This is
the current SVN java code ( just a snippet ) that is important:

public class MessagesPresentTag extends ConditionalTagBase {
    /**
     * If this is set to 'true', then the <code>Globals.MESSAGE_KEY</code>
     * will be used to retrieve the messages from scope.
     */
    protected String message = null;

    public MessagesPresentTag() {
        name = Globals.ERROR_KEY;
    }
// ....... End of snippet, lots cut but you get the idea that
// you are changing the keys to NOT use the Globals.ERROR_KEY
// that I believe errorStyleClass is using.
}

Regards,
David

-----Original Message-----
From: fea jabi [mailto:zyxrm@hotmail.com]
Sent: Wednesday, July 19, 2006 1:57 PM
To: user@struts.apache.org
Subject: RE: errorStyleClass not working


yes, using 1.2.7 version of  struts. This(errorStyleClass) does work in
another page though whose property is in Form-bean.

But here in this page, I have the arraylist in the form-bean, and the
arraylist contains the list of objects whose one of the attribute is shown
in the input field. probably something is missing here.

actually showing the messages. I can see the message entered value is not
valid.

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


>From: "David Friedman" <hu...@ix.netcom.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Subject: RE: errorStyleClass not working
>Date: Wed, 19 Jul 2006 13:36:10 -0400
>
>I see your final output does not list the class="..." attribute.  What
>version of struts are you using?  Accoring to the release notes, only
>versions 1.2.7 and above have the errorStyleClass attributes in them.  Are
>you sure your version supports errorStyleClass?  And we ARE talking the
>output of your html:text tag on a page which also shows the actual errors,
>via the html:errors tag, right?
>
>Regards,
>David
>
>-----Original Message-----
>From: fea jabi [mailto:zyxrm@hotmail.com]
>Sent: Wednesday, July 19, 2006 1:28 PM
>To: user@struts.apache.org
>Subject: RE: errorStyleClass not working
>
>
>Thanks for helping me.
>
>The web page has
>
><input type="text" name="hrs[0].adHrs" value="12">
>
><input type="text" name="hrs[1].adHrs" value="dgsadg">
>
>................
>
>
> >You said "nested page".  Are you including one page inside another or do
> >you
> >simply mean "nested inside a displaytag library tag"?
>
>I mean "nested inside a displaytag library tag".
>
>trying to validate the user entered values, here the 2nd one i.e
>name="hrs[1].adHrs" checking if user entered numeric value. I am getting
>the
>error msg back too. But only the errorStyleClass is not working.
>
>Thanks.
>
>
> >From: "David Friedman" <hu...@ix.netcom.com>
> >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> >To: "Struts Users Mailing List" <us...@struts.apache.org>
> >Subject: RE: errorStyleClass not working
> >Date: Wed, 19 Jul 2006 13:12:17 -0400
> >
> >I was asking what your html:text tag outputs.  Can you post what it puts
> >into your web page (when you view the source of the generated page?)  You
> >know, the generated html code: (example below)
> >
> ><input type="text" name="something" value="some value" class="errormsg"
>/>
> >
> >For what it is worth, your css class definition worked fine in a test
>page
> >/
> >form of mine.
> >
> >You said "nested page".  Are you including one page inside another or do
> >you
> >simply mean "nested inside a displaytag library tag"?
> >
> >Regards,
> >David
> >
> >-----Original Message-----
> >From: fea jabi [mailto:zyxrm@hotmail.com]
> >Sent: Wednesday, July 19, 2006 12:53 PM
> >To: user@struts.apache.org
> >Subject: RE: errorStyleClass not working
> >
> >
> >Thanks for your response.
> >
> > >a) Have you checked your output to make sure the class is set in the
>html
> > >when an error occurs?
> >
> >what class are you talking about here?
> >
> >yes, the css is embeded and the errormsg is also in there. It works fine
>in
> >other pages. except for this nested page.
> >
> >.errormsg{
> >color: red;
> >background: inherit;
> >font-size: 11px;
> >border: 1px solid red;
> >padding: 3px;
> >}
> >
> >Hoping to get an answer for this. Thanks.
> >
> >
> > >From: "David Friedman" <hu...@ix.netcom.com>
> > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> > >To: "Struts Users Mailing List" <us...@struts.apache.org>
> > >Subject: RE: errorStyleClass not working
> > >Date: Wed, 19 Jul 2006 12:18:24 -0400
> > >
> > >a) Have you checked your output to make sure the class is set in the
>html
> > >when an error occurs?
> > >
> > >b) What is the CSS you specify for that "errormsg" style definition?
> > >
> > >c) Have you embedded your style definition in the web page to ensure it
> >is
> > >loaded properly?  FireFox has a good plugin called "web developer" that
> > >includes a live CSS editor so you can make sure your css is loaded and
> > >"adjust" it to see how different changes alter your page appearance.
> > >
> > >Regards,
> > >David
> > >
> > > >From: "fea jabi" <zy...@hotmail.com>
> > > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> > > >To: user@struts.apache.org
> > > >Subject: errorStyleClass not working
> > > >Date: Mon, 17 Jul 2006 11:44:49 -0400
> > > >
> > > >.......................
> > > ><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>


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


RE: errorStyleClass not working

Posted by fea jabi <zy...@hotmail.com>.
yes, using 1.2.7 version of  struts. This(errorStyleClass) does work in 
another page though whose property is in Form-bean.

But here in this page, I have the arraylist in the form-bean, and the 
arraylist contains the list of objects whose one of the attribute is shown 
in the input field. probably something is missing here.

actually showing the messages. I can see the message entered value is not 
valid.

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


>From: "David Friedman" <hu...@ix.netcom.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Subject: RE: errorStyleClass not working
>Date: Wed, 19 Jul 2006 13:36:10 -0400
>
>I see your final output does not list the class="..." attribute.  What
>version of struts are you using?  Accoring to the release notes, only
>versions 1.2.7 and above have the errorStyleClass attributes in them.  Are
>you sure your version supports errorStyleClass?  And we ARE talking the
>output of your html:text tag on a page which also shows the actual errors,
>via the html:errors tag, right?
>
>Regards,
>David
>
>-----Original Message-----
>From: fea jabi [mailto:zyxrm@hotmail.com]
>Sent: Wednesday, July 19, 2006 1:28 PM
>To: user@struts.apache.org
>Subject: RE: errorStyleClass not working
>
>
>Thanks for helping me.
>
>The web page has
>
><input type="text" name="hrs[0].adHrs" value="12">
>
><input type="text" name="hrs[1].adHrs" value="dgsadg">
>
>................
>
>
> >You said "nested page".  Are you including one page inside another or do
> >you
> >simply mean "nested inside a displaytag library tag"?
>
>I mean "nested inside a displaytag library tag".
>
>trying to validate the user entered values, here the 2nd one i.e
>name="hrs[1].adHrs" checking if user entered numeric value. I am getting 
>the
>error msg back too. But only the errorStyleClass is not working.
>
>Thanks.
>
>
> >From: "David Friedman" <hu...@ix.netcom.com>
> >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> >To: "Struts Users Mailing List" <us...@struts.apache.org>
> >Subject: RE: errorStyleClass not working
> >Date: Wed, 19 Jul 2006 13:12:17 -0400
> >
> >I was asking what your html:text tag outputs.  Can you post what it puts
> >into your web page (when you view the source of the generated page?)  You
> >know, the generated html code: (example below)
> >
> ><input type="text" name="something" value="some value" class="errormsg" 
>/>
> >
> >For what it is worth, your css class definition worked fine in a test 
>page
> >/
> >form of mine.
> >
> >You said "nested page".  Are you including one page inside another or do
> >you
> >simply mean "nested inside a displaytag library tag"?
> >
> >Regards,
> >David
> >
> >-----Original Message-----
> >From: fea jabi [mailto:zyxrm@hotmail.com]
> >Sent: Wednesday, July 19, 2006 12:53 PM
> >To: user@struts.apache.org
> >Subject: RE: errorStyleClass not working
> >
> >
> >Thanks for your response.
> >
> > >a) Have you checked your output to make sure the class is set in the 
>html
> > >when an error occurs?
> >
> >what class are you talking about here?
> >
> >yes, the css is embeded and the errormsg is also in there. It works fine 
>in
> >other pages. except for this nested page.
> >
> >.errormsg{
> >color: red;
> >background: inherit;
> >font-size: 11px;
> >border: 1px solid red;
> >padding: 3px;
> >}
> >
> >Hoping to get an answer for this. Thanks.
> >
> >
> > >From: "David Friedman" <hu...@ix.netcom.com>
> > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> > >To: "Struts Users Mailing List" <us...@struts.apache.org>
> > >Subject: RE: errorStyleClass not working
> > >Date: Wed, 19 Jul 2006 12:18:24 -0400
> > >
> > >a) Have you checked your output to make sure the class is set in the 
>html
> > >when an error occurs?
> > >
> > >b) What is the CSS you specify for that "errormsg" style definition?
> > >
> > >c) Have you embedded your style definition in the web page to ensure it
> >is
> > >loaded properly?  FireFox has a good plugin called "web developer" that
> > >includes a live CSS editor so you can make sure your css is loaded and
> > >"adjust" it to see how different changes alter your page appearance.
> > >
> > >Regards,
> > >David
> > >
> > > >From: "fea jabi" <zy...@hotmail.com>
> > > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> > > >To: user@struts.apache.org
> > > >Subject: errorStyleClass not working
> > > >Date: Mon, 17 Jul 2006 11:44:49 -0400
> > > >
> > > >.......................
> > > ><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>
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >For additional commands, e-mail: user-help@struts.apache.org
> > >
> >
> >_________________________________________________________________
> >FREE pop-up blocking with the new MSN Toolbar – get it now!
> >http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >For additional commands, e-mail: user-help@struts.apache.org
> >
>
>_________________________________________________________________
>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
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


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


RE: errorStyleClass not working

Posted by David Friedman <hu...@ix.netcom.com>.
I see your final output does not list the class="..." attribute.  What
version of struts are you using?  Accoring to the release notes, only
versions 1.2.7 and above have the errorStyleClass attributes in them.  Are
you sure your version supports errorStyleClass?  And we ARE talking the
output of your html:text tag on a page which also shows the actual errors,
via the html:errors tag, right?

Regards,
David

-----Original Message-----
From: fea jabi [mailto:zyxrm@hotmail.com]
Sent: Wednesday, July 19, 2006 1:28 PM
To: user@struts.apache.org
Subject: RE: errorStyleClass not working


Thanks for helping me.

The web page has

<input type="text" name="hrs[0].adHrs" value="12">

<input type="text" name="hrs[1].adHrs" value="dgsadg">

................


>You said "nested page".  Are you including one page inside another or do
>you
>simply mean "nested inside a displaytag library tag"?

I mean "nested inside a displaytag library tag".

trying to validate the user entered values, here the 2nd one i.e
name="hrs[1].adHrs" checking if user entered numeric value. I am getting the
error msg back too. But only the errorStyleClass is not working.

Thanks.


>From: "David Friedman" <hu...@ix.netcom.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Subject: RE: errorStyleClass not working
>Date: Wed, 19 Jul 2006 13:12:17 -0400
>
>I was asking what your html:text tag outputs.  Can you post what it puts
>into your web page (when you view the source of the generated page?)  You
>know, the generated html code: (example below)
>
><input type="text" name="something" value="some value" class="errormsg" />
>
>For what it is worth, your css class definition worked fine in a test page
>/
>form of mine.
>
>You said "nested page".  Are you including one page inside another or do
>you
>simply mean "nested inside a displaytag library tag"?
>
>Regards,
>David
>
>-----Original Message-----
>From: fea jabi [mailto:zyxrm@hotmail.com]
>Sent: Wednesday, July 19, 2006 12:53 PM
>To: user@struts.apache.org
>Subject: RE: errorStyleClass not working
>
>
>Thanks for your response.
>
> >a) Have you checked your output to make sure the class is set in the html
> >when an error occurs?
>
>what class are you talking about here?
>
>yes, the css is embeded and the errormsg is also in there. It works fine in
>other pages. except for this nested page.
>
>.errormsg{
>color: red;
>background: inherit;
>font-size: 11px;
>border: 1px solid red;
>padding: 3px;
>}
>
>Hoping to get an answer for this. Thanks.
>
>
> >From: "David Friedman" <hu...@ix.netcom.com>
> >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> >To: "Struts Users Mailing List" <us...@struts.apache.org>
> >Subject: RE: errorStyleClass not working
> >Date: Wed, 19 Jul 2006 12:18:24 -0400
> >
> >a) Have you checked your output to make sure the class is set in the html
> >when an error occurs?
> >
> >b) What is the CSS you specify for that "errormsg" style definition?
> >
> >c) Have you embedded your style definition in the web page to ensure it
>is
> >loaded properly?  FireFox has a good plugin called "web developer" that
> >includes a live CSS editor so you can make sure your css is loaded and
> >"adjust" it to see how different changes alter your page appearance.
> >
> >Regards,
> >David
> >
> > >From: "fea jabi" <zy...@hotmail.com>
> > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> > >To: user@struts.apache.org
> > >Subject: errorStyleClass not working
> > >Date: Mon, 17 Jul 2006 11:44:49 -0400
> > >
> > >.......................
> > ><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>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >For additional commands, e-mail: user-help@struts.apache.org
> >
>
>_________________________________________________________________
>FREE pop-up blocking with the new MSN Toolbar – get it now!
>http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
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


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


RE: errorStyleClass not working

Posted by fea jabi <zy...@hotmail.com>.
Thanks for helping me.

The web page has

<input type="text" name="hrs[0].adHrs" value="12">

<input type="text" name="hrs[1].adHrs" value="dgsadg">

................


>You said "nested page".  Are you including one page inside another or do 
>you
>simply mean "nested inside a displaytag library tag"?

I mean "nested inside a displaytag library tag".

trying to validate the user entered values, here the 2nd one i.e 
name="hrs[1].adHrs" checking if user entered numeric value. I am getting the 
error msg back too. But only the errorStyleClass is not working.

Thanks.


>From: "David Friedman" <hu...@ix.netcom.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Subject: RE: errorStyleClass not working
>Date: Wed, 19 Jul 2006 13:12:17 -0400
>
>I was asking what your html:text tag outputs.  Can you post what it puts
>into your web page (when you view the source of the generated page?)  You
>know, the generated html code: (example below)
>
><input type="text" name="something" value="some value" class="errormsg" />
>
>For what it is worth, your css class definition worked fine in a test page 
>/
>form of mine.
>
>You said "nested page".  Are you including one page inside another or do 
>you
>simply mean "nested inside a displaytag library tag"?
>
>Regards,
>David
>
>-----Original Message-----
>From: fea jabi [mailto:zyxrm@hotmail.com]
>Sent: Wednesday, July 19, 2006 12:53 PM
>To: user@struts.apache.org
>Subject: RE: errorStyleClass not working
>
>
>Thanks for your response.
>
> >a) Have you checked your output to make sure the class is set in the html
> >when an error occurs?
>
>what class are you talking about here?
>
>yes, the css is embeded and the errormsg is also in there. It works fine in
>other pages. except for this nested page.
>
>.errormsg{
>color: red;
>background: inherit;
>font-size: 11px;
>border: 1px solid red;
>padding: 3px;
>}
>
>Hoping to get an answer for this. Thanks.
>
>
> >From: "David Friedman" <hu...@ix.netcom.com>
> >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> >To: "Struts Users Mailing List" <us...@struts.apache.org>
> >Subject: RE: errorStyleClass not working
> >Date: Wed, 19 Jul 2006 12:18:24 -0400
> >
> >a) Have you checked your output to make sure the class is set in the html
> >when an error occurs?
> >
> >b) What is the CSS you specify for that "errormsg" style definition?
> >
> >c) Have you embedded your style definition in the web page to ensure it 
>is
> >loaded properly?  FireFox has a good plugin called "web developer" that
> >includes a live CSS editor so you can make sure your css is loaded and
> >"adjust" it to see how different changes alter your page appearance.
> >
> >Regards,
> >David
> >
> > >From: "fea jabi" <zy...@hotmail.com>
> > >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> > >To: user@struts.apache.org
> > >Subject: errorStyleClass not working
> > >Date: Mon, 17 Jul 2006 11:44:49 -0400
> > >
> > >.......................
> > ><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>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >For additional commands, e-mail: user-help@struts.apache.org
> >
>
>_________________________________________________________________
>FREE pop-up blocking with the new MSN Toolbar – get it now!
>http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
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


RE: errorStyleClass not working

Posted by David Friedman <hu...@ix.netcom.com>.
I was asking what your html:text tag outputs.  Can you post what it puts
into your web page (when you view the source of the generated page?)  You
know, the generated html code: (example below)

<input type="text" name="something" value="some value" class="errormsg" />

For what it is worth, your css class definition worked fine in a test page /
form of mine.

You said "nested page".  Are you including one page inside another or do you
simply mean "nested inside a displaytag library tag"?

Regards,
David

-----Original Message-----
From: fea jabi [mailto:zyxrm@hotmail.com]
Sent: Wednesday, July 19, 2006 12:53 PM
To: user@struts.apache.org
Subject: RE: errorStyleClass not working


Thanks for your response.

>a) Have you checked your output to make sure the class is set in the html
>when an error occurs?

what class are you talking about here?

yes, the css is embeded and the errormsg is also in there. It works fine in
other pages. except for this nested page.

.errormsg{
color: red;
background: inherit;
font-size: 11px;
border: 1px solid red;
padding: 3px;
}

Hoping to get an answer for this. Thanks.


>From: "David Friedman" <hu...@ix.netcom.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Subject: RE: errorStyleClass not working
>Date: Wed, 19 Jul 2006 12:18:24 -0400
>
>a) Have you checked your output to make sure the class is set in the html
>when an error occurs?
>
>b) What is the CSS you specify for that "errormsg" style definition?
>
>c) Have you embedded your style definition in the web page to ensure it is
>loaded properly?  FireFox has a good plugin called "web developer" that
>includes a live CSS editor so you can make sure your css is loaded and
>"adjust" it to see how different changes alter your page appearance.
>
>Regards,
>David
>
> >From: "fea jabi" <zy...@hotmail.com>
> >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> >To: user@struts.apache.org
> >Subject: errorStyleClass not working
> >Date: Mon, 17 Jul 2006 11:44:49 -0400
> >
> >.......................
> ><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>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


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


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


RE: errorStyleClass not working

Posted by fea jabi <zy...@hotmail.com>.
Thanks for your response.

>a) Have you checked your output to make sure the class is set in the html
>when an error occurs?

what class are you talking about here?

yes, the css is embeded and the errormsg is also in there. It works fine in 
other pages. except for this nested page.

.errormsg{
color: red;
background: inherit;
font-size: 11px;
border: 1px solid red;
padding: 3px;
}

Hoping to get an answer for this. Thanks.


>From: "David Friedman" <hu...@ix.netcom.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Subject: RE: errorStyleClass not working
>Date: Wed, 19 Jul 2006 12:18:24 -0400
>
>a) Have you checked your output to make sure the class is set in the html
>when an error occurs?
>
>b) What is the CSS you specify for that "errormsg" style definition?
>
>c) Have you embedded your style definition in the web page to ensure it is
>loaded properly?  FireFox has a good plugin called "web developer" that
>includes a live CSS editor so you can make sure your css is loaded and
>"adjust" it to see how different changes alter your page appearance.
>
>Regards,
>David
>
> >From: "fea jabi" <zy...@hotmail.com>
> >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> >To: user@struts.apache.org
> >Subject: errorStyleClass not working
> >Date: Mon, 17 Jul 2006 11:44:49 -0400
> >
> >.......................
> ><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>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


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


RE: errorStyleClass not working

Posted by David Friedman <hu...@ix.netcom.com>.
a) Have you checked your output to make sure the class is set in the html
when an error occurs?

b) What is the CSS you specify for that "errormsg" style definition?

c) Have you embedded your style definition in the web page to ensure it is
loaded properly?  FireFox has a good plugin called "web developer" that
includes a live CSS editor so you can make sure your css is loaded and
"adjust" it to see how different changes alter your page appearance.

Regards,
David

>From: "fea jabi" <zy...@hotmail.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: user@struts.apache.org
>Subject: errorStyleClass not working
>Date: Mon, 17 Jul 2006 11:44:49 -0400
>
>.......................
><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>


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


RE: errorStyleClass not working

Posted by fea jabi <zy...@hotmail.com>.
can someone help me with this please.

Thanks.


>From: "fea jabi" <zy...@hotmail.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: user@struts.apache.org
>Subject: errorStyleClass not working
>Date: Mon, 17 Jul 2006 11:44:49 -0400
>
>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.
>
>Need help with highlighting.
>
>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
>

_________________________________________________________________
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