2017-09-23 11 views
0

確認ダイアログからユーザーがアクションを確認してもデータテーブルを更新しますが、動作しません。Primefacesがダイアログでデータテーブルを更新しないことを確認します

<p:panel id="formPanel" header="Welcome #{sessionBean.name}"> 
    <h:form id="dtForm"> 
     <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" globalOnly="true" /> 
     <p:dataTable id="classList" var="class" value="#{listClassBean.classList}" widgetVar="classListDT" 
        paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" 
        paginator="true" rows="10" rowsPerPageTemplate="5,10,15" paginatorPosition="bottom" 
        rowKey="#{class.classroomId}" style="margin: 20px 20px 20px 20px;"> 

      <!--columns omitted--> 

      <p:column headerText="Exit" rendered="#{sessionBean.loggedAccount.accType == 'S'}" 
         style="width: 50px; text-align: center;"> 
       <p:commandButton icon="fa fa-sign-out" action="#{listClassBean.exitClass(class.classroomId)}" 
           styleClass="redbutton" process="dtForm:classList" update="dtForm:classList"> 
        <p:confirm header="Exit Class" 
           message="Are you sure you want to exit the class #{classroomSettingBean.classroom.classroomId}?" 
           icon="ui-icon-alert"/> 
       </p:commandButton> 
      </p:column> 
     </p:dataTable> 
    </h:form> 
</p:panel> 

<h:form> 
    <p:confirmDialog global="true" showEffect="clip" hideEffect="clip"> 
     <p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check"/> 
     <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" /> 
    </p:confirmDialog> 
</h:form> 

すべてがうまくいきますが、データテーブルは更新されません。何か案が?

+0

JSF開発モードで使用するアプリケーションを実行します。あなたが何らかのエラーが発生していないか確認してください。また、 'p:messages'を追加して、それを自動更新して、それが何を伝えているのかを見てみましょう。 – Kukeltje

+0

jsf開発モードでの実行方法表示するメッセージはありません... – Newbie

+0

これは(良い)jsfチュートリアル、Google abd moreです。 oncomplete = "PF( 'confirmDialog')。hide();参照:http://www.stackoverflow.com/tags/jsf/info – Kukeltje

答えて

0

あなただけのフォームと、このようなパネルの間に逆しました:代わりにダイアログ:

<h:form id="dtForm"> 
     <p:panel id="formPanel" header="Welcome #{sessionBean.name}"> 

.... 

     </p:panel> 
</h:form> 
0

私はPを使用するだけで、それを解決する方法の関連問題とこれを持っていました。 textareaは、dataTable 'codeTable'のレコード "MyMessage"を更新します。

<p:dialog header="Customize Message" id="editDlg" widgetVar="displayDlg" modal="true" resizable="false" width="450"> 
 
    <p:inputTextarea id="resin" value="#{MyBean.myMessage}" style="width: 400px; height: 150px; padding: 10px; resize: none" maximum="550" /> 
 
    <p:commandButton value="Cancel" onclick="PF('displayDlg').hide()" style="width: 75px; left: 220px" /><br/> 
 
    <p:commandButton value="Update" action="#{myBean.updateMyMessage()}" update="form:my_growl" onclick="PF('displayDlg').hide()" style="width: 75px; left: 220px" oncomplete="refreshTable();" /> 
 
</p:dialog> 
 
<p:remoteCommand name="refreshTable" action="#{paybill.userPayBillDetails()}" partialSubmit="true" process="@this, editDlg" update="codeTable" />

関連する問題