2016-11-18 7 views
-1

私はp:dataTableのように見えます。PrimeFacesのrowEditorは最初の試行以外では動作しません

<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は初めて正常に動作します。そして、それは2回目からは機能しません。それは編集モードになりますが、チェックボックスとxは応答しません。

答えて

0

2つのコマンド名が間違っていました。

<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()"/> 
関連する問題