aspose file tools
The moose likes Struts and the fly likes how to define a list as a hidden variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to define a list as a hidden variable" Watch "how to define a list as a hidden variable" New topic
Author

how to define a list as a hidden variable

preethi ranga
Greenhorn

Joined: Feb 14, 2007
Posts: 6
Hi i want to know how do i define a hidden variable which has a list of values.
I know for a single value we can define it in this way.where i have a corresponding get/set methods in the formbean.



but say i have a get/set method in formbean which returns a list .how do i define that variable which returns a list as hidden variable.Your help is greatly appreciated.

Thanks
Madhavi
[ September 18, 2008: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62749
    
  68

Please be sure to ask questions that involve Struts tags in the Struts forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
In this situation I've alwas iterated over the list to create a list of hidden fields. Like this:



To do this in a single tag I would think would require you to make a getter that could turn all of the data in your list into a string and a setter that could convert all of the data from a string back into your list. If there is any easier cleaner way to do this I'm interested to know it as well.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to define a list as a hidden variable