1

myfaces 1.2 我在 myfaces2.1 中有一个数据表,如果我针对要在托管 bean 中获取行数据并想要将这些特定值传递到不同的屏幕上,谁能帮助我将特定检查的行值传递给托管 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>
4

1 回答 1

0

chkBxVal字段添加到您的对象中resList

尝试

和改变

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

进入

<h:selectBooleanCheckbox value="#{resList.chkBxVal}"/>

比向服务器提交数据时循环遍历列表中的值并查看列表chkBxVal中每个对象中的值...

于 2012-12-06T20:00:05.343 回答