Jsf 获取datatable myfaces 2.1中的行的值

Jsf 获取datatable myfaces 2.1中的行的值,jsf,jsf-1.2,Jsf,Jsf 1.2,myfaces 1.2我在myfaces2.1中有一个datatable,并且现在针对datatable的每一行显示一个复选框。如果我针对要在托管bean中获取行数据的行选择一个或多个复选框,并希望将这些特定值传递到另一个屏幕,有人能帮助我获取传递到的特定选中行值吗托管豆 <h:column> <h:selectBooleanCheckbox value="#{myResourcesDetails.ch

myfaces 1.2我在myfaces2.1中有一个datatable,并且现在针对datatable的每一行显示一个复选框。如果我针对要在托管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">
                        &nbsp;&nbsp;&nbsp;
                        <h:outputText id="tblHdr1" value="Resource Name" style="font-family: arial; font-size: 12px; color: blue"/>
                    </f:facet> 
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <h:outputText value="#{resList.resName}" style="font-family: verdana; font-size: 12px; color: olive"/>
                </h:column>



                <h:column>
                    <f:facet name="header">
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <h:outputText id="tblHdr3" value="Project Name" style="font-family: arial; font-size: 12px; color: blue"/>
                    </f:facet>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <h:outputText value="#{resList.projName}" style="font-family: verdana; font-size: 12px; color: olive"/>
                </h:column>

                <h:column>
                    <f:facet name="header">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <h:outputText id="tblHdr4" value="Manager Id" style="font-family: arial; font-size: 12px; color: blue"/>
                    </f:facet>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <h:outputText value="#{resList.manager}" style="font-family: verdana; font-size: 12px; color: olive"/>
                </h:column>

                 </h:dataTable>
将chkBxVal字段添加到resList中的对象

试一试

改变

<h:selectBooleanCheckbox   value="#{myResourcesDetails.chkBxVal}" 
   binding="#{myResourcesDetails.selectedValue(actionEvent)}"/>
进入

而不是在列表中的值上向服务器循环提交数据,并查看列表中每个对象中的chkBxVal值…

ypu可以发布标题吗?
<h:selectBooleanCheckbox value="#{resList.chkBxVal}"/>