Hey,
I’m learing WebFlow 2.0, and I’m not understanding how to create, or pass a backing object model.
Even though I don’t know 1.0, I do understand how formAction works; however, 2.0 doesn’t have formAction, and I’ve heard it’s not best practice to use a set up like that.
I’ve read throughout the webflow 2.0 reference, and I’m still stuck.
First off when I click on a link it should then enter this flow. This flow should then create a backing object “person”, where I can then bind “from the purchaseForm” the properties. After the client then submits the form, I’d like to be able to first bind the data, then pass the model to another view-state. “I’m really looking for best practice here” because I’ve seen so many ways using EL and such that I’m not sure which way to do it.
<!-- Create a backing object -->
<on-start>
<evaluate expression="mycart.person.newPerson" result="flowScope.person" />
</on-start>
<!-- New customers create a new account before moving forward -->
<view-state id="purchaseForm" view="purchaseForm">
<on-render>
<set name="requestScope.person" value="person"></set>
</on-render>
<transition on="thanks" to="thanks" />
</view-state>
<view-state id="thanks" model="person" view="thanks" >
<transition on="submit" to="purchaseForm" />
</view-state>