Monday 9 January 2012

Creating Defalut List Bean Dynamically In oaf

Creating Defalut List Bean dynamically in oaf
    
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
    OADefaultListBean list =(OADefaultListBean)createWebBean(pageContext,OAWebBeanConstants.DEFAULT_LIST_BEAN,null, "positionsList");
    // Specify the view object that you will use to populate the list bean values.
    list.setListViewObjectDefinitionName("oracle.apps.fnd.framework.toolbox.poplist.server.PositionsVO");
    // Specify the display and internal value attributes in the associated viewobject.
    list.setListValueAttribute("LookupCode");
    list.setListDisplayAttribute("Meaning");
    // Configure the list box to allow selection of multiple values.
     list.setMultiple(true);
    // Even though you created the component with an ID, you must explicitly
    // make this call to setName().
    list.setName("posList");
    list.setText("List of values");
    // In this example, we're adding the list box to a messageComponentLayoutregion, so we
    // get the declaratively defined messageLayout region that will contain this
    // component. Note that we declaratively set a prompt for the list box on the
    // messageLayout region.
    OAMessageLayoutBean listBoxLayout =(OAMessageLayoutBean)webBean.findChildRecursive("ListBoxLayout");
    listBoxLayout.addIndexedChild(list);
  }


Output:

No comments:

Post a Comment