When trying to open a Popup on JSF/JSFF page programmatically through Managed Bean, use the following method and pass the ID of the popup to the method:
public void openPopup(String popupId) { ExtendedRenderKitService erkService = Service.getService(FacesContext.getCurrentInstance().getRenderKit(), ExtendedRenderKitService.class); erkService.addScript(FacesContext.getCurrentInstance(), "var hints = {autodismissNever:true}; " + "AdfPage.PAGE.findComponent('" + popupId + "').show(hints);"); } OR On the button , write a method on the action event. public void ShowPopup(ActionEvent actionEvent) { RichPopup.PopupHints hints = new RichPopup.PopupHints(); this.getPopUp().show(hints); } If you want to hide the popup..you can write like this public void HidePopup(ActionEvent actionEvent) { RichPopup.PopupHints hints = new RichPopup.PopupHints(); this.getPopUp().hide(); }
General use is when you wish to call the a popup from a button press but first want to execute some actions/processings in the screen on the button click.
In the button on the JSFF, just add a actionListener and then call the openPopup() method from the action listener or any other method you wish to.
Source: Forum