简体   繁体   English

PrimeFaces 订单列表未随订单更改而更新

[英]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,仍然没有。

HTML HTML

<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.

相关问题 使用更新的数字顺序更改列表元素 - Change list elements with updated numerical order 比较两个对象列表的新的、更改的、更新的特定属性 - Compare two lists of object for new, changed, updated on a specific property React Native - 数据更改时 FlatList 值未更新 - React Native - FlatList value not updated when data has changed 是否可以通过循环将这些有问题的元素更改为零以保持可持续性? - Can those problematic elements be changed as zeros with a loop in order to keep the sustainability? 通过删除和添加移动列表内的对象后订单项目未更改 - Order items not changed after moving objects inside list by remove and add SQL LINQ 返回问题 | 如我所述,如何返回列表类型,我想将 queryresultpage 作为订单列表返回 - SQL LINQ RETURN PROBLEM | How to return list type as I stated, I want to return queryresultpage as a orderlist 帕斯卡三角形的列表可能不会被初始化,但在顺序改变时可以工作。 为什么? - List may not be initialized for Pascal's triangle, but works when order is changed. Why? SharePoint列表中的“显示订单”列,当一项更改时会自动更新所有项目 - Display Order column in SharePoint list that auto updates all items when one changed 显示带有 Primefaces 数据表的嵌套列表 - Display a nested list with Primefaces dataTable JSF Primefaces selectonemenu页面导航 - JSF Primefaces selectonemenu page navigation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM