我有一个带有LazyDataModel的数据表,可以正常工作。但是我把按钮放在一个列中,它们不会触发。 如果我删除延迟模式这些按钮工作正常。 事实是我尝试了一切,只是删除懒惰模式。
<p:dataTable
id="basicDT"
var="user"
lazy="true"
value="#{userMB.userLazyDataModel}"
selectionMode="single"
rowKey="#{user.id}"
selection="#{userMB.selectedUser}"
rows="10"
paginatorPosition="bottom"
paginator="true"
paginatorAlwaysVisible="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
currentPageReportTemplate="{currentPage}:{totalPages} / ({totalRecords})"
>
<f:facet name="header">#{msgs['userList.title']}</f:facet>
<p:ajax event="rowDblselect" listener="#{userMB.onRowSelect}" />
<p:column selectionMode="multiple" style="width:36px;text-align:center"/>
<p:column width="35">
<c:choose>
<c:when test="${user.isAccountLocked()}}">
<span class="fa fa-fw fa-lock" ></span>
</c:when>
<c:otherwise>
<span class="fa fa-fw fa-unlock" ></span>
</c:otherwise>
</c:choose>
</p:column>
<p:column style="width:50px">
<h:outputText value="#{user.id}" />
</p:column>
<p:column>
<f:facet name="header">#{msgs['user.document']}</f:facet>
<h:outputText value="#{user.document}" />
</p:column>
<p:column>
<f:facet name="header">#{msgs['user.username']}</f:facet>
<h:outputText value="#{user.username}" />
</p:column>
<p:column>
<f:facet name="header">#{msgs['user.firstName']}</f:facet>
<h:outputText value="#{user.firstName}" />
</p:column>
<p:column>
<f:facet name="header">#{msgs['user.lastName']}</f:facet>
<h:outputText value="#{user.lastName}" />
</p:column>
<p:column>
<f:facet name="header">#{msgs['user.email']}</f:facet>
<h:outputText value="#{user.email}" />
</p:column>
<p:column >
<f:facet name="header">#{msgs['user.phoneNumber']}</f:facet>
<h:outputText value="#{user.phoneNumber}" />
</p:column>
<p:column style="text-align: center" width="140" >
<h:commandButton value="submit" action="#{userMB.test}" update="@all">
<f:setPropertyActionListener value="#{user}" target="#{userMB.selectedUser}" />
</h:commandButton>
</p:column>
</p:dataTable>