How to disable field based on parameter value

By using following script we can get parameter value in page level. Based on value we can set rendered property for the fields as follows:

public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
String ButtonStat = pageContext.getParameter(“ButtonStat”);

if (“FirstBTN”.equals(ButtonStat)) {
OASubmitButtonBean backbtn1 =
(OASubmitButtonBean)webBean.findIndexedChildRecursive(“FirstBTN”);
System.out.println(“1”);
backbtn1.setRendered(true);
}

if (“SecondBTN”.equals(ButtonStat)) {
OASubmitButtonBean backbtn2 =
(OASubmitButtonBean)webBean.findIndexedChildRecursive(“SecondBTN”);
System.out.println(“2”);
backbtn2.setRendered(true);
}

if (“ThirdBTN”.equals(ButtonStat)) {
OASubmitButtonBean backbtn3 =
(OASubmitButtonBean)webBean.findIndexedChildRecursive(“ThirdBTN”);
System.out.println(“3”);
backbtn3.setRendered(true);
}
}

Recent Posts