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>
一切運行良好,只是它不更新數據表。任何想法?
運行您在JSF開發模式的應用程序。然後檢查是否有任何錯誤。也可以嘗試添加一個'p:messages'並讓它自動更新並查看它告訴你的內容。 – Kukeltje
如何在jsf開發模式下運行?並沒有消息顯示... – Newbie
它在(好)jsf教程中,谷歌abd更多。從閱讀開始http://www.stackoverflow.com/tags/jsf/info – Kukeltje