|Re: Using same formData on multiple forms [message #991212 is a reply to message #991143]
||Mon, 17 December 2012 19:16
| Beat Schwarzentrub
Registered: November 2010
I think it depends:
- If you have three different and independent forms and you want that them to be stored only at the end of the wizard "in one go", then you would probably use 3 formDatas (one for each form). And the end of the wizard, you would fill each of them individually and then pass them to a store() method that takes three formDatas as an argument instead of just one:
public void storeWizard(WizardStep1FormData formData1, WizardStep2FormData formData2, WizardStep2FormData formData3) ...
- If you have a large form that should be edited in three steps by enabling (or showing) only parts in each step, then you would use the same instance of the form in each step. In the wizard's activate/deactivate methods, you can show or hide the desired fields. In each step, the form is filled more and more. At the end, all fields have a value and you can export the form to a single formData. (Invisible fields are exported as well.)
- If you have three separate forms that have the same value fields on them (but maybe a different layout), it should be possible to share the formDatas. Just let the @FormData annotation point to the same class. (Note: I have never done this and I would not recommend it, as the field structure and the field names _really_ must be identical.)
Does that information help you? If not, maybe you could tell us a little bit more about your intension.
Powered by FUDForum
. Page generated in 0.10808 seconds