Leo Asanov wrote:
Is there any standard ways to manage multiple instances of one form with Struts? I have application which is supposed to take theorerically unlimited number of person's descriptions. Every time user clicks "add one more person" he/she gets exactly the same form (with the same validation rules) to fill. At the end user clicks "finish" and all data is saved. I'm sure this is quite common task. So far I can't see any mechanism in Struts supporting multiple instances. And if I manage instances manually in Action class I loose some built-in functionality, like forms prepopulation. Any hints/ideas?
Do you mean multiple instances of the same form on the same page? If so you can use a single form with all the people's details. If you use nested properties in your form bean you can easily keep each person's data separated out.
If you just want to have your 'add one more person' button display a page with a form to enter that person's details (i.e. multiple instances of the same form being used one per request) you don't need to do anything special besides make sure your form bean implements reset() appropriately.
L. -- Laurie, Open Source advocate, Java geek and novice blogger: http://www.holoweb.net/laurie --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]