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

Radio buttons for each row in s iterator tags

 
Ranch Hand
Posts: 367
Eclipse IDE Opera Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm using s:iterator and need to put radio button on every row/record returned
This is my code :


The problem with the above code is that it displays accountNo e.g. 123, 456 etc. next to it's radio button. I need to remove it.
Please advise.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you set the label parameter to ""?
 
Ranch Hand
Posts: 33
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

pramod talekar wrote:Hi,

I'm using s:iterator and need to put radio button on every row/record returned
This is my code :


The problem with the above code is that it displays accountNo e.g. 123, 456 etc. next to it's radio button. I need to remove it.
Please advise.





Replace your radio button line with

<td><s:radio name="selectedId" list="#{'accountNo':''}" theme="simple"></s:radio></td>
 
pramod talekar
Ranch Hand
Posts: 367
Eclipse IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Shashank. It's working fine now.

Setting label didn't work Joe. Thanks for the response.
 
Greenhorn
Posts: 17
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Shashank Gollapudi wrote:
Replace your radio button line with

<td><s:radio name="selectedId" list="#{'accountNo':''}" theme="simple"></s:radio></td>


Doing so is displaying the radio button as desired.
But when i am selecting the radio button and sending request no value with radio button is sending.
How to do it.?
 
Ranch Hand
Posts: 40
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gaurav Manral wrote:

Shashank Gollapudi wrote:
Replace your radio button line with

<td><s:radio name="selectedId" list="#{'accountNo':''}" theme="simple"></s:radio></td>


Doing so is displaying the radio button as desired.
But when i am selecting the radio button and sending request no value with radio button is sending.
How to do it.?



Well this was left unanswered since a long time and somehow I managed to stumble upon the same problem in one of my projects so felt like sharing out the solution with community. The way to do it is that you have to use an iterator like the one shown in the snippet below....



what essentially is happening is that your passing your list to the iterator and using the `top` keyword in the radio itself to extract the topmost element from the list and render it out as the part of the value attribute for the radio button.

Hope it helps.

Cheers!!
 
I'm so happy! And I wish to make this tiny ad happy too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic