|
From: Erwin V. <erw...@er...> - 2005-04-03 15:02:26
|
About FormAction: yes, but it uses "formObjectName" and "formObjectClass". Erwin Vervaet erw...@er... ----- Original Message ----- From: "Steven Devijver" <ste...@gm...> To: <spr...@li...> Sent: Sunday, April 03, 2005 12:43 PM Subject: Re: [Springframework-developer] webflow: FormAction question > Keith, > > Wow, this personal support thing you guys are doing is really cool :-) > > One more question, just for my understanding: > > The 'bindAndValidate' method on FormAction checks if an instance is > available under 'commandName' and if not creates an instance specified > by 'commandClass'. Is this correct. > > Thanks > > Steven > > > On Apr 3, 2005 8:20 AM, Keith Donald <ke...@in...> wrote: >> Steven, >> >> 1.) setupForm is called if and when you want it to be called - with >> Spring >> webflow, you define the workflow explicitly and what actions (or target >> methods) should be called on what events. That's the inherent power in >> web >> flows---the action methods don't contain any workflow, they just execute >> some logic-- the flow itself fully defines the workflow, dynamically. >> >> Checkout the new 'sellitem' sample in samples/webflow in CVS to see how >> it >> calls 'setupForm' at the beginning of the wizard flow. >> >> 2.) You could always do custom validation logic for each page in the >> action >> that processes each submit, in a custom method that you define, like >> "public >> bindAndValidateShippingDetails(RequestContext context)". However, I am >> thinking it makes sense to have the FormAction aware of a action property >> called 'validatorMethod' that will be invoked by ValidatorUtils, to allow >> piecemeal validation of the domain object on a per page basis (instead of >> always calling the 'validate' method, which validates the whole object). >> Either that or perhaps we need a WizardFormAction that provides specific >> support for this. Thoughts? >> >> Keith >> >> -----Original Message----- >> From: spr...@li... >> [mailto:spr...@li...] On Behalf >> Of >> Steven Devijver >> Sent: Saturday, April 02, 2005 4:41 PM >> To: spr...@li... >> Subject: Re: [Springframework-developer] webflow: FormAction question >> >> Keith, >> >> Thanks for the feedback an my apologies for not posting on the user >> list. There's two things that aren't clear to me: >> >> 1) is setupForm on FormAction called only once and if so where and why >> only there? >> >> 2) how can I validate every page/form separately saying this or that >> is missing? Every form submit uses the same validator, how can it >> validate only the properties related to the form? >> >> Thanks >> >> Steven >> >> On Apr 2, 2005 8:11 PM, Keith Donald <ke...@in...> wrote: >> > 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 >> > >> > >> >> -- >> "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 >> >> > > > -- > "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 > |