Title: Message
...but will this still execute the validation I need on the step 1 form? If I understand correctly, defining only the validation for steps 2, 3 and 4 would let the user enter whatever h/she likes at the step 1 form. Or will any validation errors block the step1.success result from happening?
 
thanks a lot for the help! :)
-cv
 
-----Mensagem original-----
De: Jason Carreira [mailto:[EMAIL PROTECTED]
Enviada em: segunda-feira, 22 de setembro de 2003 15:13
Para: [EMAIL PROTECTED]
Assunto: RE: [OS-webwork] basic flow?

Don't apply the validationWorkflowStack to step 1 (or change your validation.xml files so that they don't apply validations for context "step1").
 
If you have your validations defined at the class level, it will run all of them for every step and add errors for things which haven't been added yet. Better to define your validation files in multiple files like this:
 
CadastroWizardAction-step2-validation.xml
CadastroWizardAction-step3-validation.xml
...
 
And define your step-specific validations in these files.
 
Jason
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, September 22, 2003 1:23 PM
To: [EMAIL PROTECTED]
Subject: [OS-webwork] basic flow?

Hi folks! :)

I'm trying to build a simple wizard to add an user to my system. I created a simple action that puts a new User object into the session and chains it to subsequent actions, which go filling the User object's setters for me, and then, at the end of the chain, I save everything putting a message on a JMS queue.

The problem here is that, when using the XWork Validation Framework, the first hit doesn't even call execute() or validate(), but goes directly to the input page, with the errors assigned. I defined the action mappings like this:

        (...)

        <action name="step1" class="foo.actions.CadastroWizardAction">
                <result name="input" type="velocity">
                        <param name="location">user/add/step1.vm</param>
                </result>
                <result name="success" type="chain">
                        <param name="actionName">step2</param>
                </result>
                <interceptor-ref name="validationWorkflowStack"/>
        </action>

        <action name="step2" class="foo.actions.CadastroWizardAction">
                <result name="input" type="velocity">
                        <param name="location">user/add/step2.vm</param>
                </result>
                <result name="success" type="chain">
                        <param name="actionName">step3</param>
                </result>
                <interceptor-ref name="validationWorkflowStack"/>
        </action>

        (...)

I'm using the same action throughout the wizard, cause they just need to chain to the next step until the last one, which does the real work:

        <action name="step2" class="foo.actions.SendNewUserToQueueAction">
                <result name="success" type="velocity">
                        <param name="location">user/add/added.vm</param>
                </result>
                <result name="error" type="velocity">
                        <param name="location">user/add/error.vm</param>
                </result>
                <interceptor-ref name="validationWorkflowStack"/>
        </action>

I surely know this is a dumb question, but how do I make it show the input page with no errors flagged when I access it for the first time, if it doesn't even call execute()?

Thanks in advance!
-cv

Reply via email to