Hi,
I have a form with three imagebuttons which submit it. Only one of these buttons actually triggers an action which makes use of the form. The others are for things like reload a page value (request bound not in the form) or going one step back. They are mainly in the form because this allows POST parameters.
May flow behind the page looks like this:
My problem here is that on the one hand I need the bindAndValidate state even if I don't want to validate the bean (bindAndValidate method does nothing). Otherwise I get an exception:Code:<view-state id="step1View" view="page.register.step1"> <transition on="back" to="bindAndValidateFormStep0"/> <transition on="next" to="bindAndValidateFormStep1"/> <transition on="items" to="bindAndValidateFormStep1_1"/> </view-state> <action-state id="bindAndValidateFormStep0"> <action bean="registerFormAction" method="bindAndValidate"/> <transition on="success" to="step0View"/> </action-state> <action-state id="bindAndValidateFormStep1"> <action bean="registerFormAction" method="bindAndValidate"> <property name="validatorMethod" value="validateCustomerDetails"/> </action> <transition on="success" to="step1_selectItem"/> <transition on="error" to="step1View"/> </action-state> <action-state id="bindAndValidateFormStep1_1"> <action bean="registerFormAction" method="bindAndValidate"/> <transition on="success" to="step1_fetchItems"/> </action-state>
On the other hand I can't "route" the original event through the bindAndValidate action-state therefor I need three different bindAndValidate actions which are refering to other states. Is there a better way to achive this? Even with the misuse of the imagebuttons in the form?Code:java.lang.IllegalStateException: Required attribute 'org.springframework.validation.BindException.#formObject' is not present in flow scope; attributes present are = map['PROSPECT' -> com.xyz.tst.common.dto.ProspectDTO@1a498b6, 'registerActionForm' -> com.xyz.tst.webapp.struts.forms.RegisterFlowActionForm@125f76b, '#formObject' -> com.xyz.tst.webapp.struts.forms.RegisterFlowActionForm@125f76b
Thanks,
Markus


Reply With Quote