File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Groovy and the fly likes Errors saving data from a checkbox. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Errors saving data from a checkbox." Watch "Errors saving data from a checkbox." New topic

Errors saving data from a checkbox.

Joe Nelson

Joined: Dec 11, 2008
Posts: 3
I'm having problems with updating from a list of checkboxes. The application displays a list of data in which one of the columns is a list of checkboxes used to update a flag in the table. The requirement is that the user can select all of the checkboxes displayed, deselect all of the checkboxes displayed, select individual boxes, or select all/select none and them go back and select/deselect specific ones; all followed by selecting update and saving the changes.

This application is working fine when the user selects all and updates, selects none and updates, or selects individual boxes and updates.

But when they try to do a select all or select none, then go back and select of deselect a one or more boxes and then select updates, the individual selections are lost and only the mass selection is saved.

I inherited this code and am new to Grails. I've spent two days debugging this and searching the web but still cannot see what is wrong. It just seems to ignore the individual changes once the mass selection is made and I can't see why.

Any help to explain what is going wrong would be greatly appreciated!

The code for generating the list with the checkboxes:

The code for the update, select all, and select none controls:

The related javascript functions:

The groovy controller method:

--<br /> <br />Joe nelson
I agree. Here's the link:
subject: Errors saving data from a checkbox.
It's not a secret anymore!