Thanks for your response.
have a table

in one of the columns have <html:text>. not all rows have the <html:text>.

need to validate the user entered values in the <html:text> 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 <html:text> 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:
<form-bean name="Form" type="org.apache.struts.validator.DynaValidatorForm" dynamic="true">
           <form-property name="AdHrs" type="java.util.ArrayList"/>
.........................
..................
</form-bean>

<action
           path="/PrepareAction"
           type="com.actions.PrepareAction"
           name="Form"
           scope="session"
           validate="false"
           input="/pages/Hours.jsp">
<forward name="success" path="/pages/Hours.jsp" redirect="false"/>
       </action>

       <action
           path="/DispatchHoursAction"
           type="com.actions.DispatchHoursAction"
           name="Form"
           scope="session"
           validate="true"
           input="/pages/Hours.jsp"
           parameter="method">
<forward name="successSave" path="/PrepareAction.do" redirect="false"/> <forward name="successRefresh" path="/PrepareAction.do" redirect="false"/> <forward name="successPrev" path="/PrepareCustAction.do" redirect="false"/> <forward name="successNext" path="/PrepareLoanAction.do" redirect="false"/>
       </action>

JSP:
<html:form action="DispatchHoursAction.do" method="post">
....................
<display:table name="sessionScope.Form.AdHrs" id="rows"
requestURI="PrepareAction.do" >
........................
.....................
<display:column titleKey="lbl.hrs">
       <c:if test="${rows.Hrs != null}">
              <html:text name="rows" property="Hrs"
errorStyleClass="errormsg"/>
        </c:if>
</display:column>
</display:table>
</html:form>

Validation.xml

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





From: Laurie Harper <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
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

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

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" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
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 <html:text>

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.

<display:table name="sessionScope.Form.hrs" id="rows" requestURI="PrepareAction.do" >
........................
.....................
<display:column titleKey="lbl.hrs">
       <c:if test="${rows.hrs != null}">
<html:text name="rows" property="hrs" errorStyleClass="errormsg"/>
        </c:if>
</display:column>
</display:table>

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: [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]


_________________________________________________________________
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