• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2: Can my action class pick up falses in a collection of checkboxs

 
David Rocks
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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" >
...
<s:iterator>

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.


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The <s:checkbox...> tag creates a hidden field for un-checked checkboxes already.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic