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 ScenarioThe 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 RequirementMake 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 TypesEnd result will be as per the image shown below

Challenges

In the main section of the screen is based on a view object named MileageLinesVO, which has an attribute named FuelTypeHowever :- 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 OR 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 screenshot1. Create an item ****

2. ReOrder to make this item appear besides UOM

3. Attach the controller ~~~~

Q&ACan 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