[英]PrimeFaces orderList not updated with changed order
The order change in orderList has no effect on the list variable. orderList 中的顺序更改对 list 变量没有影响。 I tried primefaces orderlist not getting updated with the changed order and Primefaces: How to persist reordered data from ap:orderList?
我尝试过primefaces orderlist没有随着更改的顺序和Primefaces:How to persist reordered data from ap:orderList而更新? and checked multiple other question, however none worked for me.
并检查了多个其他问题,但没有一个对我有用。 I added process and update the orderList in the submitting command button, I added ajax processing to the command button, immediate to orderList, still nothing.
我在提交命令按钮中添加了处理并更新了orderList,我在命令按钮中添加了ajax处理,立即到orderList,仍然没有。
<p:dialog id="editDialog" widgetVar="editDialog" header="Editace dokumentu" modal="true" showEffect="fade" width="90%" height="80vh" resizable="true" closable="true" closeOnEscape="true">
<p:outputPanel id="container" widgetVar="container" style="width: 100%; height:100%;">
<h:form id="editTable" widgetVar="editTable">
<p:panelGrid layout="grid" columns="2" columnClasses="label,value" styleClass="ui-panelgrid-blank" rendered="#{documentsInboxView.pdfFileType}">
<p:outputLabel value="Pořadí stránek" for="@next" rendered="#{documentsInboxView.filePagesNumber gt 1}"/>
<h:form rendered="#{documentsInboxView.filePagesNumber gt 1}">
<p:orderList value="#{documentsInboxView.pagesOrder}" var="page" itemValue="#{page}" itemLabel="#{page}" style="width: 100%;" controlsLocation="right" responsive="true" id="pagesOrderOrderList" widgetVar="pagesOrderOrderList" immediate="true">
<p:column>
<h:outputText value="#{page}" />
</p:column>
</p:orderList>
<p:commandButton ajax="true" type="submit" value="Změnit pořadí" onstart="PF('blockUIWidget').show();" oncomplete="PF('blockUIWidget').hide();" actionListener="#{documentsInboxView.changePagesOrder}" immediate="true" update="@widgetVar(container) @widgetVar(pagesOrderOrderList)" process="@this @widgetVar(pagesOrderOrderList)"/>
</h:form>
</p:panelGrid>
</h:form>
</p:outputPanel>
</p:dialog>
Adding ajax to the orderList with processing and updating the orderList solved the issue.通过处理和更新 orderList 将 ajax 添加到 orderList 解决了这个问题。
<p:orderList value="#{documentsInboxView.pagesOrder}" var="page" itemValue="#{page}" itemLabel="#{page}" style="width: 100%;" controlsLocation="right" responsive="true" id="pagesOrderOrderList" widgetVar="pagesOrderOrderList" immediate="true">
<p:ajax event="reorder" process="@this" update="@this"/>
<p:column>
<h:outputText value="#{page}" />
</p:column>
</p:orderList>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.