Cholas Oaf Tutorialsr12 Part 5 Drill Down to Details

12
Chola's OAF Tutorials(R12) Part 5 - Drill Down to Details Wednesday, 29 April 2009 15:43 For this exercise, you'll be extending the simple Employees search page you created in the Search Page Exercise to include a drilldown to a Details page that queries a single employee.  {StickyNote}{loadposition ADV1}{/StickyNote} {xtypo_rounded2} Prerequisite: Complete the below tutorials before you start this tutorial. 1) Setup JDEV for R12 Tutorial. 2) HelloWorld page Tutorial for R12. 3) Chola's OAF Tutorials(R12) Part 3 - ResultBasedSearch 4) Chola's OAF Tutorials(R12) Part 4 - AutoCustomizationCriteria Search {/xtypo_rounded2} 1 / 12

Transcript of Cholas Oaf Tutorialsr12 Part 5 Drill Down to Details

Page 1: Cholas Oaf Tutorialsr12 Part 5 Drill Down to Details

Chola's OAF Tutorials(R12) Part 5 - Drill Down to DetailsWednesday, 29 April 2009 15:43

For this exercise, you'll be extending the simple Employees search page you created in theSearch Page Exercise to include a drilldown to a Details page that queries a single employee.

StickyNoteloadposition ADV1/StickyNote

xtypo_rounded2

Prerequisite:

Complete the below tutorials before you start this tutorial.

1) Setup JDEV for R12 Tutorial.

2) HelloWorld page Tutorial for R12.

3) Chola's OAF Tutorials(R12) Part 3 - ResultBasedSearch

4) Chola's OAF Tutorials(R12) Part 4 - AutoCustomizationCriteria Search

/xtypo_rounded2

1 / 12

Page 2: Cholas Oaf Tutorialsr12 Part 5 Drill Down to Details

Chola's OAF Tutorials(R12) Part 5 - Drill Down to DetailsWednesday, 29 April 2009 15:43

loadposition CCL

tab=View Object1.Right click on your project and select new - > Business Tier -> ADF Business Components - >View Object.

Name - EmployeeFullVOPackage - chola.oracle.apps.fnd.employee.server

2.In the Entity Objects page, select the EmployeeEO in the Available list and shuttle it to theSelected list twice (once for the employee, and once for the employee's manager).

3.Select EmployeeEO1 in the Selected List and set or verify: The Association End field is set to ManagerIdEmployeeEO. Reference is checked.

4.In the Attributes page, select the following attributes from the Available list and shuttle them tothe Selected list: From EmployeeEO:

EmployeeId FirstName LastName FullName EmailAddress ManagerId PositionCode Salary StartDate EndDate

2 / 12

Page 3: Cholas Oaf Tutorialsr12 Part 5 Drill Down to Details

Chola's OAF Tutorials(R12) Part 5 - Drill Down to DetailsWednesday, 29 April 2009 15:43

From EmployeeEO1:

EmployeeId FullName EmailAddress

3 / 12

Page 4: Cholas Oaf Tutorialsr12 Part 5 Drill Down to Details

Chola's OAF Tutorials(R12) Part 5 - Drill Down to DetailsWednesday, 29 April 2009 15:43

5.In the Attribute Settings page, select the the EmailAddress attribute, set the Attribute Namefield to be EmployeeEmail, and change the Query Column Alias field to be EMPLOYEE_EMAIL.

6.Now select the FullName attribute, set the Attribute Name field to be EmployeeName, andchange the Query Column Alias field to be EMPLOYEE_NAME.

7.Now select the FullName1 attribute, set the Attribute Name field to be ManagerName, andchange the Query Column Alias field to be MANAGER_NAME.

8.Now select the EmailAddress1 attribute, set the Attribute Name field to be ManagerEmail, andchange the Query Column Alias field to be MANAGER_EMAIL. Select the Next button.

9.In the query page click on Expert mode and paste the below query:

1234567891011121314151617181920 SELECT EmployeeEO . EMPLOYEE_ID ,EmployeeEO . FIRST_NAME ,EmployeeEO . LAST_NAME ,

4 / 12

Page 5: Cholas Oaf Tutorialsr12 Part 5 Drill Down to Details

Chola's OAF Tutorials(R12) Part 5 - Drill Down to DetailsWednesday, 29 April 2009 15:43

EmployeeEO . FULL_NAME AS EMPLOYEE_NAME ,EmployeeEO . EMAIL_ADDRESS AS EMPLOYEE_EMAIL ,EmployeeEO . MANAGER_ID ,EmployeeEO . POSITION_CODE ,EmployeeEO . SALARY ,EmployeeEO . START_DATE ,EmployeeEO . END_DATE ,EmployeeEO1 . EMPLOYEE_ID AS EMPLOYEE_ID1 ,EmployeeEO1 . full_name AS MANAGER_NAME ,EmployeeEO1 . email_address AS MANAGER_EMAIL ,flkp . meaning AS POSITION_DISPLAYFROM FWK_TBX_EMPLOYEES EmployeeEO,FWK_TBX_EMPLOYEES EmployeeEO1,fwk_tbx_lookup_codes_vl flkpWHERE EmployeeEO . manager_id = EmployeeEO1 . employee_id ( + )AND EmployeeEO . position_code = flkp . lookup_codeAND flkp . lookup_type = 'FWK_TBX_POSITIONS'

10.In the Java page, select both the Generate Java File for View Object Class:EmployeeFullVOImpl checkbox and the Generate Java File for View Row Class:EmployeeFullVORowImpl. Click Finish.

Right click EmployeeAM and select Edit the EmployeeAM and shuttle the EmployeeFullVO tothe right side.

tab=Page

11.Right click the project and select new.In the New window, expand the Web Tier hierarchyand select OA Components. Select Page.

Name - EmpDetailsPG

5 / 12

Page 6: Cholas Oaf Tutorialsr12 Part 5 Drill Down to Details

Chola's OAF Tutorials(R12) Part 5 - Drill Down to DetailsWednesday, 29 April 2009 15:43

Package - chola.oracle.apps.fnd.employee.webui

12.Click on region1 and set : i. Name – PageLayoutRN

ii. AM Definition - chola.apps.oracle.fnd.employee.server.EmployeeAM

iii. Window Title – Chola R12 Tutorials Drill Down Search Page

iv. Title – Chola Search Page

v. AutoFooter - True

13.Select the PageLayoutRN in the Structure pane, right-click and select New > Region UsingWizard from the context menu.14.In the BC4J Objects page, select your EmployeeAM(chola.oracle.apps.fnd.employee.server.EmployeeAM), and then select your EmployeeFullVO1view object instance from the Available View Objects list.

6 / 12

Page 7: Cholas Oaf Tutorialsr12 Part 5 Drill Down to Details

Chola's OAF Tutorials(R12) Part 5 - Drill Down to DetailsWednesday, 29 April 2009 15:43

15.In the Region Properties page, set the Region ID field value to MainRN and set the RegionStyle to defaultSingleColumn.

7 / 12

Page 8: Cholas Oaf Tutorialsr12 Part 5 Drill Down to Details

Chola's OAF Tutorials(R12) Part 5 - Drill Down to DetailsWednesday, 29 April 2009 15:43

16.In the View Attributes page, select the following from the Available View Attributes list andshuttle them to the Selected View Attributes list: EmployeeId FirstName LastName EmployeeEmail PositionDisplay ManagerName Salary StartDate EndDate Click Next. 17.Change all style of all the attributes to messageStyledText and the attribute set as follows: EmployeeId -/oracle/apps/fnd/framework/toolbox/attributesets/FwkTbxEmployees/EmployeeIdFirstName -/oracle/apps/fnd/framework/toolbox/attributesets/FwkTbxEmployees/FirstNameLastName -/oracle/apps/fnd/framework/toolbox/attributesets/FwkTbxEmployees/LastNameEmployeeEmail -/oracle/apps/fnd/framework/toolbox/attributesets/FwkTbxEmployees/EmailAddressPositionDisplay -/oracle/apps/fnd/framework/toolbox/attributesets/FwkTbxEmployees/Position ManagerName -/oracle/apps/fnd/framework/toolbox/attributesets/FwkTbxEmployees/FullName_ManagerSalary - /oracle/apps/fnd/framework/toolbox/attributesets/FwkTbxEmployees/SalaryStartDate -/oracle/apps/fnd/framework/toolbox/attributesets/FwkTbxEmployees/StartDateEndDate - /oracle/apps/fnd/framework/toolbox/attributesets/FwkTbxEmployees/EndDate Set the prompt as per the screenshot.Click Next and Finish.

8 / 12

Page 9: Cholas Oaf Tutorialsr12 Part 5 Drill Down to Details

Chola's OAF Tutorials(R12) Part 5 - Drill Down to DetailsWednesday, 29 April 2009 15:43

19.Set the properties for EmployeeID: CSS Class - OraDataText. 20.Set the properties for FirstName: CSS Class - OraDataText. 21.Set the properties for LastName: CSS Class - OraDataText 22.Set the properties for EmailAddress: CSS Class - OraLinkText.Destination URI - mailTo:@EmployeeEmail 23.Set the properties for Position: CSS Class - OraDataText. 24.Set the properties for Manager Name CSS Class - OraLinkText.Destination URI - mailTo:@EmployeeEmail 25.Set the properties for Salary: CSS Class - OraDataText. 26.Set the properties for StartDate: CSS Class - OraDataText. 27.Set the properties for End Date: CSS Class - OraDataText. 28.Select the MainRN defaultSingleColumn region and change its Region Style property tomessageComponentLayout. JDeveloper will display the following warning; select the Yes buttonto proceed. Your items will not be adversely affected. tab=Create a Return LinkAdd a "Return to Employee Search" link at the bottom of your page beneath the page contentbottom line (the ski). Select your PageLayoutRN in the Structure pane, right-click and select New > returnNavigation.Select the returnNavigation link item that JDeveloper creates for you beneath thepageComponents folder and set the following properties: ID - ReturnLinkDestination URI -OA.jsp?page=/chola/oracle/apps/fnd/employee/webui/EmpSearchPG&retainAM=YText - Return to Employee Search.

9 / 12

Page 10: Cholas Oaf Tutorialsr12 Part 5 Drill Down to Details

Chola's OAF Tutorials(R12) Part 5 - Drill Down to DetailsWednesday, 29 April 2009 15:43

Save your work. tab=Code slide=VO Code 29.Add an initQuery( ) Method to Your EmployeeFullVOImpl Class. Import Statements: import oracle.jbo.domain.Number;import oracle.apps.fnd.framework.OAException; Code: InitQuery Code 12345678910111213141516171819 public void initQuery (String employeeNumber )if ( ( employeeNumber != null ) &&( ! ( "" . equals ( employeeNumber. trim ( ) ) ) ) ) Number empNum = null ;tryempNum = new Number ( employeeNumber ) ;catch ( Exception e )throw new OAException ( "AK" , "FWK_TBX_INVALID_EMP_NUMBER") ;setWhereClause ( "EMPLOYEE_ID = :1" ) ;setWhereClauseParams( null ) ; // Always resetsetWhereClauseParam ( 0 , empNum ) ;executeQuery ( ) ; /slide slide=AM Code Add an initDetails( ) Method to Your EmployeeAMImpl Class Import Statement: import oracle.apps.fnd.framework.OAException;import oracle.apps.fnd.common.MessageToken; Code: InitDetails Code 1234567891011 public void initDetails (String employeeNumber )EmployeeFullVOImpl vo = ( EmployeeFullVOImpl ) getEmployeeFullVO1 ( ) ;if ( vo == null )MessageToken [ ] errTokens = new MessageToken ( "OBJECT_NAME" , "EmployeeFullVO1" ) ;throw new OAException ( "AK" , "FWK_TBX_OBJECT_NOT_FOUND", errTokens ) ;vo. initQuery ( employeeNumber ) ; /slide tab=Drill Down To achieve drill down,select the EmpName item in the ResultsTable region and set theDestination URI property to: 12 OA. jsp ? page =/ chola / oracle / apps / fnd / employee / webui / EmpDetailsPG& employeeNumber = @EmployeeId & employeeName = @EmployeeName & retainAM = Y & addBreadCrumb = Y slide=Controller Select the PageLayoutRN of the EmpDetailsPG in the Structure pane, right-click and select SetNew Controller ... from the context menu. In the New Controller dialog, set the Package Name to chola.oracle.apps.fnd.employee.webuiand the Class Name to EmployeeDetailsCO.

Select OK to create your controller. Code : Process Request Code 123456789101112 public void processRequest ( OAPageContext pageContext, OAWebBean webBean)// Always call this first.super . processRequest ( pageContext, webBean ) ;// Get the employeeNumber parameter from the URLString employeeNumber = pageContext. getParameter ( "employeeNumber" ) ;// Now we want to initialize the query for our single employee// with all of its details.OAApplicationModule am = pageContext. getApplicationModule ( webBean ) ;Serializable [ ] parameters = employeeNumber ;am. invokeMethod ( "initDetails" , parameters ) ; /slide tab=Save and Run your page Save your work and Run the page.

10 / 12

Page 11: Cholas Oaf Tutorialsr12 Part 5 Drill Down to Details

Chola's OAF Tutorials(R12) Part 5 - Drill Down to DetailsWednesday, 29 April 2009 15:43

11 / 12

Page 12: Cholas Oaf Tutorialsr12 Part 5 Drill Down to Details

Chola's OAF Tutorials(R12) Part 5 - Drill Down to DetailsWednesday, 29 April 2009 15:43

/tabs

12 / 12