<-----Google Analytics Code Start----> <-----Google Analytics Code Close---->
Skip to content



Default screen resolution  Wide screen resolution  Increase font size  Decrease font size  Default font size  Skip to content Default color Pink color Green color Green color

Related Items

Home arrow Technical Articles arrow Oracle Application Framework arrow Add Picklist/Dropdown list field to OAF Screen using extension/Personalization
This website has now moved to http://apps2fusion.com

Add Picklist/Dropdown list field to OAF Screen using extension/Personalization | Print |  E-mail
Written by Anil Passi   
Friday, 29 February 2008

In this article, I will demo how you can extend a page so as to add a new DropDown Picklist to an existing page.
In this example, I will be using an iExpense page.

Current Business Scenario
The mileage section in iExpenses page does not have FuelType DropDown field in main section.
Users need to go to Detail Region to enter a value into that field

Image below shows the current screen

Change as per Business Requirement
Make the Fuel Type dropdown list available within the main section of the Mileage Screen.
The user must not be forced to navigate to Detail Section.
Hence we need to create a new field, such that
        a. It maps to a base table column [via ViewObject Attribute]
        b. The list of values within dropdown list come from another View Object that provides LOV for Fuel Types
End result will be as per the image shown below

In the main section of the screen is based on a view object named MileageLinesVO, which has an attribute named FuelType
    However :-
        a. There is no "screen field" in the main section of Mileage Entry screen for FuelType DB Column/Attribute
        b. Any VO to be used within the page, must be present within AM of the page, which happens to be WebExpensesAM.
            But in this case, "DetailFuelTypesVO"[used for Picklist dropdown] is not within the AM "WebExpensesAM"
            Hence, we need to either extend the WebExpensesAM to add DetailFuelTypesVO to WebExpensesAM
            We can add a couple of lines in the controller to create a relationship between AM and Picklist VO

Solution :-
    a. Extend the controller against the page, in this case we extend oracle.apps.ap.oie.webui.MileageListCO
    b. Get a handle to the existing AM on this page, which in this case is WebExpensesAM
        You can get a handle to AM by using
                OAApplicationModule oam = oapagecontext.getApplicationModule(oawebbean) ;
    c. Programatically attach the "DetailFuelTypesVO" to WebExpensesAM.                   
                oav = (OAViewObject)oam.createViewObject("xxoieDetailFuelTypesVO", "oracle.apps.ap.oie.entry.server.DetailFuelTypesVO") ; 
                        //Note xxoieDetailFuelTypesVO is the instance name of VO
    d. Using personalization, add a "Dropdown List" field as shown in screenshots**** below.
        The data for this dropdown list will come via VO Instance xxoieDetailFuelTypesVO
    e. Apply the extended controller to the Mileage Page ~~~~

Steps with screenshot
1. Create an item ****

2. ReOrder to make this item appear besides UOM

3. Attach the controller ~~~~

Can we not extend the AM WebExpensesAM, so as to add VO Instance xxoieDetailFuelTypesVO at design time?
Indeed you can also alternately extend the AM to achieve the desired results [infact this is preferred approach].
However, if the AM were to be the root AM, then extension of controller would be the only choice.
Also, regardless of your approach, Controller must be extended, so as to initiate execute Query on Picklist VO

For this specific example, the Controller Code is
package xx.oracle.apps.ap.oie.webui;
import oracle.apps.ap.oie.webui.MileageListCO;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAImageBean;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.table.OATableBean;
import oracle.apps.ap.oie.entry.server.* ;
import oracle.apps.fnd.framework.* ;
import oracle.apps.fnd.framework.server.* ;
public class xxMileageListCO extends MileageListCO
  public xxMileageListCO()

    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
            oapagecontext.writeDiagnostics(this, "start xxMileageListCO processRequest", 2);
        super.processRequest(oapagecontext, oawebbean);

    OAApplicationModule oam = oapagecontext.getApplicationModule(oawebbean) ;
     System.out.println("XXXX Mileage AM Name is =>" + oam.getFullName() );
    OAViewObject oav=  (OAViewObject)oam.findViewObject("xxoieDetailFuelTypesVO") ;
    if ( oav != null )
      System.out.println("XXXX Found VO DetailFuelTypesVO for Mileage AM. This means we have re-entered the page" );
      System.out.println("XXXX CAN NOT FIND VO DetailFuelTypesVO for Mileage AM" );
      oav = (OAViewObject)oam.createViewObject("xxoieDetailFuelTypesVO", "oracle.apps.ap.oie.entry.server.DetailFuelTypesVO") ; 

    if ( oav != null )
    System.out.println("XXXX FINALLY FOUND VO DetailFuelTypesVO for Mileage AM" );   
    //Remove this hardcoding later, or get this from a profile option
    oav.setWhereClauseParam(0, "10090" );

Overall Sequence of Flow 
A. The new controller firstly calls super.processRequest, so that code for standard functionality gets executed first.
B. We then instantiate a view Object Instance xxoieDetailFuelTypesVO, which used used for Picklist values. We also execute query for that records for picklist are fetched into the VO Cache in mid-tier
C. Using Personalization, a MessageChoice bean is created which is linked to  xxoieDetailFuelTypesVO.
D. This field that was created using personalization also gets mapped to Base VO i.e.  MileageLinesVO
Comments (0)add
You must be logged in to a comment. Please register if you do not have an account yet.