Jsf 2 Primefaces数据表分页在更新后不起作用
我正在设计一个应用程序,其中某些输入提要是通过primefaces数据表输入的 版本规格: PrimeFaces-4.0 JSF-2.1.6 面临的问题: 更新数据表后分页中断。看起来在datatable中触发更新事件之前,分页工作非常正常。映射到此数据表的列表位于“查看范围”下 请在下面的datatable中找到我的XHTML代码Jsf 2 Primefaces数据表分页在更新后不起作用,jsf-2,primefaces,Jsf 2,Primefaces,我正在设计一个应用程序,其中某些输入提要是通过primefaces数据表输入的 版本规格: PrimeFaces-4.0 JSF-2.1.6 面临的问题: 更新数据表后分页中断。看起来在datatable中触发更新事件之前,分页工作非常正常。映射到此数据表的列表位于“查看范围”下 请在下面的datatable中找到我的XHTML代码 <p:dataTable var="profile" value="#{manualNBean.manualNlist}"
<p:dataTable var="profile" value="#{manualNBean.manualNlist}"
rows="10" paginator="true" paginatorPosition="bottom"
rowIndexVar="rowIndex" lazy="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="10,50,100,200" id="statustab">
<p:column headerText="S.No">
<p:outputLabel value="#{rowIndex+1}" />
</p:column>
<p:column headerText="Profile ID">
<p:outputLabel value="#{profile.profileID}" />
</p:column>
<p:column headerText="Law Firm Name">
<p:outputLabel value="#{profile.lawFirmName}" />
</p:column>
<p:column headerText="First Name">
<p:outputLabel value="#{profile.firstName}" />
</p:column>
<p:column headerText="Second Name">
<p:outputLabel value="#{profile.secondName}" />
</p:column>
<p:column headerText="Full Name">
<p:outputLabel value="#{profile.fullName}" />
</p:column>
<p:column headerText="Profile Link">
<h:outputLink value="#{profile.profileLink}" target="_blank">#{profile.profileLink}</h:outputLink>
</p:column>
<p:column headerText="PPTS N" id="editNCol">
<p:commandButton icon="ui-icon-pencil" process="@this"
update="statustab" rendered="#{profile.editbuttonRender}"
action="#{manualNBean.turnoffRender}">
<f:setPropertyActionListener value="#{profile}"
target="#{manualNBean.manualNDTO}" />
</p:commandButton>
<p:autoComplete id="manualN" minQueryLength="3"
value="#{profile.manualN}"
style="#{profile.autocompletebuttonRender}"
completeMethod="#{manualNBean.autocompleteN}">
</p:autoComplete>
</p:column>
</p:dataTable>
#{profile.profileLink}
这里,更新操作在命令按钮中执行。即使在执行了更新操作之后,惰性模型似乎仍然充满了来自数据库的记录,但我想知道为什么分页会中断
注意:通过向按钮添加ajax=“false”属性,页面重新加载,现在分页似乎工作正常。然而,这是不可行的,我们期待着用Ajax来控制它
只需添加另一个注释,此datatable仅在单击按钮后从数据库填充信息
有人能告诉我哪里出错了吗?我不使用
p:commandButton
上的update
属性,而是更新action方法中的一行。现在分页似乎没有中断。然后有两种选择,我使用了第一种
- 为此,请使用OmniFaces AJAX实用程序
在
属性p:commandButton
中使用的解决方案如下:操作
public void updateRow(UIData表){ int index=table.getRowIndex(); updateRow(表,索引); }
- 使用普通PrimeFaces解决方案以搜索表达式框架的形式
及
服务器端方法如下所示:
public void updateRow(UIData表){ int index=table.getRowIndex(); update(table.getClientId()+“:@row(“+index+”); }
p:commandButton
上使用update
属性,而是更新了action方法中的一行。现在分页似乎没有中断。然后有两种选择,我使用了第一种
- 为此,请使用OmniFaces AJAX实用程序
在
属性p:commandButton
中使用的解决方案如下:操作
public void updateRow(UIData表){ int index=table.getRowIndex(); updateRow(表,索引); }
- 使用普通PrimeFaces解决方案以搜索表达式框架的形式
及
服务器端方法如下所示:
public void updateRow(UIData表){ int index=table.getRowIndex(); update(table.getClientId()+“:@row(“+index+”); }