How to Capture/Handle Button Click Event In OAF

Whenever a Submit button is created in OAF page - Internally a 'OASubmitButtonBean' will get created and it is used to capture the Button click event . We use this bean to find the button click event occurred in the OAF page.

Each and every Bean created in page can be identified by its unique ID. Similarly for the submit button also event can be captured using the ID of the Submit button.

Using PageContext we can determine whether the user clicked on the submit button in the page or not.

Note : Only in the ProcessFormRequest Method only we can capture any events.


How to Capture/Handle Button Click Event In OAF

Using the below code we can capture button is clicked or not in the given page.

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
 super.processFormRequest(pageContext, webBean);
 if (pageContext.getParameter("create") != null){
       throw new OAException("Button is clicked by the user",OAException.CONFIRMATION);
 }
}




No comments