gpt4 book ai didi

jsf-2 - primefaces p :ajax update not working

转载 作者:行者123 更新时间:2023-12-02 05:04:16 24 4
gpt4 key购买 nike

我正在使用 primefaces 3.4.2 数据表进行单元内编辑。我想在调用编辑事件方法后,更新数据表本身。我是这样做的:

<p:dataTable id="timeTable" var="log" value="#{reviewTimesheetBean.lazyModel}" paginator="true"
paginatorTemplate="{FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="15,30,45,60"
paginatorPosition="bottom" rows="2" currentPageReportTemplate="{currentPage} de {totalPages}" lazy="true" editable="true" emptyMessage="#{label['empty.message']}">

<p:ajax event="rowEdit" listener="#{reviewTimesheetBean.onEdit}" update="timeTable" />
<p:ajax event="rowEditCancel" listener="#{reviewTimesheetBean.onCancel}" update="timeTable" />
....
</p:datatable>

但是在 rowEdit 事件之后永远不会调用 load 方法。我也尝试过使用选择器,但它也没有用。数据表不能这样更新吗?

谢谢

凯利

最佳答案

你试过remoteCommand吗?

<p:remoteCommand name="onCellEdit" action="#{bean.init}" update="formId" ignoreAutoUpdate="true" />

然后在你的数据表中:

<p:ajax event="cellEdit" oncomplete="onCellEdit()" listener="#{bean.onCellEdit}" />

附言。 remoteCommand 就在数据表之上……不确定这是否有任何影响。

注意 onComplete 值必须与远程命令的名称匹配。

关于jsf-2 - primefaces p :ajax update not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13454272/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com