Oracle OAF: Create a button on the fly

The following code requires you to setup a new custom message in Applications (Application Developer Responsibility) with name XXX_CUSTOM_MSG_BUTTON.

OASubmitButtonBean oasb =
    (OASubmitButtonBean)pageContext.getWebBeanFactory().createWebBean(pageContext,
                                                                      "BUTTON_SUBMIT");
oasb.setID("xxCustomButton");
oasb.setUINodeName("xxCustomButton");
oasb.setEvent("xxCustomButton");
 
String printTextMsg = pageContext.getMessage("XXX","XXX_CUSTOM_MSG_BUTTON",null);
oasb.setText(printTextMsg);
oawebbean.addIndexedChild(oasb);

Leave a Reply