You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by gads zooks <ga...@yahoo.com> on 2004/06/01 20:27:03 UTC

dynavalidator form problem: some fields (all text) are reset when validate fails

hi,
 
im using a dynavalidator actionform for a multi-page (wizard style) input form and using a DispatchAction as the Action class. I can navigate thru  the form without a problem if i turn off validation (not using html:javascript > right now ) 
 
here is the setup
page1.jsp ---- action1.step1()  ----- validate() ----------page2.jsp -----action2.step2() ----validate() -----action2.step3()  
 
action1,2 and 3 are of same type, derived from DispatchAction
 
at page2.jsp if i dont enter all of the required fields then control goes back to page2.jsp, however some of the fields that i had entered already are cleared. the funny thing is that some fields are re-populated and some are not... ALL fields are text fields. one is of type dropdown and that is also re-populated....if i set validate to false, all the data i enter is seen on the next page .....ie data is not lost then...im using session scope for the form
 
i just dont know what im doing wrong...i have been searching on this list for 3 days now...but have finally decided to write ....
 
code snippets that may be helpful :
 
<action path="/Action1"
            type="..CreateLicenseAction"   //extends DispatchAction
            name="newLicense"
            validate="false"         //im calling validate from the action class functions, not thru struts
            parameter="function"
            scope="session"
            input="/pages/Page1.jsp">
            <forward name="next"        path="/pages/Page2.jsp" />
            <forward name="cancel"      path="/home.do" />
        </action>
 
<action path="/Action2"
            type="..CreateLicenseAction"  
            name="newLicense"
            validate="false"         //im calling validate from the action class functions, not thru struts
            parameter="function"
            scope="session"
            input="/pages/Page2.jsp">
            <forward name="next"        path="/pages/Page3.jsp" />
            <forward name="back"        path="/pages/Page1.jsp" />
            <forward name="cancel"      path="/home.do" />
        </action>

 
<form-bean name="newLicense" type="org.apache.struts.validator.DynaValidatorForm" >
            <form-property name="function"     type="java.lang.String" />
            <form-property name="lastName"          type="java.lang.String" />
            <form-property name="firstName"         type="java.lang.String" /> 
 </form-bean>

thanks for ur patience, in reading all this......
 
if u want i can post further info...
 
amit

		
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger