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

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

Challenges
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
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 screenshot
1. Create an item ****

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
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 screenshot
1. Create an item ****



2. ReOrder to make this item appear besides UOM

3. Attach the controller ~~~~

Q&A
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)
{
if(oapagecontext.isLoggingEnabled(2))
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" );
else
{
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" );
oav.setWhereClauseParams(null);
//Remove this hardcoding later, or get this from a profile option
oav.setWhereClauseParam(0, "10090" );
oav.executeQuery();
}
}
}
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
(4)
...
written by Anil Passi- , November 20, 2008
written by Anil Passi- , November 20, 2008
Hi Sheena
You can create an LOV mapping [can also be done via personalization]
In this mapping the criteria item will point to the parent item on which your LOV values must be dependent
Thanks
Anil
Votes: +1
You can create an LOV mapping [can also be done via personalization]
In this mapping the criteria item will point to the parent item on which your LOV values must be dependent
Thanks
Anil
report abuse
vote down
vote up
...
written by Sheena , November 20, 2008
written by Sheena , November 20, 2008
I am doing that it works fine, but for one BIG issue. heres the scenario:
Enter VP name (vp id - a form value is populated)
Click on the company code (for instance) lov. The lov shows values based on the vpid and any value entered in the field itself.
Choose a company code and once the popup window closes, the value in the Vp field , chosen above, is getting cleared!
I have created mappings under both the vp and company code textinput fields wherein the criteria is the field itself and another mapping where the criteria is the other field, so in case of company code, its the value being input into the company code lovinput field as well the vpid.
Similar for the VP lov mappings.
The issue arised only when: 1) Chosen VP Value 2) Chosen company code value 3) Go back to vp textinput field and clear it out , to choose a different value, the company code textinput field clears out.
Or if you do the same for company code value..
Any help will the much appreciated!
Sheena
Votes: -2
Enter VP name (vp id - a form value is populated)
Click on the company code (for instance) lov. The lov shows values based on the vpid and any value entered in the field itself.
Choose a company code and once the popup window closes, the value in the Vp field , chosen above, is getting cleared!
I have created mappings under both the vp and company code textinput fields wherein the criteria is the field itself and another mapping where the criteria is the other field, so in case of company code, its the value being input into the company code lovinput field as well the vpid.
Similar for the VP lov mappings.
The issue arised only when: 1) Chosen VP Value 2) Chosen company code value 3) Go back to vp textinput field and clear it out , to choose a different value, the company code textinput field clears out.
Or if you do the same for company code value..
Any help will the much appreciated!
Sheena
report abuse
vote down
vote up
Mileage Rate
written by Vijaya , January 20, 2012
written by Vijaya , January 20, 2012
We have defined Policy Schedule for Mileage. We have a requirement where we need to enter expense line for each day and need to calculate average for all the days which are entered within that expense report. Depending on the average distance for all the lines we need to override the rate which is calculated from Policy Schedule for all the lines. How can we acheive this. Please advise.
Thanks,
Vijaya
Votes: +0
Thanks,
Vijaya
report abuse
vote down
vote up
| < Prev | Next > |
|---|







***********************************
How do I create lovtextinput items that are dependent on each other? None of them are mandatory. For instance: VP, Cost Center and Department. if vp is entered, then department and cost center lov values should be dependent on the lov value. But if the cost center is entered then if the vp lov is chosen, then vp lov is dependent on cost center. And so on..
Thanks
Sheena