Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Associating controls in a row with a radio button

 
Markus Neumaier
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

im Iterating over a XML-File and fill out a Table.

Key Value is always a ID wich i bind to a radio button. In the last column i create an identical dropdown menu for each row. But only the Value in the first dropdownvalue is used. Is there a way to creat a dependency between the radio Button / row and the used Dropdown menu.
I hope the Picture explains what im trying to do.

Thank you

Markus
DropDown.png
[Thumbnail for DropDown.png]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the easiest approaches would be to make sure that all dropdowns except for the one in the same row as the checked radio button are disabled. Disabled controls do not participate in the submission, so only the enabled dropdown would submit its value.

This, of course, would require JavaScript to change the enabled state of the dropdowns as the radio buttons are checked.
 
Markus Neumaier
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought that I had to use JavaScript. Maybe I can change the structure of the whole site.

Thank you for the quick response :)

Markus
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you don't have to. But it's likely this easiest approach. You could also do some complicated naming and parsing on the server, but that's so 2003.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic