Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Radio Options in JSP are not Populating Correctly

 
Steve Dyke
Ranch Hand
Posts: 1679
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I display this page only the last row/last option has the radio button checked.

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I follow the logic correctly, then there should ever only be a single radio button that's checked. (Of course, since all radio buttons have the same name, only a single one *can* ever be checked.)
Are you saying that more than one should be checked? If so, please post the HTML that gets generated, and indicate what you think is wrong about it.
 
Steve Dyke
Ranch Hand
Posts: 1679
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:If I follow the logic correctly, then there should ever only be a single radio button that's checked. (Of course, since all radio buttons have the same name, only a single one *can* ever be checked.)
Are you saying that more than one should be checked? If so, please post the HTML that gets generated, and indicate what you think is wrong about it.


I see what you mean about the radio buttons of every row having the same name.

How can I make the name of each group(3) of radio buttons in each row have unique names using the status.count property? How do I concatenate this with the radio button name property?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try something like: name="statusoptions${status.count}"
 
Steve Dyke
Ranch Hand
Posts: 1679
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Try something like: name="statusoptions${status.count}"


Thanks for the help.

I have used c:set to set the dynamic names.

My next quest is the best way to push this page data back to the servlet so it can be saved in my remote data file.

I would like to do this without the page having to be reloaded since the page offers several categories of items. Each time the category changes or the page is closed I need to save the current page content to data source.

I don't really know how this will work since it is a div in my main layout form.

Would I do this with jquery and iterate the form on my servlet?

I could use some help with this.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, an AJAX library like jQuery or Prototype could help with that. That's a different topic, though, and anyway more of an HTML/JavaScript question, so please start a new topic over in that forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic