This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Spring and the fly likes List Binding -- form:checkboxes Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Spring
Reply Bookmark "List Binding -- form:checkboxes" Watch "List Binding -- form:checkboxes" New topic
Author

List Binding -- form:checkboxes

Dave Okey
Greenhorn

Joined: May 16, 2011
Posts: 3
Hi all. Thanks in advance for any help..this really has me stumped.

I have the following object association in my model:


Controller:


My PropertyEditor:


My JSP form:


The form renders correctly. That is, the checkbox list of Contracts is generated and the correct ones are "checked." The problem is when I submit I get:


The custom property editor seems to be doing its job and there are no null/empty strings being passed to my property editor.

If the form and controller makes the conversion when viewing the form, why is it having trouble when processing the form? What am I missing here?

Thanks!
Dave Okey
Greenhorn

Joined: May 16, 2011
Posts: 3
I guess a fresh set of eyes first thing in the morning does the trick again.

My custom property editor had no clue what to do with the id value I was passing in since it couldn't access my DAO/service. So, I had to change the constructor:


Then, modified the initBinder in my controller:


Maybe this will help someone else.
 
I agree. Here's the link: http://jrebel.com/download
 
subject: List Binding -- form:checkboxes
 
Similar Threads
Bean cant be created error
Help needed with Spring binding and <form:select>
@SessionAttributes with a Validator set up using @InitBinder
Validation is not working in Annotaion based controller
on submit, model object returning null