You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shanna7463 <sh...@yahoo.com> on 2008/02/06 20:35:17 UTC

html:hidden as a collection not String

Is it possible to assign a collection to a html:hidden component, rather than
a string?  
Basically my webapp allows the user to select different options for access
control.  I would like to add these selections to a collection and pass that
to my Action class. 

Thanks inadvance!!

-- Shanna --
-- 
View this message in context: http://www.nabble.com/html%3Ahidden-as-a-collection-not-String-tp15312178p15312178.html
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: html:hidden as a collection not String

Posted by Laurie Harper <la...@holoweb.net>.
Shanna7463 wrote:
> Is it possible to assign a collection to a html:hidden component, rather than
> a string?  
> Basically my webapp allows the user to select different options for access
> control.  I would like to add these selections to a collection and pass that
> to my Action class. 

A hidden input will submit a single string value. To submit a set of 
values you either need to use multiple hidden inputs (i.e. one per 
collection entry) or manually marshal the collection into a single 
string (e.g. a comma separated list of values) the unmarshal it again 
when it's submitted. Multiple hidden inputs is probably the 
easier/cleaner approach.

L.


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