[英]how to call af:popup after jspx page load?
我有一個JSPX頁面,並且正在使用ADF豐富的組件。
我有一個ADF彈出窗口,我想在第一次加載頁面時顯示此彈出窗口(刷新頁面后不應再次顯示)
如何做到這一點?
這是頁面的結構:
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
xmlns:pe="http://xmlns.oracle.com/adf/pageeditor"
xmlns:cust="http://xmlns.oracle.com/adf/faces/customizable"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<af:popup id="notiPopupId" rendered="#{homeBean.isThereNotif}" clientComponent="true" binding="#{homeBean.notificationsPopUp}">
<af:dialog id="notiDialogId" styleClass="message_dialog" type="none"
title="#{portalBundle.notifications}" contentWidth="400"
closeIconVisible="true">
<af:outputText value="my output message" />
您可以創建實現PagePhaseListener
類並重寫下面的方法,如下所示:
public void beforePhase(PagePhaseEvent phaseEvent) {
UIViewRoot viewRoot = JSFUtils.getRootView2();
if (!AdfFacesContext.getCurrentInstance().isPostback()) {
if (phaseEvent.getPhaseId() == Lifecycle.PREPARE_RENDER_ID) {
if (viewRoot != null) {
String curPage = viewRoot.getViewId();
try {
if (curPage != null) {
// call Pop Up programmatic here
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
public void afterPhase(PagePhaseEvent pagePhaseEvent) {
}
public PhaseId getPhaseId() {
return PhaseId.RESTORE_VIEW;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.