Chris Montgomery wrote:I've struggled with these as well. unchecked boxes basically don't exist.
To be honest, I avoid the struts implementation of checkboxes if I need to get 'fancy'.
An alternative is to create your own checkboxes ( this can be done dynamically ) and assign meaningful id's to each of the checkboxs. From there, you can leverage jQuery's select event along with AJAX to deal with the user selection realtime. No form submit necessary...
This exact solution may not be relevant, but hopefully provides you some alternative perspectives on solving your issue.
Thanks for the reply Chris. It's sad that this simple problem has not been addressed properly yet. This is how I did it:
1. Have hidden fields in the form
2. Action class will receive values of these hidden fields and update a set to correctly reflect which checkboxes have been updated. For example, if hidden fields 1, 2, and 3 are submitted, then all these entries will be removed from the set. The set is again updated with values of checked checkboxes.
This works correctly with pagination.
I am unhappy with this solution as it is adding the overhead of iterating through all the values again and again. I have to be happy with it because it solves my problem.
If anyone has a better solution please share it here.