我有Prime faces Check box Data Table
和Data Grid.
<p:dataTable id="****" }"
row="12"
selection="#{****.selected}">
<p:column headerText="name" style="width:25p">
#{****.xx}
</p:column>
<p:column headerText="name" style="width:25p">
#{****.xxx}
</p:column>
</p:dataTable>
我从某些表中选择了一些行,但我的选择数组为空! 为什么?如何绑定我的选择数组?
答案 0 :(得分:0)
尝试使用以下结构跟随数据表的结构,并选中复选框。
<p:dataTable id="****" var ="yourVar" value = "#{Bean.PojoFileName}"
row="12"
selection="#{Bean.selectedValue}">
//selectedValue should be of type private PojoFileName[] selectedValue;
<p:column headerText="name" style="width:25p">
#{yourVar.xx}
</p:column>
<p:column headerText="name" style="width:25p">
#{yourVar.xxx}
</p:column>
</p:dataTable>