Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with iterator for checkboxes. How to set value to bean property?

 
Michael Freake
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to display a list of checkboxes that will represent a list of clients. Each of my checkboxes has a name="id". They also have a value="on". I'd like the value to be the actual user IDs instead of "on". (ie. user.getId()) My desired HTML output is below. I could then just iterate over the values picking up and processing the client IDs:



My problem is how do I get the client IDs in the value field? Here is my current output below along with the code I'm using to generate it:



Current Code:


And here is my ActionForm incase it is needed:



Thanks for any help. I'm starting to think maybe I'm approaching this the wrong way...
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use EL and put ${client.id} in the value attribute?
 
Michael Freake
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,

Thanks for the suggest, but I ended up using a different approach. Updated my UploadForm with get and set methods that used a String array of Client names (not quite as useful as ids), and used a html:multibox to display correctly.

It works fine for my small app.

Thanks again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic