|
From: Keith D. <ke...@in...> - 2005-04-03 16:58:32
|
Update: support for a 'method' shortcut attribute on <action> element is in
CVS Head. This nicely reduces the amount of XML needed to specify a target
method on a multi-action instance.
Note: we've decided to keep the MultiAction class after all, as we feel it's
better to have consistency there with the Action interface, rather than have
any-old-object be invokable via reflection from an ActionState.
Keith
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...] On Behalf Of
Keith Donald
Sent: Saturday, April 02, 2005 1:52 PM
To: spr...@li...
Subject: RE: [Springframework-developer] webflow: FormAction question
Update: Erwin and I are also seriously considering removing Multi-Action
entirely, in favor of the ActionState doing the method dispatch if
appropriate. This is arguably cleaner and more flexible, and forces no
special inheritance requirement on your "multi-action" implementation.
Regarding backwards compatibility here: existing Multi-Action
implementations should continue to work, with the following caveats:
1. You'll just need to remove the 'extends MultiAction' clause if we decide
to remove that class. Your "Event <method>(RequestContext context)" action
execute method implementations won't have to change.
2. If your MultiAction leverages the AbstractAction pre-execute and
post-execute template methods (which we find are rarely used), you'll need
to use Spring AOP to achieve that pre/post execution logic. At some point
we may add support for declarative pre/post execute method as additional
properties for the ActionStateAction (e.g. <action ...> <property
name="preExecuteMethod" value="..."/></action>)
So we're proposing three things:
1. Rename of 'executeMethodName' property to 'method'.
2. Promotion of 'method' to first-class 'action' element attribute.
3. Remove of MultiAction in favor of method-based dispatch in the
ActionState class.
Keith
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...] On Behalf Of
Keith Donald
Sent: Saturday, April 02, 2005 1:14 PM
To: 'Keith Donald'; spr...@li...
Subject: RE: [Springframework-developer] webflow: FormAction question
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
-------------------------------------------------------
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
-------------------------------------------------------
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
|