How to create popup window in OAF
We are going to discuss about , how to create popup window in OAF. With the help of Popup windows , we do provide important messages to application users and also get the user input from users.Popup window generates from the main the main window to provide some important updates or notification's to users. Here we will show you the example to create the popup window in oaf. In this Example , We are trying to create popup window in data entry page where user enters information and click on the save button. After clicking the save option one pop up window will be come which will ask the user for final input to save this transaction. Here below is the detail OAF code to create the popup window in OAF.
Source Code to create the popup window in OAF
To Show Dialog Message
in OAF we need to use APIs in the oracle.apps.fnd.framework.webui.OADialogPage
class and OAPageContext interface. The OADialogPage class holds properties for
the generic dialog page
processFormRequest() method:
if
(pageContext.getParameter("SAVE") != null)
{
OAException
descMesg = new OAException("Do you want to save this
transactions");
OADialogPage
dialogPage = new OADialogPage(OAException.WARNING, descMesg,null,
"", "");
dialogPage.setOkButtonToPost(true);
dialogPage.setNoButtonToPost(true);
dialogPage.setPostToCallingPage(true);
//
setting names of buttons of dialog page
dialogPage.setOkButtonItemName("SaveYes");
dialogPage.setNoButtonItemName("SaveNo");
pageContext.redirectToDialogPage(dialogPage);
}
// if user clicks
Yes button, then record will save
else if
(pageContext.getParameter("SaveYes") != null) {
am.invokeMethod("saveRecords");
throw new OAException("Record
has been saved successfully.",
OAException.CONFIRMATION);
}
// if user clicks No button,
then we will rollback.
else if
(pageContext.getParameter("SaveNo") != null) {
am.invokeMethod("rollbackChanges");
}
// In AMImpl.java:
// these are method for
committing and rollbacking the transactions:
public void saveRecords() {
getOADBTransaction().commit();
}
public void rollbackChanges() {
getOADBTransaction().rollback();
}
0 comments:
Post a Comment