| Home |
| Technical Articles |
| Training Articles |
| Receive Email for New Articles |
| Contributors |
| Hands-On-Training |
| Consultancy Services |
Technical Articles
Oracle Application Framework
Add Picklist/Dropdown list field to OAF Screen using extension/Personalization | Add Picklist/Dropdown list field to OAF Screen using extension/Personalization | | Print | |
| 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. ![]() 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 **** ![]() ![]() ![]() 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
(0)
You must be logged in to a comment. Please register if you do not have an account yet.
|