我想彈出ajax調用對話框,我嘗試了很多方法,但我找不到解決方案。有人能幫助我,謝謝。p:關於ajax的oncomplete屬性沒有顯示對話框
的XHTML代碼如下
<h:body>
<h:form>
<p:selectOneRadio style="margin-left:10px" value="#{newSubBean.selectedEvent}"
required="true" layout="pageDirection">
<f:selectItems value="#{newSubBean.events}" var="item"
itemValue="#{item.eventId}" itemLabel="#{item.title}" />
<p:ajax event="change" update="dt" oncomplete="PF('sub').show()">
</p:ajax>
</p:selectOneRadio>
<p:dialog visible="true" id="dialog" widgetVar="sub"
header="Previous Subscriptions" showEffect="explode" hideEffect="bounce">
<p:dataTable id="dt" style="width:800px"
value="#{newSubBean.subscribedEventList}" var="rows">
<f:facet name="header">
<p:outputLabel value="Previous Subscriptions">
</p:outputLabel>
<br/>
<p:outputLabel styleClass="preformatted"
value="#{newSubBean.eventName}">
</p:outputLabel>
</f:facet>
<p:column headerText="Subscribed Notification">
<p:outputLabel value="#{rows.notificationType.title}">
</p:outputLabel>
</p:column>
<p:column headerText="Subscribed Template">
<p:outputLabel value="#{rows.notificationTemplateDetail.title}">
</p:outputLabel>
</p:column>
<p:column headerText="Subscription Time">
<p:outputLabel
value="#{rows.insertionTimeStamp.getTime().toLocaleString()}">
</p:outputLabel>
</p:column>
</p:dataTable>
<p:commandButton value="Close" onclick="PF('sub').hide();">
</p:commandButton>
</p:dialog>
</h:form>
</h:body>
使對話框表單中。並且將數據表插入表單中,當您嘗試更新時更新dataTable表單。 –
@yagamiLight:爲什麼?我認爲沒有任何需要 – Kukeltje