• 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Dynamic radio button problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I generate dynamic single radio button in <s:iterator> . how will i know which radio button was clicked....code is given below



Now i want to know which radio button was clicked.....because this one only gives me one value...
 
Ranch Hand
Posts: 213
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not clear by your code what you are trying to accomplish.

The way you would do a radio button from a list is like this.:

In my action form I have:



In my jsp I have:



The returned value is contained in searchSpecResult so searchSpecResult would return One, Two, or Three depending on what was selected. That is how you know what button is pressed

In your code it looks like you are trying to do a group of radio buttons in every loop in your iterator. If that is what you are trying to do then you will need to have the value in the name attribute be a unique field name for each group of buttons.
So if addpayer is a collection for the returned value, you should set the radio button like this:
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

parsinglord jain wrote:Hi,

I generate dynamic single radio button in <s:iterator> . how will i know which radio button was clicked....code is given below



Now i want to know which radio button was clicked.....because this one only gives me one value...



Hi ,
I have similary type issue . I want to generate two radio button ( YES /NO) inside one iterator.
And depending upon some condition i have to check one .. COuld you please help me in this
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic