I put out another similar post, but let me ask this question another way in
hopes of generating more feedback.

I have an application with many forms that contain dynamic lists of
elements. For example, rows of elements that contain a checkbox, select
list, and 2 text boxes for each element.

In traditional JSP design, normally I would create a loop and name these
elements "rowbox1", "rowselect1", "rowtext1", "rowtext21", ...
"rowbox(n)"...etc. At any rate, you get the idea; we've all done this.

With struts, you have the mapped and indexed property syntax that works
great for pre-populated forms. For example, I can have an "open" action that
pre-populates an ActionForm with all the nested data and forward to a JSP
that allows editing. Everything looks great.

The PROBLEM is submitting this form. I haven't found a way to make Struts
auto-allocate space in a collection (or a Map, for that matter) in an
ActionForm for the submit action. Almost every example on this I've seen
deals with a fixed number of elements, and most of these still focus on the
pre-populate action. These examples completely avoid this issue.

So, when the number of elements on the form VARIES, what is the "best
practice" in design for this? I'm talking about an indexed or mapped
collection that contains other Java Beans. How can you get these to submit
properly into an ActionForm? If there are options, can you weigh the
pros/cons of each?

For example, I'm sure a session-scope bean would accomplish this, but I stay
away from session-scope beans because of clustered deployment issues. I
would imagine a hidden value giving the length might be useful, but I'm not
sure where in the ActionForm's initialization sequence it could be used.
Perhaps I need to do something different in the reset() method? Are there
other options?

Nate


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to