【问题标题】:PrimeFaces' rowEditor doesn't work other than first tryPrimeFaces 的 rowEditor 除了第一次尝试外不起作用
【发布时间】:2017-04-01 18:13:02
【问题描述】:

我有一个p:dataTable,看起来像这样。

<p:remoteCommand name="rowEdit" action="#{servicesController.onRowEditCommand}" update="servicesTable" />
<p:remoteCommand name="rowEditCancel" action="#{servicesController.onRowEditCancelCommand}" update="servicesTable" />

<p:dataTable id="servicesTable"
             value="#{servicesController.services}" var="service" rowKey="#{service.id}"
             editable="true" editMode="row">

  <p:ajax event="rowEdit" listener="#{servicesController.onRowEdit}"
          oncomplete="rowEditCommand()"/>
  <p:ajax event="rowEditCancel" listener="#{servicesController.onRowEditCancel}"
          oncomplete="rowEditCancelCommand()"/>
  <p:ajax event="rowSelect" update=":mainMenu"
          listener="#{servicesController.sessionScopeServiceChanged}"/>

    <!-- other columns here -->

    <p:column style="width: 44px;">
      <p:rowEditor/>
    </p:column>

    <!-- other columns here -->

  </p:dataTable>

p:rowEditor 第一次可以正常工作。而且从第二次开始就不行了。它进入编辑模式,但复选框和 x 没有响应。

【问题讨论】:

    标签: primefaces roweditor


    【解决方案1】:

    两个命令名称错误。

    <p:remoteCommand name="rowEdit" ... />
    <p:remoteCommand name="rowEditCancel" ... />
    
      <p:ajax ... oncomplete="rowEditCommand()"/>
      <p:ajax ... oncomplete="rowEditCancelCommand()"/>
    

    我改成了。

    <p:remoteCommand name="rowEditCommand" ... />
    <p:remoteCommand name="rowEditCancelCommand" ... />
    
      <p:ajax ... oncomplete="rowEditCommand()"/>
      <p:ajax ... oncomplete="rowEditCancelCommand()"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-17
      • 2021-02-28
      • 1970-01-01
      • 2023-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多