• 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

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
 
Every time you till, you lose 30% of your organic matter. But this tiny ad is durable:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic