Posted By:
Gez_Hall
Posted On:
Wednesday, January 22, 2003 11:05 AM
Ok, I'm a struts newbie, so this may be a simple one or it may not...we shall see. I have my jsp page, with a couple of simple form elements (text:html). When submitted, the associated Action class creates an object of which the form values become attributes. The object is added to a Vector. The original page is then displayed. So, everytime the user enters some info and submits, one more object is added. In addition, once these objects are created, the attributes of them are displayed in the page as a list. So, say I was creating books, there would be a list of three (say) books, and a textfield at the bottom to create a new title. What I want to do, is make the list elements part of the form, by enclosing them
More>>
Ok, I'm a struts newbie, so this may be a simple one or it may not...we shall see.
I have my jsp page, with a couple of simple form elements (text:html). When submitted, the associated Action class creates an object of which the form values become attributes. The object is added to a Vector. The original page is then displayed. So, everytime the user enters some info and submits, one more object is added.
In addition, once these objects are created, the attributes of them are displayed in the page as a list. So, say I was creating books, there would be a list of three (say) books, and a textfield at the bottom to create a new title.
What I want to do, is make the list elements part of the form, by enclosing them within an input type (text:html). But these are dynamic - my ActionForm class doesn't know if they exist, how many of them there will be etc, or what they will be called. The list is displayed in a (logic:iterate) tag, so I can't even give them different names (ie. (text:html property="aValue")) - they would all be called 'aValue'.
I hope this makes sense, and that someone out there knows how I can get around this, any help would be really appreciated.
Thanks.
<<Less