Sunday 7 July 2013

Creating MessageChoiceBean Programatically

Controller Code
  1. public void processRequest(OAPageContext pageContext, OAWebBean webBean)  
  2. {  
  3. super.processRequest(pageContext, webBean);  
  4. String sMode = "test";  
  5. OAApplicationModule am = pageContext.getApplicationModule(webBean);  
  6. OAViewObject oaviewobject = (OAViewObject)am.findViewObject("xxScoResourceVO1");  
  7. if(oaviewobject == null)  
  8. {  
  9. oaviewobject = (OAViewObject)am.createViewObject("xxScoResourceVO1","xx.oracle.apps.pa.poplist.server.testVO");  
  10. }  
  11.         
  12. oaviewobject.setWhereClause("DESCRIPTION IS NULL OR DESCRIPTION = '" + sMode + "'"); //Setting where clause Dynamically of Poplist VO  
  13.   
  14. oaviewobject.executeQuery();  
  15. OAMessageChoiceBean oamessagechoicebean = (OAMessageChoiceBean)createWebBean(pageContext, "MESSAGE_POPLIST");  
  16. oamessagechoicebean.setPrompt("Back");  
  17. oamessagechoicebean.setListViewObject(pageContext, oaviewobject);  
  18. oamessagechoicebean.setListDisplayAttribute("Meaning");  
  19. oamessagechoicebean.setListValueAttribute("LookupCode");  
  20.     
  21. oamessagechoicebean.setName("xxAddAsgmtApplyAction");  
  22. oamessagechoicebean.setAllowBlankValue(false);  
  23. oamessagechoicebean.setDefaultValue("RETURN_BACK"); //Setting Default Value  
  24. webBean.addIndexedChild(oamessagechoicebean);  
  25. }  
  26.   
  27. How to capture its Value  
  28.   
  29. String PoplistValue = oapagecontext.getParameter("xxAddAsgmtApplyAction");  

No comments:

Post a Comment


Note: Only a member of this bl

No comments:

Post a Comment