-1

我有一个这样的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 没有响应。

4

1 回答 1

0

两个命令名称错误。

<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()"/>
于 2016-11-18T04:20:18.917 回答