首先,对不起,我的英语不是我的原始语言。我有一个primefaces数据表和多选模式。
<h:form id="form">
<p:panel>
<p:tabView activeIndex="#{logoDocumentIntegration.tabIndex}" >
<p:tab title="Aktarilmayan Musteriler">
<p:dataTable id="notTransfaredClient" rows="10" value="#{logoDocumentIntegration.notTransfaredClientList}" selection="#{logoDocumentIntegration.selectedTransfaredClientList}" rowKey="#{cl.clientId}" var="cl" >
<p:column selectionMode="multiple" style="width:16px;text-align:center"/>
<p:column headerText="Id" style="width:2%" rendered="false">
<h:outputText value="#{cl.clientId}" />
</p:column>
<p:column headerText="TCNo" style="width:2%">
<h:outputText value="#{cl.taxNo}" />
</p:column>
<p:column headerText="İsim" style="width:2%">
<h:outputText value="#{cl.name}" />
</p:column>
<p:commandButton id="test" value="Ekle" actionListener="#{logoDocumentIntegration.transferClient(logoDocumentIntegration.selectedTransfaredClientList)}" />
我想从datatable获取选择行数。为此,我习惯了一个arraylist,其名称是selectedLis。在managedbean中,我有这一行:
private List<ClientView> selectedTransfaredClientList = new ArrayList<ClientView>();
public List<ClientView> getSelectedTransfaredClientList() {
return selectedTransfaredClientList;
}
public void setSelectedTransfaredClientList(List<ClientView> selectedTransfaredClientList) {
this.selectedTransfaredClientList = selectedTransfaredClientList;
}
一切都还可以,但是当我想获得selectedTransferedClientList计数正在返回0.我的错误在哪里,非常感谢你的回复。