PDA

View Full Version : Problem with formErrorsScope set to FLOW


roelof
Apr 13th, 2006, 04:54 AM
Hi,

I believe there's a problem when using FormAction's setter formErrorsScope to FLOW.

When transitioning from one state to another and then back again(aangifte.delicttype.view -> aangifte.toegestaan.view -> aangifte.delicttype.view) and then back again using to different FormAction's with different form backing objects. I get an error that it can't find a property on the form. DelictTypeForm is bound to DelictTypeAction and AangifteCriteriaForm is bound to AangifteToegestaanAction. When going back, it still thinks AangifteCriteriaForm is the current form object, while it should be DelictTypeForm. When formErrorsScope is set to REQUEST, everything works fine. I use SWF in conjunction with the Struts FlowAction and SpringBindingActionForm.


Dump:

2006-04-13 10:40:15,757 - DEBUG: [FlowRequestHandler] Returning [resume] [ResponseInstruction@101e40ed flowExecutionKey = [FlowExecutionKey@fb900ed conversationId = '23A0BBE9-2215-D258-B8B3-F20E22AC7F7A', continuationId = 'F119F31B-0AA8-2362-1DD5-45A70D985223'], flowExecutionContext = [FlowExecutionImpl@91ec0ea flow = 'internet-flow', activeFlow = 'internet-flow', currentState = 'aangifte.delicttype.view', flowSessions = list[[FlowSessionImpl@95f40ea flow = 'internet-flow', state = 'aangifte.delicttype.view', scope = map['org.springframework.validation.BindException.star tForm' -> org.springframework.validation.BindException: BindException: 0 errors, 'aangifteCriteriaForm' -> nl.politie.aangifte.ui.form.AangifteCriteriaForm@4 7a4c0ed, 'delictTypeForm' -> nl.politie.aangifte.ui.form.DelictTypeForm@19bec0e a, 'org.springframework.validation.BindException.deli ctTypeForm' -> org.springframework.validation.BindException: BindException: 0 errors, 'org.springframework.validation.BindException.curr entFormObject' -> org.springframework.validation.BindException: BindException: 0 errors, 'currentFormObject' -> nl.politie.aangifte.ui.form.DelictTypeForm@19bec0e a, 'startForm' -> nl.politie.aangifte.ui.form.StartForm@74300ea, 'wizard' -> nl.politie.aangifte.ui.Wizard@17e380ea, 'org.springframework.validation.BindException.aang ifteCriteriaForm' -> org.springframework.validation.BindException: BindException: 0 errors]]]], viewSelection = [ApplicationView@833c0ed viewName = 'delicttype', model = map['wizardMenu' -> nl.politie.aangifte.ui.NavigationMenu@7b240e8, 'org.springframework.validation.BindException.star tForm' -> org.springframework.validation.BindException: BindException: 0 errors, 'aangifteCriteriaForm' -> nl.politie.aangifte.ui.form.AangifteCriteriaForm@4 7a4c0ed, 'delictTypeForm' -> nl.politie.aangifte.ui.form.DelictTypeForm@19bec0e a, 'org.springframework.validation.BindException.deli ctTypeForm' -> org.springframework.validation.BindException: BindException: 0 errors, 'org.springframework.validation.BindException.curr entFormObject' -> org.springframework.validation.BindException: BindException: 0 errors, 'currentFormObject' -> nl.politie.aangifte.ui.form.DelictTypeForm@19bec0e a, 'startForm' -> nl.politie.aangifte.ui.form.StartForm@74300ea, 'wizard' -> nl.politie.aangifte.ui.Wizard@17e380ea, 'org.springframework.validation.BindException.aang ifteCriteriaForm' -> org.springframework.validation.BindException: BindException: 0 errors]]]


2006-04-13 10:40:15,898 - ERROR: [InsertTag] ServletException in '/pages/delictkeuze.jsp': Invalid property 'delictCategorie' of bean class [nl.politie.aangifte.ui.form.AangifteCriteriaForm]: Bean property 'delictCategorie' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
javax.servlet.ServletException: Invalid property 'delictCategorie' of bean class [nl.politie.aangifte.ui.form.AangifteCriteriaForm]: Bean property 'delictCategorie' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

The formErrorsScope and formObjectScope of both actions is set to FLOW.

<bean id="formActionTemplate" class="nl.politie.aangifte.ui.action.InternetFormAction" abstract="true">
<description>Action class template voor acties waarbij een formulier betrokken is. Standaard worden
alle forms in FLOW scope bijgehouden en wordt de commons validator Validator gebruikt. Bevat ook
de methods om de stappen in het aangifte proces te markeren als voltooid (of onvoltooid te maken)
</description>
<property name="formErrorsScope" value="FLOW" />
<property name="formObjectScope" value="FLOW" />
<property name="validator" ref="beanValidator" />
<property name="propertyEditorRegistrar" ref="defaultPropertyEditorRegistrar" />
<property name="internetFormActionUtil" ref="internetFormActionUtil" />
</bean>

<bean id="delictTypeAction" class="nl.politie.aangifte.ui.action.DelictTypeFormAction" parent="formActionTemplate">
<description>Stap 2: Delictkeuze en goederen type</description>
<property name="formObjectName" value="delictTypeForm" />
<property name="formObjectClass" value="nl.politie.aangifte.ui.form.DelictTypeForm" />
<property name="allowedFields">
<list>
<value>delictCategorie</value>
<value>goedCategorie</value>
</list>
</property>
</bean>

<bean id="aangifteToegestaanAction" class="nl.politie.aangifte.ui.action.AangifteToegestaanFo rmAction" parent="formActionTemplate">
<description>Stap 3: Kan ik aangifte doen? (aangifte toegestaan)</description>
<property name="formObjectName" value="aangifteCriteriaForm" />
<property name="formObjectClass" value="nl.politie.aangifte.ui.form.AangifteCriteriaForm" />
<property name="validator" ref="aangifteCriteriaValidator" />
<property name="aangifteCriteriaService" ref="aangifteCriteriaService1" />
</bean>

<view-state id="aangifte.delicttype.view" view="delicttype">
<entry-actions>
<action bean="delictTypeAction" method="setupForm" />
</entry-actions>
<transition on="forward" to="aangifte.delicttype">
<action bean="delictTypeAction" method="bindAndValidate" />
<action bean="delictTypeAction" method="volgendeVraag" />
<action bean="delictTypeAction" method="setStepCompleted" />
</transition>
<transition on="back" to="aangifte.delicttype.view">
<action bean="delictTypeAction" method="conditionalBindAndValidate" />
<action bean="delictTypeAction" method="vorigeVraag" />
</transition>
</view-state>

<decision-state id="aangifte.delicttype">
<if test="${flowScope.delictTypeForm.goedCategorie != null}" then="aangifte.toegestaan.view" else="aangifte.delicttype.view" />
</decision-state>

<view-state id="aangifte.toegestaan.view" view="aangiftecriteria">
<entry-actions>
<action bean="aangifteToegestaanAction" method="setupForm" />
</entry-actions>
<transition on="forward" to="aangifte.aangever.view">
<action bean="aangifteToegestaanAction" method="bindAndValidate" />
<action bean="aangifteToegestaanAction" method="setStepCompleted" />
</transition>
<transition on="back" to="aangifte.delicttype.view">
<action bean="aangifteToegestaanAction" method="conditionalBindAndValidate" />
<action bean="aangifteToegestaanAction" method="resetForm" />
</transition>
</view-state>

Any ideas Keith?

Kind regards,
Roelof.