views:

3342

answers:

1

My view-state to action-state transition does not appear to be happening. In the following example, I want the view-state to transition to the action-state when the user submits the form. Pretty basic stuff. But the setA() method does not get called.

In the jsp, does the submit input element need to have a name of "_eventId", or "_eventId_submit", or is no name necessary? Or is something else wrong? What is webflow checking against when evaluating the on attribute of transition element?

<flow ... start-state="stateA">
<var name="flowBean" class="demo.webflow.WebFlowBean" />
<view-state id="stateA" view="fooView">
    <transition on="submit" to="changeA" />
</view-state>
<action-state id="changeA">
    <evaluate expression="flowScope.flowBean.setA(requestParameters.value)" />
    ...
</action-state>

JSP:

<form action="demo.htm" name="myform" id="myform" method="post">
<input type="hidden" name="_flowExecutionKey" value='<c:out value="${flowExecutionKey}"/>'/>
<input type="submit" name="????" value="Continue"/>
A: 

Found the problem, I think. I removed the action attribute from my form, and now everything works:

<form name="myform" id="myform" method="post">

I'm guessing that, by having that action URL in there, somehow I was restarting the flow with each submit.

Scott Bale