aspose file tools*
The moose likes JSF and the fly likes problem h:selectOneRadio Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "problem h:selectOneRadio" Watch "problem h:selectOneRadio" New topic
Author

problem h:selectOneRadio

rosaria italia
Greenhorn

Joined: May 15, 2006
Posts: 28
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

Joined: Aug 15, 2004
Posts: 2874
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

Joined: May 15, 2006
Posts: 28
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

Joined: Jul 06, 2005
Posts: 1018
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

Joined: Aug 15, 2004
Posts: 2874
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

Joined: May 15, 2006
Posts: 28
Thanks! I will look at!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem h:selectOneRadio