Friday, January 3, 2014

Adding Submit Button Programmatically.



Adding Submit Button Programmatically




To create the submit button programmatically write the following code in controller.




public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{

super.processRequest(pageContext, webBean);


//creating submit button through coding


OASubmitButtonBean subBtn= (OASubmitButtonBean)pageContext.getWebBeanFactory().createWebBean(pageContext,"BUTTON_SUBMIT");
subBtn.setID("SubBtn");
subBtn.setUINodeName("SubBtn");
subBtn.setEvent("Submit");
subBtn.setText("Submit ");
webBean.addIndexedChild(subBtn); /*in which region u want to add the button give the id of that region in the above line (remove webBean and give the id of region).*/


}

1 comment:

  1. additionally i need to agregate a parameter and its value to this button, how i would do it? tks

    ReplyDelete