A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Struts2: Can my action class pick up falses in a collection of checkboxs
Joined: Apr 24, 2001
Jan 12, 2009 02:33:26
I have a colleciton of objects displayed in a table using an iterator, on the end of each row I have a checkbox where you can select each row
<s:iterator ..... id="row" >
... <s: name="selected" value="row.id" >
I happiily pick up the trues in my action class with this attribute and associated getters and setters..
private Long selected ;
The array holds as many trues as selected but really I would like it to hold as many as there are checkboxes displayed and the falses are somehow tagged as such.
Can this be done? The alternative is hidden form attributes which could possibly be insecure.
Thanks in advance.
Joined: Sep 29, 2008
Jan 26, 2009 07:21:19
The <s:checkbox...> tag creates a hidden field for un-checked checkboxes already.
It is sorta covered in the
JavaRanch Style Guide
subject: Struts2: Can my action class pick up falses in a collection of checkboxs
set value of a property as another property
Struts2 Checkbox: How to set value back to Bean
Struts2 - <s:iterator> in two-Dimensional Array.
dynamic checkboxes in struts 2
How to reterive table row value (JSP )from the action class
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014