Handling OK and Cancel button in af:dialog using popup in Oracle ADF by dialogListener

Requirement – We are displaying a popup message to user and on selecting on OK and CANCEl by user , writing custom code inside bean

Solution – You can have af:popup component in the page .Inside the popup , drag drop af:dialog component. You can call the pop up programmatic using my
another post of popup

For the dialog , you need to have some dialog listener. write it like

<af:dialog title="handling Ok and cancel event}"
           type="okCancel"
           dialogListener="#{techartifact.headerManage.dialogListener1}"
           id="d1">

The method of dialogListener1 can be written as below.Write inside a headerManage bean.

public void dialogListener1(DialogEvent dialogEvent)
  {
    if (dialogEvent.getOutcome() == DialogEvent.Outcome.ok)
    {
     // write your custom code for ok event
    } else
    {
      // write your custom code for cancel event
   } 
  }

Happy coding with techartifact….

Vinay

I am an Oracle ACE in Oracle ADF/Webcenter. Sr Java Consultant-working on Java/J2EE/Oracle ADF/Webcenter Portal/ content and Hibernate for several years. I'm an active member of the OTN JDeveloper/Webcenter forum. Passionate about learning new technologies. I am here to share my knowledge. Give your views and suggestion on [email protected] .

More Posts - Website

Follow Me:
TwitterLinkedInGoogle PlusYouTube