How to show popup by programmetically.
978826May 22 2013 — edited May 24 2013I have situation where i want to show the pop-up programmetically.
When i modify the data and try to submit the data without saving, i want to show the popup saying the Data is not saved.
Below is my code.
public class PopupClass {
private RichPopup richpopupId;
public void setRichpopupId(RichPopup richpopupId) {
this.richpopupId = richpopupId;
}
public RichPopup getRichpopupId() {
return richpopupId;
}
public void openPopup(ActionEvent actionEvent) {
FacesContext context = FacesContext.getCurrentInstance();
ExtendedRenderKitService service = Service.getRenderKitService(FacesContext.getCurrentInstance(),
ExtendedRenderKitService.class);
StringBuffer showPopup = new StringBuffer();
showPopup.append("var hints = new Object();");
showPopup.append("var popupObj=AdfPage.PAGE.findComponent('" +
richpopupId + "'); popupObj.show(hints);");
service.addScript(FacesContext.getCurrentInstance(),showPopup.toString());
}
}
I have one popup component in jsff page with the dialog. For bindings of that popup is binded to "richpopupId" object.
whenever this method is called popup wont be show, either i am getting any errors nor i am getting the popup.
Please help me out on this.