Thankyou all for helping me working on this.

I have one morequestion on this.

have couple of input field in a column of a table. Using indexed properties for the input fields and validating using the same.

When the user entered wrong values in more than one input field, the Validator is returning only one error the first one and displays the same and highlights the first error input field. Only after correcting the first and press a button which validates the form again and then the second error is shown/highlighted.

Is it possible to highlight all the error input fields using index properties? how can this be done?

Thanks.


From: "Niall Pemberton" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
To: "Struts Users Mailing List" <user@struts.apache.org>
Subject: Re: errorStyleClass not working
Date: Thu, 20 Jul 2006 00:45:41 +0100

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 <[EMAIL PROTECTED]> 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" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
>To: "Struts Users Mailing List" <user@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:[EMAIL PROTECTED]
>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" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
> >To: "Struts Users Mailing List" <user@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:[EMAIL PROTECTED]
> >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" <[EMAIL PROTECTED]>
> > >Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
> > >To: "Struts Users Mailing List" <user@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:[EMAIL PROTECTED]
> > >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" <[EMAIL PROTECTED]>
> > > >Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
> > > >To: "Struts Users Mailing List" <user@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" <[EMAIL PROTECTED]>
> > > > >Reply-To: "Struts Users Mailing List" <user@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: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

_________________________________________________________________
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to