Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to show popup by programmetically.

978826May 22 2013 — edited May 24 2013
I 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 21 2013
Added on May 22 2013
6 comments
323 views