• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Radio Options in JSP are not Populating Correctly

 
Ranch Hand
Posts: 2283
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I display this page only the last row/last option has the radio button checked.

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2283
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try something like: name="statusoptions${status.count}"
 
Steve Dyke
Ranch Hand
Posts: 2283
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic