Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RADIO BUTTON WITH ROW IN DATA TABLE

 
Ananth Majumdar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to implement a datatable with a radio button for each row so as to select the row?

Is there other way like for a selectItems only can we have multiple columns can we have a datatable in selectItems?
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see http://www.coderanch.com/t/212176/JSF/java/selectManyCheckbox
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see http://www.jroller.com/page/cenkcivici?entry=jsf_datatable_single_row_selection
 
Ananth Majumdar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks dawson
 
Viswanath Sriram
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can have a radio button for wach row like this


<h:dataTable value="#{beanname.methodname}" var="xxx">

<h:column>
<h:selectOneRadio>
<f:selectItem itemValue="#{xxx.propertname}" itemLabel="{#xxx.propertname}"/>
</h:selectOneRadio>
</h:column>

<h:column>
// other controls
</h:column>
<h:column>
// other controls
</h:column>
<h:column>
// other controls
</h:column>

</h:dataTable>
 
Ananth Majumdar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am required to edit the entry selected with the radio button. As the radio button is associated with only the first column I can only display that value in the next page but for editing I should get all the items in the row.. I have heard that there is a component called SelectOneRow which has this functionality .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic