PrimeFaces的rowEditor除了第一次尝试之外不起作用



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

两个命令名错了。

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

I changed to.

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

相关内容

  • 没有找到相关文章

最新更新