You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by zuban <al...@gmail.com> on 2007/05/11 21:35:37 UTC

java.util.List in FormBean

Hi,
in a FromBean I have a java.util.List (to populate a <html:optionsCollection
... />).
If I submit the form the List is set to null. For String datatypes I would
use hidden input fields to solve this. But what should I do by a List?
-- 
View this message in context: http://www.nabble.com/java.util.List-in-FormBean-tf3729222.html#a10438162
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: java.util.List in FormBean

Posted by Laurie Harper <la...@holoweb.net>.
zuban wrote:
> Hi,
> in a FromBean I have a java.util.List (to populate a <html:optionsCollection
> .... />).
> If I submit the form the List is set to null. For String datatypes I would
> use hidden input fields to solve this. But what should I do by a List?

You can either reload the list each time the action is invoked or, if 
you really want to manage this state client-side, you can serialize it 
to a set of N hidden fields, where N is the number of elements in the 
list. Alternatively, you could put the list into session scope the first 
time you load it and subsequently reference it from there.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org