Primefaces确认对话框未更新数据表
我想在用户从确认对话框确认操作后更新datatable,但它不起作用Primefaces确认对话框未更新数据表,primefaces,jsf-2,datatable,Primefaces,Jsf 2,Datatable,我想在用户从确认对话框确认操作后更新datatable,但它不起作用 <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: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>
一切都运行良好,只是它不会更新数据表。有什么想法吗?您只需在窗体和面板之间反转,如下所示:
<h:form id="dtForm">
<p:panel id="formPanel" header="Welcome #{sessionBean.name}">
....
</p:panel>
</h:form>
....
您只需在窗体和面板之间反转,如下所示:
<h:form id="dtForm">
<p:panel id="formPanel" header="Welcome #{sessionBean.name}">
....
</p:panel>
</h:form>
....
添加p:remoteCommand。我遇到了一个相关的问题,我就是这样解决的,只是我用了p:dialog。文本区域更新数据表中的记录“MyMessage”
添加p:remoteCommand。我遇到了一个相关的问题,我就是这样解决的,只是我用了p:dialog。文本区域更新数据表中的记录“MyMessage”
以jsf开发模式运行应用程序。然后检查是否有任何错误。还可以尝试添加一个p:messages
,让它自动更新,看看它告诉了你什么。如何在jsf开发模式下运行?而且没有消息要显示…它在(好的)jsf教程中,谷歌abd更多。从阅读开始,尝试在jsf开发模式下运行应用程序的前一行。然后检查是否有任何错误。还可以尝试添加一个p:messages
,让它自动更新,看看它告诉了你什么。如何在jsf开发模式下运行?而且没有消息要显示…它在(好的)jsf教程中,谷歌abd更多。从阅读开始,尝试前一行