Thursday, 17 May 2012

creating MessageChoiceBean Programatically and attach VO to it.


//add the code to the ProcessRequest() function in controller class.
String sMode = "test";
//Getting  application module object;
OAApplicationModule am = pageContext.getApplicationModule(webBean);
//create or create exiting  View  object;
OAViewObject oaviewobject = (OAViewObject)am.createViewObject("xxScoResourceVO1","xx.oracle.apps.pa.poplist.server.testVO");
//Setting where clause Dynamically of Poplist VO
oaviewobject.setWhereClause("DESCRIPTION IS NULL OR DESCRIPTION = '" + sMode + "'");
//execute the query of vo.
oaviewobject.executeQuery();
//create  object of OAMessageChoiceBean  class.
OAMessageChoiceBean oamessagechoicebean = (OAMessageChoiceBean)createWebBean(pageContext, "MESSAGE_POPLIST");
//setting the properties of OAMessageChoiceBean Class
oamessagechoicebean.setPrompt("Back");
//setting or attach the view object  with the MessageChoiceBean.
oamessagechoicebean.setListViewObject(pageContext, oaviewobject);
//setting or attach the  attribute/columns of  view object  with the MessageChoiceBean.
oamessagechoicebean.setListDisplayAttribute("Meaning");
//setting or attach the  attribute/columns of  view object  with the MessageChoiceBean.
oamessagechoicebean.setListValueAttribute("LookupCode");
 //setting other  necessary value for MessageChoiceBean.
oamessagechoicebean.setName("xxAddAsgmtApplyAction");
oamessagechoicebean.setAllowBlankValue(false);
oamessagechoicebean.setDefaultValue("RETURN_BACK"); //Setting Default Value
webBean.addIndexedChild(oamessagechoicebean);

No comments:

Post a Comment