aspose file tools*
The moose likes JSP and the fly likes Radio Options in JSP are not Populating Correctly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Radio Options in JSP are not Populating Correctly" Watch "Radio Options in JSP are not Populating Correctly" New topic
Author

Radio Options in JSP are not Populating Correctly

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1466
    
    1
When I display this page only the last row/last option has the radio button checked.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42291
    
  64
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.


Ping & DNS - my free Android networking tools app
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1466
    
    1
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
Marshal

Joined: Mar 22, 2005
Posts: 42291
    
  64
Try something like: name="statusoptions${status.count}"
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1466
    
    1
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
Marshal

Joined: Mar 22, 2005
Posts: 42291
    
  64
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.
 
wood burning stoves
 
subject: Radio Options in JSP are not Populating Correctly