Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem h:selectOneRadio

 
rosaria italia
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hallo, I have a problem with <h:selectOneRadio and <h ataTable.
When I use <h ataTable and selelectOne radio I can select all radio presents in my form, but I must to select one only button.
Following is my code
<h ataTable id="order" var="order" value="#{orderBean.orders}">
<h:column><h utputText value=" Name:" styleClass="normal"/></h:column>
<h:column><h:selectOneRadio id="id" styleClass="normal" >
<f:selectItem itemValue="#{order.id}" itemLabel="Seleziona"/></h:selectOneRadio>
</h:column></h ataTable>

I hope in your help! Bye
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But here you are posting only one selectOneRadio. Where are others?
The problem might occuring because of different clientIds.
[ May 15, 2006: Message edited by: Adeel Ansari ]
 
rosaria italia
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, but dataTable loop over a list of data and each radio button is on each row. How can I allow to select only one radiobutton and not all radiobutton?
 
Stefan Evans
Bartender
Posts: 1780
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, its a problem.
In fact there has been an entire article devoted to this issue:
Adding row selection to a JSF datatable using radio buttons

Couple of other links (from that article)
http://forum.java.sun.com/thread.jspa?forumID=427&threadID=526803
http://forum.java.sun.com/thread.jspa?forumID=427&threadID=548253

Cheers,
evnafets
[ May 15, 2006: Message edited by: Stefan Evans ]
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rosaria di trapano:
Hi, but dataTable loop over a list of data and each radio button is on each row.


Yes very right, but the thing is new row means new clientId. You can see the HTML from the browser.
 
rosaria italia
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! I will look at!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic