Hello,
first of all, I did search the user-archive and I had a look at the
struts-simple workflow example by Ted Husted.
Nevertheless I wasn't able to solve this problem o my own.
I have one action class (InsertPersonAction) and one DynaValidatorForm class
(InsertPersonBean) that should do
the work of build up the form, that is, add three collections to it,
validate the input of the 2 input pages and then
make the insert to the db.
For the input to the form I use the following configuration :
<action
path="/secureZone/insertPerson/Input"
type="de.subsist.zeiterfassung.controller.actions.InsertPersonAction"
name="insertPersonForm"
scope="session"
parameter="input"
validate="false" >
<forward name="Success" path="ZuKS.insertPerson1Definition"
redirect="true"/>
</action>
In the action class I check for the parameter and then add the collections
to the form. fine
For the actual insert of the data I configured this :
<action
path="/secureZone/insertPerson/Insert"
type="de.subsist.zeiterfassung.controller.actions.InsertPersonAction"
name="insertPersonForm"
scope="session"
parameter="insert"
validate="true"
input="/secureZone/insertPerson/Insert.do" >
<forward name="Page1" path="ZuKS.insertPerson1Definition"
redirect="false"/>
<forward name="Page2" path="ZuKS.insertPerson2Definition"
redirect="false"/>
<forward name="Success" path="ZuKS.mainLayoutDefinition"
redirect="true"/>
</action>
The reset-method of the Form is changed so that only the collections are not
reseted.
Anything else gets set to the initial value as in the source code of the
DynaValidatorForm class.
The navigation (next, previous, insert) are done with several submit buttons
as explained somewhere in this
archive, e.g.
<html:reset>
<bean:message key="button.reset"/>
</html:reset>
<html:cancel onclick="bCancel=true;">
<bean:message key="button.cancel"/>
</html:cancel>
<html:submit property="next" onclick="bCancel=false;">
<bean:message key="button.next"/>
</html:submit>
The problem now is that all the time I want to go back with the 'previous'
button I get into a loop because the values
from the form get reset, the validation therefore fails and the validator
sends me back to the same action it came from and so on.
When I read Ted's example I turned off client-side validation without any
effect.
One solution could be to just do nothing in the reset method and implement
some reset methods for every page displayed
but in the form class in struts-simple (DemoBean) the reset method sets
every member variable to "" and it's working so I don't
know why it's not in my case.
Can somebody advice me on this issue. Any help is appreciated.
Ralf
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>