Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSF Radio buttons + Datatable

843844Jul 17 2009 — edited Jan 5 2010
Hi all,

I am new to JSF. I am working on an application wherin there is a page which contains a table populated using a <h:datatable> tag after the fields are fetched from the Oracle database. The code for which is as follows.

JSF code :

<h:panelGrid border="0" columns="5">
<h:dataTable value="#{adcreatebean.display}" var="display" >

<h:column>
<h:selectOneRadio onclick=" "
valueChangeListener="#{bean.setSelected}">
<f:selectItem itemValue="null" />
</h:selectOneRadio>
</h:column>

<h:column>
<h:outputText value="#{display.s1}"/>
</h:column>
<h:column>
<h:outputText value="#{display.s2}"/>
</h:column>
<h:column>
<h:outputText value="#{display.vs3}"/>
</h:column>
<h:column>
<h:outputText value="#{display.s4}"/>
</h:column>
</h:dataTable>
</h:panelGrid >

backing bean code:

public Result getDisplay() throws SQLException, NamingException {

ResultSet result = statement.executeQuery("select * from s_details");
return ResultSupport.toResult(result);
}


I tried to write the Code for radio button but was unable to succed in that. Can anyone please help with with the code or guide me to write a better one. I am working with oracle Database and this datatable in JSF contains a radio button tag on each row which is supposed to retrieve the corresponding row when selected.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 2 2010
Added on Jul 17 2009
2 comments
669 views