Friday 14 October 2011

Create new button programatically

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);

No comments:

Post a Comment