Dialog message in oaf. How to display popup message in oaf
How to create dialog page in oaf
In the is Below code, i am taking an example of one date
entry page in this when user will click on the save button then it will display
the dialog message with yes or no button to take user input. If user will click
'ok' then system will commit the transactions and if user will click no then system
rollback the transactions.
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");
}
}
public void rollbackChanges() {
getOADBTransaction().rollback();
}
1 comments:
Very nice blog. Very helpful and tested code. I copied the above code and works fine like dream! Thanks for taking time to share knowledge. Much appreciated, keep it up.
Post a Comment