Hello Rick,

Let me try to define a simular problem that I have that would most 
probably answer Stéphane's.
But only Stéphane can confirm this. :)

I have classes such as:

public class Description {

        private String id;
        private String Description;
...
}

public class HistoryItem {

        private boolean delete;
        private String startDate;
        private List descriptions;
        private String descriptionId;
...
}

public class HistoryForm extends ActionForm {

        private List historyItems;
...
}

I need to display the historyItems.
However, the user can via JavaScript add many more history items.
I must be able to capture all of the items from the JSP and save them to 
the DB.

Regards,
Glenn





Rick Reumann <[EMAIL PROTECTED]>
05/04/2005 10:09 AM
Please respond to "Struts Users Mailing List"




 
        To:     Struts Users Mailing List <user@struts.apache.org>
        cc:     (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

        Subject:        Re: How to submit a variable number of text fields 
?
 Classification: 
 


Jeff Beal wrote the following on 4/5/2005 9:51 AM:
>  I created a simple page like this where the dynamically
> created form properties were just named field0, field1, field2,
> field3, etc. 

I'll be willing to bet almost anything, that Stéphane does not need to 
do this.

Stéphane could you explain a bit more what you are attempting to capture 
from the user? There probably is a pretty a clean solution to what you 
are trying to do.

(More than likely a List in yoru form bean containing the objects you 
need is going to do the trick, but there will be some things to consider 
if you need to dynamically create form fields.. but I want to make sure 
that is what you really need to do. Some people think they need to make 
extra form fields because they aren't really aware of how a List of 
objects can submit just fine.)

-- 
Rick

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



Reply via email to