|
From: Keith D. <ke...@in...> - 2005-04-02 18:14:33
|
Now that I think about it just "method" might be even better, as 'execute'
is also implied (actions all execute, duh):
<action id="myFormAction" method="bindAndValidate"/>
Thoughts?
Keith
-----Original Message-----
From: Keith Donald [mailto:ke...@in...]
Sent: Saturday, April 02, 2005 1:11 PM
To: 'spr...@li...'
Subject: RE: [Springframework-developer] webflow: FormAction question
Hey Steven,
Be sure to use the 'users' list or forum for questions like this next time,
so more users will see it.
You can use one FormAction to do this, yep. Erwin will be checking in a
wizard sample shortly (potentially this evening), so I'll just sum up what
the sample will illustrate:
- The FormAction already has a 'bindAndValidate' method, that does what you
want on each intermediate page submit. So you can have that method called
on each submit by using a bindAndValidate<X> action state, where <X>
describes what it is you are binding and validating.
For example:
<action-state id="bindAndValidatePageFoo">
<action id="myFormAction">
<property name="executeMethodName" value="bindAndValidate"/>
</action>
<transition on="error" to="viewPageFoo"/>
<transition on="success" to="viewPageBar"/>
</action-state>
<action-state id="bindAndValidatePageBar">
<action id="myFormAction">
<property name="executeMethodName" value="bindAndValidate"/>
</action>
<transition on="error" to="viewPageBar"/>
<transition on="success" to="submit"/>
</action-state>
<action-state id="submit">
<action id="myFormAction">
<property name="executeMethodName" value="submit"/>
</action>
<transition on="error" to="error"/>
<transition on="success" to="end"/>
</action-state>
Keep in mind I've omitted the view states and end states here, (I also typed
this on-the-fly) but this should get you started.
Looking at the definition above, and given this need will be quite common,
it may be wise for us to make the 'executeMethodName' property a first class
citizen in the DTD. Erwin, what do you think? Others? For example:
<action id="myFormAction" executeMethod="submit"/>
That would shorten the above xml a good bit, to:
<action-state id="bindAndValidatePageFoo">
<action id="myFormAction" executeMethod="bindAndValidate"/>
<transition on="error" to="viewPageFoo"/>
<transition on="success" to="viewPageBar"/>
</action-state>
<action-state id="bindAndValidatePageBar">
<action id="myFormAction" executeMethod="bindAndValidate"/>
<transition on="error" to="viewPageBar"/>
<transition on="success" to="submit"/>
</action-state>
<action-state id="submit">
<action id="myFormAction" executeMethod="submit"/>
<transition on="error" to="error"/>
<transition on="success" to="end"/>
</action-state>
It may also be wise to drop "Name" from "executeMethodName", leaving the
shorter "executeMethod" - as name is sort of implied already anyway...
(though name is more accurate from a implementation detail POV, but who
cares about that here.)
What do you think?
Keith
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...] On Behalf Of
Steven Devijver
Sent: Saturday, April 02, 2005 12:55 PM
To: spr...@li...
Subject: [Springframework-developer] webflow: FormAction question
Hi,
I want to create a wizard that spans across multiple pages. I want to
bind to one and the same form instance across the different pages and
validate on every page submit. When the wizard completes I want this
one instance to contain all the information entered through the
various forms.
Can I use FormAction for this purpose?
Thanks
Steven
--
"If you want to be a different fish, you gotta jump out of the school."
-- Captain Beefheart
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|