Sunday 3 June 2018

Dialog message in oaf.How to display popup message in oaf

 

Dialog message in oaf. How to display popup message in oaf

 
 

How to create dialog page in oaf



 
Dialog messages display in the different page but on the same working OAF page. In the dialog messages, we have the option to take user inputs in the form of yes or no button click events. in dialog messages user gives confirmations by click on the buttons of the dialog messages.

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");

}

 
// In AMImpl.java:

 // these are method for committing and rollbacking the transactions:

 public void saveRecords() {
getOADBTransaction().commit();

}

public void rollbackChanges() {
getOADBTransaction().rollback();

}
 
 

Dialog message in oaf.How to display popup message in oaf

 
 

1 comments:

Unknown said...

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

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *