How to disable Button in OAF
In this post , We will discuss about how we can disable the button in the OAF Page. For Example you have Requirment to disable some specific button in the oaf page for some specific conditions. Like ,On the Basis of responsibility , you want to enable and disable the button in the Standard OAF Page. First of all to Disable Any button or to put our custom logic in the standard OAF page , We need to do the Controller Extension. In the Controller Extensions , We put the code to disable the Button in the OAF page. Here below I will share the complete steps and code to disable button in the OAF page.
Steps for How to disable Button in OAF
Step1:- To achieve this Requirement in the standard OAF page , We need to first Find the Controller of the OAF page and then after that we will extend this controller through Controller extensions. If you want to learn more about Controller Extension then refer this post Controller Extension Steps
Step2:- Put this Below code in the Process Request method of the Controller. Process Request Method calls when OAF page loads or Open in the application. Then your custom code will execute and it will enable/disable the button based on your logic.
Process Request Method of the Controller
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
OAApplicationModule oa=(OAApplicationModule)pageContext.getApplicationModule(webBean);
OASubmitButtonBean CreateButton = (OASubmitButtonBean)webBean.findChildRecursive("Create");
CreateButton.setDisabled(true);
0 comments:
Post a Comment