Thankyou very much for your responce. >From: Laurie Harper >Reply-To: "Struts Users Mailing List" >To: user@struts.apache.org >Subject: Re: FW: html:text >Date: Tue, 11 Jul 2006 17:32:55 -0400 > > > > type="org.apache.struts.validator.DynaValidatorForm" dynamic="true"> > > > >So your form bean defines only one property, named AdHrs, which is a list >of values. > > > > > > requestURI="PrepareAction.do" > > > > > > > > errorStyleClass="errormsg"/> > > > > > > > > > >You're using display:table to expose each entry in the list as a scripting >variable rows, so rows is a bean of whatever type is stored in the AdHrs >property, and you're binding the html:text element to the Hrs property of >that bean. > >Note that you have, at this point, broken the link between the form bean >and the property; Struts has no way to know that the thing referenced by >the html:text tag is a property on the form once the request is submitted. > >What you probably want here is something like property="AdHrs[${rownum}].Hrs" value="${rows.Hrs}"/> -- the property name >needs to name a property on the form bean. You'll have to consult >display:table's documentation to figure out how to get rownum. > > >
> > > >This applies a validation rule to the property 'hrs' on the form bean Form. >As noted above, the only property you've defined is AdHrs. According to >your code, that property holds a list of beans which have a property named >Hrs (not hrs). > >I'm not sure off hand how to specify validation rules for indexed >properties, but at the very least you'll need to reference the nested >property correctly. > >L. > >fea jabi wrote: >> >>Thanks for your response. >>have a table >> >>in one of the columns have . not all rows have the . >> >>need to validate the user entered values in the using >>validator.xml. >> >>Created an object.java file which holds the row data of the table. >>Created a list of these row objects and stored as a form property. >> >>Not sure how to proceed now. should I put the List as a property in the >>form-bean?? if I did so how will the user edited updated to >>the list so that I can do validations? >> >>Using the below the table is filled with the right values but when the >>user entered values i nthe input fields the form property hrs has previous >>values itself and does not validate right as it doesn't have the user >>entered values. >> >>need help with this. >> >>Struts Config: >>>type="org.apache.struts.validator.DynaValidatorForm" dynamic="true"> >> >>.......................... >>................... >> >> >>> path="/PrepareAction" >> type="com.actions.PrepareAction" >> name="Form" >> scope="session" >> validate="false" >> input="/pages/Hours.jsp"> >> >redirect="false"/> >> >> >> > path="/DispatchHoursAction" >> type="com.actions.DispatchHoursAction" >> name="Form" >> scope="session" >> validate="true" >> input="/pages/Hours.jsp" >> parameter="method"> >> >redirect="false"/> >> >redirect="false"/> >> >redirect="false"/> >> >redirect="false"/> >> >> >>JSP: >> >>..................... >>>requestURI="PrepareAction.do" > >>......................... >>...................... >> >> >> >errorStyleClass="errormsg"/> >> >> >> >> >> >>Validation.xml >> >> >> >> >> >> >> >> test >> (*this* >= 0) >> >> >> >> >> >> >> >> >> >>>From: Laurie Harper >>>Reply-To: "Struts Users Mailing List" >>>To: user@struts.apache.org >>>Subject: Re: FW: html:text >>>Date: Thu, 06 Jul 2006 14:36:27 -0400 >>> >>>Does the 'Form' form bean have a property 'hrs'? How is it declared? What >>>is the type and base type (parent class) of the form bean? We really need >>>to see the relevant parts of your struts-config.xml (form bean >>>declaration and action mappings) to tell what's happening. >>> >>>L. >>> >>>fea jabi wrote: >>>>can somene help me with this please? >>>> >>>>how to do validation in validator.xml >>>> >>>> >>>>
>>>> >>>> >>>> >>>> >>>> test >>>> (*this* >= 0) >>>> >>>> >>>>
>>>>
>>>> >>>>Where hrs is the attribute in the row object of the table. Even when I >>>>enter string value in the text field I see no error messages. >>>> >>>> >>>>>From: "fea jabi" >>>>>Reply-To: "Struts Users Mailing List" >>>>>To: user@struts.apache.org >>>>>Subject: html:text >>>>>Date: Wed, 05 Jul 2006 15:36:47 -0400 >>>>> >>>>>In a table in one of the columns there are >>>>> >>>>>is it required that each input item has a corresponding form-bean >>>>>property? >>>>> >>>>> >>>>>by using the below does it take all the user entered values in the >>>>>column?? >>>>> >>>>>Each row is an object and sessionScope.Form.hrs is the list of these >>>>>objects. >>>>> >>>>>>>>>requestURI="PrepareAction.do" > >>>>>........................ >>>>>..................... >>>>> >>>>> >>>>> >>>>errorStyleClass="errormsg"/> >>>>> >>>>> >>>>> >>>>> >>>>>Thanks. >>>>> >>>>>_________________________________________________________________ >>>>>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 >>>>> >>>> >>>>_________________________________________________________________ >>>>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 > _________________________________________________________________ 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