I hope someone can help me out with data binding to a checkbox. I am showing a list of "Persons" with 5 attributes each (such as name, role, Phone, email, dateJoined), each having a checkbox beside it. User can select 1 person and submit the form for processing.
I am currently binding the PersonId to the checkbox as below:
This works fine and I am able to see the personId in the Controller depending on what the user ticks. My challenge is that I would like to bind personId and role attribute to the checkbox. Does anyone know what the syntax is for the above <spring:bind > tags when binding the same checkbox to another attribute which is also present in the jsp?
I have added in my Command bean the instance variables personId and role, and also have getters/setters for them. I just don't know how the jsp can pass the second attribute depending on the checkbox that is ticked. I did try some variations of this syntax to try and bind the checkbox to role also, but have been unsuccessful so far.
Any help will be greatly appreciated!
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!