myfaces 1.2 I have a datatable in myfaces2.1 and displaying a check box against each row of the datatable now if I select a (or multiple) checkbox(es) against the rows I want to get the row data in managed bean and want to pass those particular values into a different screen can anyone help me in getting the particular checked row values passing to managed bean..?
<h:column>
<h:selectBooleanCheckbox value="#{myResourcesDetails.chkBxVal}" binding="#{myResourcesDetails.selectedValue(actionEvent)}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText id="tblHdr0" value="Employee Id" style="font-family: arial; font-size: 12px; color: blue"/>
</f:facet>
<h:commandLink id="emNo" value="#{resList.empNo}" onclick="fn_openResDetails(#{resList.empNo});" style="font-family: verdana; font-size: 12px; color: olive"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText id="tblHdr1" value="Resource Name" style="font-family: arial; font-size: 12px; color: blue"/>
</f:facet>
<h:outputText value="#{resList.resName}" style="font-family: verdana; font-size: 12px; color: olive"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText id="tblHdr3" value="Project Name" style="font-family: arial; font-size: 12px; color: blue"/>
</f:facet>
<h:outputText value="#{resList.projName}" style="font-family: verdana; font-size: 12px; color: olive"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText id="tblHdr4" value="Manager Id" style="font-family: arial; font-size: 12px; color: blue"/>
</f:facet>
<h:outputText value="#{resList.manager}" style="font-family: verdana; font-size: 12px; color: olive"/>
</h:column>
</h:dataTable>
Add
chkBxValfield to your Object that insideresListTry
and change
into
Than when submitting to data to the server loop over the values in your List and look at the
chkBxValvalue in each of your Objects in the list…