In the managed bean add the following code
public void methodOne() {
showPopup(editPopup, "p1");
}
// Code to show the popup
// It takes popup ID as the parameter
public static void showPopup(RichPopup popup, String popID) {
FacesContext context = FacesContext.getCurrentInstance();
StringBuilder script = new StringBuilder();
script.append("var popup = AdfPage.PAGE.findComponent('").append(popID).append("'); ")
.append("if (!popup.isPopupVisible()) { ")
.append("var hints = {}; ");
script.append("popup.show(hints);}");
ExtendedRenderKitService erks =
Service.getService(context.getRenderKit(), ExtendedRenderKitService.class);
erks.addScript(context, script.toString());
}
public void methodOne() {
showPopup(editPopup, "p1");
}
// Code to show the popup
// It takes popup ID as the parameter
public static void showPopup(RichPopup popup, String popID) {
FacesContext context = FacesContext.getCurrentInstance();
StringBuilder script = new StringBuilder();
script.append("var popup = AdfPage.PAGE.findComponent('").append(popID).append("'); ")
.append("if (!popup.isPopupVisible()) { ")
.append("var hints = {}; ");
script.append("popup.show(hints);}");
ExtendedRenderKitService erks =
Service.getService(context.getRenderKit(), ExtendedRenderKitService.class);
erks.addScript(context, script.toString());
}
import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
ReplyDeleteimport org.apache.myfaces.trinidad.util.Service;