Part 3: Enhancing the User Interface

Web applications usually have more than one page in them. In this part of the tutorial you add another page - a Search page - to your application and use the ADF Task Flow Diagrammer to define the navigation rules between the two pages. You then use features of the ADF Faces Framework to add extra functionality to the pages. Finally you create a reusable page fragment and add it to the DeptEmpPage page.

This is the Search page for the application. Notice the list of values for the JobId and the relationship between the Salary and Annual Salary fields. In this section you'll see how to coordinate the salary values and to add a auto suggest behavior to the jobId.

screenshot of Search page.



Step 1: Create a Page Flow
  1. In the Applications window locate the adfc-config file under the Page Flows node in the ViewController project. Double-click it to open it in the editor. This is where you are going to define the application's navigation.

    App navigator with adfc-config selected.
  2. Drag the DeptEmpPage.jsf file from the Applications window into the empty adfc-config diagram.

    App Navigator on left of screenshot with DeptEmpPage selected and on right, DeptEmpPage displayed in task flow diagram.
  3. From the Components window drag and drop a View activity into the adfc-config diagram, and rename it query. This represents the new JSF page that you are about to create.

    Task flow diagram showing two views, DeptEmpPage and Query.
  4. From the Components window click Control Flow Case and then click DeptEmpPage,and next click the query page.

    Task flow diagram with two views as before and control flow case line joining the two.

    Name this line goQuery.

    Screenshot as before with the name goQuery displayed on the control flow case line.
  5. From the Components window choose another Control Flow Case and then create an opposite flow from the query page to the DeptEmpPage. Name this flow back.

    As for last step but with a second control flow case displaying label back.
  6. Double-click the query activity in the diagram to create the new page. In the Create JSF Page dialog accept the default Facelets radio button, and click the Quick Start Layout radio button.

    Select the default One Column category, type and layout, then click OK.

    Create JSF Page dialog for the query page with cursor over the Browse button.
  7. To add the employees search functionality to the page, open the Data Controls accordion, and locate EmpDetails1. (If you do not see it click the Refresh button).

    Data Controls accordion with EmpDetails1 selected.

  8. Expand the EmpDetails1 data control and expand the Named Criteria node below it. Select All Queriable Attributes and drag it into the new query.jsf page. Create it as a Query > ADF Query Panel.

    App Navigator with All Queriable Attributes selected in Data Controls accordion. On right, empty page with Query>ADF Query Panel selected in Create box.
  9. In the Data Controls accordion select the EmpDetails1 data control and drag it into the center area of the page below the query component. Create it as an ADF Form...

    App Navigator with EmpDetails1 selected in Data Controls accordion. On right, Employees page with Search panel, and below it the Create box with Form>ADF Form selected.

    In the Edit Forms Details, check both the Row Navigation and the Submit Button checkboxes. Click OK.

    Edit Form Fields dialog with Navigation and Submit checkboxes checked and cursor over OK button.
  10. With the panelFormLayout still selected, use the Properties window to set the Rows property to 5.

    Also, set the Short Desc property to salary graph

    Search page with panelFormLayout selected and on right, Rows property in PI with value 5 highlighted.
  11. In the Structure window locate the Submit button, right-click it and choose Insert After Button > Button.

    Structure window showing context menu with Insert after af:commandButton - Submit > Button menu selected.
  12. In the Properties window change the Text of the new button to Back and for the Action property select back from the drop down list. This causes the button to perform the navigation you defined in the page flow diagram.

    PI showing Button properties with Action property dropdown and back selected.
  13. Next you add transaction operations to the page to allow you to commit and rollback changes. In the Data Controls Palette expand the application module level Operations node to locate the commit and rollback operations. Drag the Commit operation into the Structure window before the First Button. When prompted for a drop target choose ADF Button.

    Data Controls accordion with Commit operation selected; below it the Structure window with cursor pointing above the First command button


    Create box with ADF Button selected.
  14. Repeat the same steps for the Rollback operation.

    Data Controls accordion with Rollback operation selected; below it the Structure window with cursor pointing above the First command button
  15. In the Properties window, for the Rollback and for the Commit buttons, reset the Disabled property to default to make both buttons always selectable.

    Move the mouse over then end of the property field and you'll see a light blue gear appear. Click it to perform this operation.

    PI with drop down list for Disabled property and Reset to Default option selected.

    PI with drop down list for Disabled property and Reset to Default option selected.
  16. Double-click the Query.jsf tab to maximize the page in the Design Editor. Your page should look as follows:

    Screenshot of Query page.
  17. Double-click the query.jsf tab again to return it to normal size.

  18. Click the DeptEmpPage.jsf tab to switch back to the page. A quick way to navigate to this or any other file is by using the global find box at the top right of JDeveloper and typing the file name there.

    Dept in Search box at top right of page: window displays results of search operation - DeptEmpPage selected.

    Then just click the file name to open it in the editor.

  19. In the page design, expand the Departments accordion. From the Components window, choose a Button component and drag it into the Departments accordion between the First and Previous buttons. Alternatively you can right-click the First button and choose insert after > button to add the new button.

    Component Palette with Button component selected and cursor dragging it to Departments page (on left).
  20. Using the Properties window change the Text of the button to Query and for the Action property type goQuery or select it from the drop down list if available. This causes the button to perform the navigation you defined in the page flow diagram.

    PI with Query in Text property anddrop down list to right of Action property with goQuery option selected.
  21. Click the Save All SaveAll icon on JDev main toolbar. icon on the JDeveloper menu bar to save your work, and then right-click the DeptEmpPage.jsf page and choose Run.

    App navigator withDeptEmpPage selected and Run selected in context menu.
  22. When the page displays in your browser click the Query button to navigate to the new page. In the Search page click Advanced to display detailed search criteria.

    Runtime view of page in browser; cursor is over the Advanced button.
  23. In the FirstName field accept the default Starts with, and type the letter G.
    Press Search.The form below displays the record for Guy Himuro.

    As above with G in FirstName search field, and cursor over Search button.
  24. Experiment with the form, saving your search criteria, creating more complex queries and updating data for employees. Note how this form displays a view of the data that matches the definition in the view object you created - including information for Department name as well as a list of values for the Job id and the employee's annual salary.
    You can also make changes to the data and commit and rollback your transactions as needed.

    When you are finished close the browser window.

Step 2: Use Partial Page Refresh

In the next steps you become acquainted with some of the features of the ADF Faces Framework. You enhance your pages with additional Ajax functionality leveraging the declarative development features offered by ADF Faces components.

    In the next few steps you use the partial page refresh capability offered by ADF Faces. You want to make sure that if the Salary field is updated, that the Annual Salary is recalculated. In addition, you don't want the entire page to refresh but rather just the affected fields. You will use an ADF Faces feature called Partial Page Rendering or PPR to accomplish that behavior.
  1. Open the query.jsf file in the Design Editor, if it is not already open. Select the Salary field. In the Properties window set the value of the Id property to sal.

    Query page with Salary field selected; PI to the right with Id property set to sal.
  2. Still in the Properties window expand the Behavior node and set the AutoSubmit property to True.

    As previous image but showing AutoSubmit property set to true.
  3. Either in the Design Editor or the Structure window locate the AnnualSalary field. Locate the PartialTriggers property under the Behavior section and click the gear icon to its right to choose Edit.

    Structure window with AnnualSalary field selected; PI to the right and with PartialTriggers property dropdown with Edit option selected.
  4. In the Edit Property dialog locate the Salary field and shuttle it to the right using the blue arrow. Click OK.

    Edit Property: Partial Triggers dialog - inputText -sal selected and cursor over arrow pointing to the right.
  5. Click the Save All SaveAll icon on JDev main toolbar. icon on the JDeveloper menu bar to save your work, and Run DeptEmpPage.jsf.

    App Navigator with DeptEmpPage selected andand cursor on Run in context menu.
  6. When the page displays, click the Query button in the Departments panel.

    Run time view of Departments page with cursor over the Query button.
  7. In the Search page search for employees whose first name begins with A%.

    Search page with A% in FirstName field and cursor on Search field.

    Note the salary and annual salary values.

    Search page showing record for Alexander Khoo.
  8. Update the Salary field and then tab out of it. Notice the immediate change to the AnnualSalary field once you leave the Salary field. However this is the only field that is refreshed (not the whole page).

    Alexander Khoo's record with salary updated - and AnnualSalary also updated as cursor has moved out of Salary field.
  9. Close the browser.

Step 3: Use the ADF Auto Suggest Behavior
The af:autoSuggestBehavior component displays a drop down list of suggested items when the user types into an input component. To use the auto-suggest functionality in a declarative way you need a model-driven list of values on your model project, which will be the base for the suggestedItems list. Earlier you added a list of values to the JobId field so in this example you use that field.

  1. In the query page, select the JobId field.

    Query page with JobId field selected.
  2. In the Components window expand the Operations node, and locate Auto Suggest Behavior in the Behavior section. Drag and drop the Auto Suggest Behavior operation onto the JobId field.

    As previous image but with Comp Palette displayed to the right and Auto Suggest Behavior operation selected and cursor showing dropping onto JobId field.
  3. Select the af:autoSuggestBehavior component in the Structure window. In the Properties window, set the SuggestedItems property to #{bindings.JobId.suggestedItems}. You can enter the value or use the Method Expression Builder by clicking the gear icon next to the property.

    Insert Auto Suggest Behavior dialog with bindings String highlighted in Suggested Items field.
  4. Save your work and then Run the query page.

    App Navigator with query page selected and Run higlighted in context menu.
  5. Type 121 in the EmployeeId field, and click the Search button. In the record for Adam Fripp update the JobId field by typing 's' in it. A number of jobs beginning with 's' are suggested.

    Search page with 121 in EmployeeId field and record for Adam Fripp displayed in results fields. JobId field contains letter 's' and displays list of jobs beginning with letter 's'.
  6. Add 'a' after the 's' and see the list of suggestions modified accordingly.

    As previous image but with letter 'a' after the 's' in JobId field. List shows 3 entries all starting 'sa'.
  7. Choose Sales Representative from the remaining options, to populate the field.

    As previous image but with 'Sales Representative' selected.
  8. Close the browser without saving the change.

Step 4: Use Drop Down Menus and Operation Components

In this step you add a drop down menu to a page and use a couple of ADF Faces operation components to add Javascript-based operations to the page. On component will export table data into an Excel spreadsheet and the other will create a printable page.

  1. In the DeptEmpPage.jsf file click inside the menus facet in the panel collection surrounding the Employees table. Right-click and from the context menu choose Insert Inside Facet menus > Menu.

    menus facet at top of DeptEmpPage selected and Insert inside Facet selected in context menu.
  2. In the Properties window set the Text property to My Options.

    PI showing Test property of menu set to 'My Options'.
  3. In the Properties window expand the Behavior node and set the Detachable property to true.

    PI for menu with Detachable property set to 'true'.
  4. In the Structure window right-click the menu component and choose Insert inside af:menu - My Options > Menu Item.

    Structure window with menu selected and Insert Inside af:menu My Options >Menu item selected in context menu.
  5. In the Properties window set the Text property of the new menu item to Export to Excel.

    PI for menu item with Text property set to Export to Excel.
  6. With the new Export to Excel menu item still selected in the Structure window, expand the Listeners section of the Operations node of the the ADF Faces components in the Components window.
    Locate the Export Collection Action Listener component and drag it onto the Export to Excel menu option in the Structure window.

    Structure window and PI side by side with Export CollectionAction Listener in process of being dragged onto menu item Export to Excel.
  7. In the Insert Export Collection Action Listener dialog click the gear icon next to ExportedId field and choose Edit.

    Insert Export Collection Action Listener dialog with drop down menu and Edit option selected.
  8. In the Edit Property dialog navigate through the page structure to locate the table - t1 component and select it. Click OK.

    Edit Property:ExportedId dialog with table selected and cursor over OK.
  9. From the Type drop down list select excelHTML and click OK.

    Insert Export Collection Action Listener dialog with excelHTML highlighted in Type field, and cursor over OK.
  10. Add another menu option to the menu. In the Structure window right-click the Export to Excel menu component and from the context menu choose Insert After Menu Item > Menu Item.

    Structure window with menu item selected and Insert after af:commandMenuItem - Export to Excel > Menu Item selected in context.
  11. Set the Text property of this new menu option to Printable Page.

    PI for menu item with Printable Page highlighted in Text field.
  12. In the Behavior section under the Operations node of the Components window select the Show Printable Page Behavior operation to add it to the new menu item. Drag and drop it onto the new menu option you created.

    Structure window and Comp Palette side by side with Show Printable Page Behavior operation being dragged onto the Printable Page menu item.
  13. Click the Save All SaveAll icon on JDev main toolbar. icon on the JDeveloper menu bar to save your work, and then choose Run.

  14. When the page displays click the new menu and detach it.

    Click the 'x' to close the menu.

    Run time view of DeptEmpPage withcursor moving My Options menu to new location on the page.
  15. Then invoke each one of the menu options you created, for example Export to Excel.

    My Options menu with Export to Excel menu option selected

    You may need to accept the download of the file in the browser window to be able to access the Excel file, and it should be found in your default 'download'. directory..

    Screebshot tof DeptEmpPage with Internet Explorer message along the top of pageand Download File option selected from menu options.
  16. Try the Printable Page menu option.

    My Options menu with printable Page menu option selected.

    The page is ready for printing.

    Screenshot of the Print view of the page.

    Close the browser window.

Step 5: Add CRUD Operation Components to your Page
The next few tasks examine some of the data operations that JDeveloper makes available to view objects. You see how to add a Delete operation and a CreateInsert operation. When the user clicks the CreateInsert button to insert the new row you want the table to refresh to display the new empty row. To do this you again use the Partial Page Refresh feature that was covered in Step 2 of this part of the tutorial.The view object uses a bind variable to pass the employee's email into the query.
  1. Click the query.jsf tab to return to the Query page, opening the Structure window. In the Data Controls accordion expand the EmpDetails1 node and then the Operations node below it. Select the CreateInsert operation.

    Data Controls accordion with EmpDetails1 node expanded and Operations node expanded. CreateInsert Operation is selected
  2. Drag the CreateInsert operation in the Structure window onto the af:panelGroupLayout - horizontal in the footer facet of the employees form. Create it as an ADF Button. Hint: expand af:panelFormlayout -5 > Panel Form Layout Facets > af:panelGroupLayout - vertical > af:panelGroupLayout - horizontal.

    Data Controls accordion with Structure window below. CreateInsert operation has been dragged to panelGroupLayout in footer facet of the Query page. Create menu displays with ADF Button option selected.
  3. In the Properties window set the Id property for the button to CreateInsert.

    PI for ADF Button with Id property set to CreateInsert.
  4. Still in the Properties window expand the Behavior node and in the PartialTriggers property choose Edit from the drop down list.

    PI for ADF Button with dropdown box for PartialTriggers property. Edit option selected.
  5. In the Edit window scroll through the page's components until you find the CreateInsert button. Shuttle it into the Selected pane.

    Edit Property: PartialTriggers dialog showing CreateInsert command button selected and cursor on arrow to shuttle it over to the Selected pane.

    Click OK. This action defines the CreateInsert component as the trigger that will cause the table to refresh.

  6. In the same way add a Delete operation by dropping the Delete operation from EmpDetails1 onto the panelGroupLayout in the page footer. As before, create it as an ADF button.

    Data Controls accordion with EmpDetails1 node and Operations node expanded and Delete operation selected.
  7. The two new buttons display at the bottom of the query page.

    Design time view of Query page with the two new buttons at bottom right.
  8. Save your work and then Run the Query page.

  9. When the page displays type F% in the LastName field and click the Search button. The first F% employee record displays.

    Run time view of Query page with F% in LastName field and cursor over Search button and Pat Fay's employee record displayed.
  10. Click the CreateInsert button. The page refreshes and the fields are cleared (except for the HireDate field, which you set to default to the current date) so that a new record can be inserted.

    Run time view of Query page with F% in LastName field as before. Cursor over CreateInsert button and Pat fay record has been refreshed to show empty fields allowing for new record to be inserted.
  11. Close the browser without committing.

Step 6: Create a Query-only Business Service Based on Parameters
In this step you create a view object that allows end users to search for an employee's name based on their email address. The view object uses a bind variable to pass the employee's email into the query.
  1. In the Applications window locate the demo.model package and right-click it to choose New View Object....

    App Navigator with demo.model package selected and New View Object selected in context menu.
  2. In the Create View Object wizard set the Name property to EmpByEmail and choose the SQL Query radio button as the data source. Click Next.

    CreateView Object wizard Step 1. EmpByEmail hightlighted in Name field. Cursor on Next button.
  3. In Step 2 of the Create View Object wizard type the following query:

    select first_name, last_name from employees where email = :p_email

    The ':' before p_email means that it is a variable that will be passed to the query.

    Click the Test and Explain button to verify your query.

    Screenshot of part of Step 2 of wizard showing Select statement and results box from testing the statement. 'Query executed successfully' reported in Result box.

    Click Close and then click Next.

  4. In Step 3 of the Create View Object wizard, click the New button to define a new bind variable. Set the Name property to p_email.

    Step 3 of the wizard with p_email bind variable highlighted in the Variable Name box. Literal radio button is selected and Updatable checkbox checked.

    Click the Control Hints tab and set the Label Text to Email.

    Step 3 of wizard as before but with Control Hints tab selected. Email highlighted in Label Text field.
  5. Click Next a few more times to accept all the defaults, until you get to step 8 of the wizard.

    Do NOT specify a Key Attribute, when prompted.

    Here check the Add to Application Module check box to include your new view in the data model.
    Click the Finish button.

    Step 8 of the wizard with Add to Application Module checkbox checked.
  6. Save your work and then run the Business Component Browser to test the new view. Double-click the new EmpByEmail1 view and when prompted to insert a value for the variable enter SKING and press OK to get the results for this email address. (To run the Business Components Tester, right-click the application module and select Run)

    Bus Comp Browser with EmpByEmail selected; Bind Variables popup window with SKING highlighted in Value field and cursor on OK button.


    Bus Comp browser showing results of pressing OK in previous image: FirstName and LastName fileds have values displayed for the email value entered previously.
  7. Notice that the Business Components Browser shows only King.

  8. Close the Business Component Browser.

Step 7: Create a Reusable Page Fragment

In this step you create a reusable page fragment. You then embed the view object you created in the last step into the page fragment, and finally you use the page fragment in the DeptEmpPage page

  1. First create a new task flow specifically for this page. In the Applications Navigator right-click the ViewController project and choose New > From Gallery.

    App navigator with ViewController project selected and New menu option selected in context menu.
  2. In the Web Tier > JSF/Facelets category choose ADF Task Flow.

    New Gallery with JSF/Facelets selected in Categories pane (on left) and ADF Task Flow selected in Items pane (on right).

    Click OK.

  3. In the Create Task Flow dialog set the File Name property to search-email-flow.xml.
    Verify that the Create As Bounded Task Flow and Create with Page Fragments checkboxes are both checked.

    Create Task Flow dialog with search-email-flow.xml highlighted in File Name box, Create as Bounded Task Flow and Create with Page Fragments checkboxes are both checked.

    Click OK.

  4. In the Design Editor drag a View component from the Components window onto the empty diagram and name it searchEmail. You only use a single page in this flow, but you can have bounded task flows with multiple pages and still include them in other JSF pages.

    Task flow diagram withone view - name,searchEmail highlighted.
  5. Double-click the new searchEmail view component to create the page fragment for it.
    Accept all the defaults in the dialog that displays and make sure the file name is searchEmail.jsff. This creates the page as a page fragment that can be included in other JSF pages. Click OK.

    Create ADF Page Fragment dialog with File Name searchEmail.jsff highlighted and cursor over OK button.
  6. An empty page displays in the Design Editor. Expand the Data Controls accordion and, if necessary, click the Refresh button to ensure that the new EmpByEmail1 data control appears in the list.

    Data Controls accordion with EmpByEmail1 node selected.
  7. Expand the new EmpByEmail1 view and the Operations node beneath it. Select the ExecuteWithParams operation. You are going to use this operation to execute the query for this view passing it the necessary parameter.

    As previous image but EmpByEmail node is expanded and Operations sub-node is also expanded. ExecuteWithParams operation selected.

  8. Drag the ExecuteWithParams operation to your new page, and create it as an ADF Parameter Form.

    App Navigaotr with ExecuteWithParams operation selected in Data Controls accordion and cursor in searchemail page fragment, displaying the Create box and cursor over ADF Parameter Form.
  9. In the Edit Form Fields dialog change the display label for the p_email value from default to Email. Click OK.

    Edit Form Fields dialog with the p_email field selected and Display Label field changed to Email.
  10. In the Design Editor for the page, click the ExecuteWithParams button and use the Properties window to change the Text property to Find Details.

    searchEmail.jsff open in design Editor with ExecuteWithParams button selected. PI shows properties with Text property set to Find Details.
  11. From the Data Controls accordion, drag the EmpByEmail1 collection onto the page beneath the button. Create it as a Form > ADF Form....

    App Navigator with EmpByEmail selected in Data Controls accordion. Design Editor shows the view being dropped onto the page fragment as an ADF Read-only Form.
  12. Select Read-Only Form and accept the remaining defaults presented in the Edit Form Fields dialog. Then click OK.
    Save
    your work.

    Edit Form Fields dialog with cursor over OK button to accept the default values.

    The page should look like this:

    Design time view of the page fragment.
  13. The new bounded task flow now contains a page fragment; next you include the complete bounded task flow inside another JSF page.
    In the Applications window locate the DeptEmpPage.jsf file and open it in the Design Editor, if it is not already open. From the Components window Layout section drag and drop a Separator component into the left accordion in the DeptEmpPage.jsf page beneath the Departments form.

    Component Palette with Separator selected and cursor dropping the component onto the Departments page.
  14. Add the new flow you created as a region to the existing page.
    From the Applications window drag and drop search-email-flow.xml into the left accordion in the DeptEmpPage.jsf page beneath the new separator. Create it as a Region.

    App Navigator with search-email-flow selected and cursor positioned on Departments page to drop the flow as a region.
  15. Your page should now look like the screen shot below.

    Design time view of the finished page.
  16. Save your work and then Run the updated DeptEmpPage.jsf page.
    When the page displays in your browser test the new functionality by entering an email value (SKING) in the Email field and pressing the Find Details button.

    Run time view of the Departments page with SKING in the Email field and cursor over the Find Details button.
  17. The employee name information is returned.

    Run time image as before with the FirstName and LastName dispalyed as per the email submitted.
  18. Close the browser when you are done.

Step 8: Launching Pages with a Panel Springboard

In this step you use a panel springboard as a launch pad fro your pages. Once you've created your pages and task flows, you can hook them together using a panelSpringboard component. All pages must be packaged in bounded task flows as page fragments and added as regions. Each page or task flow can have an icon associated with it and you can determine the behavior of the items, once one is selected.

  1. In preparation for the next set of steps, include some icons into your application. Right click on each of the following 3 images and save the the icons to your application's.../public_html directory.

    App navigator with ViewController project selected and New menu option selected in context menu. App navigator with ViewController project selected and New menu option selected in context menu. App navigator with ViewController project selected and New menu option selected in context menu.


    App navigator with ViewController project selected and New menu option selected in context menu.

  2. Then back in JDeveloper, select the ViewController project and click the refresh icon. In the drop down menu, select Refresh ViewController.jpr.

    App navigator with ViewController project selected and New menu option selected in context menu.

    The Applications navigator will now display the included images.

    App navigator with ViewController project selected and New menu option selected in context menu.

  3. Now we are ready to create the components for the springboard.

    The first thing we need to do is create a couple of pages and place them on bounded task flows as page fragments. There are a few different ways to do this, we'll show you one.

  4. Right click the View Controller project and in the context menu select, New > Page...

    App navigator with ViewController project selected and New menu option selected in context menu.
  5. Name it Departments.jsf and create it using a blank page.

    App navigator with ViewController project selected and New menu option selected in context menu.
  6. From the Data Controls palette, expand the AppModuleDataControl and drag and drop the DepartmentsView1 onto the page.
    In the popup menu, select Table/List View - ADF Table...

    App navigator with ViewController project selected and New menu option selected in context menu.
  7. In the Create Table dialog, click OK to accept all the fields.

    App navigator with ViewController project selected and New menu option selected in context menu.
  8. The resulting page should look like the image below. Save your work.

    App navigator with ViewController project selected and New menu option selected in context menu.
  9. Select the ViewController project, and from the context menu select New - ADF Task Flow...

    App navigator with ViewController project selected and New menu option selected in context menu.
  10. Name it depts-task-flow-definition.xml and deselect the Create with Page Fragments checkbox. Click OK to create the task flow.

    App navigator with ViewController project selected and New menu option selected in context menu.
  11. From the Applications navigator, drag the Departments.jsf page onto the task flow and drop it.

    App navigator with ViewController project selected and New menu option selected in context menu.

    The resulting page is now part of the bounded task flow. .

    App navigator with ViewController project selected and New menu option selected in context menu.
  12. Next, right click the task flow and select Convert To Task Flow With Page Fragments...

    Later on we'll create a page containing the panel springboard component. We can then add this task flow as a region on the springboard.


    App navigator with ViewController project selected and New menu option selected in context menu.

    In the popup, click OK to complete the conversion process.

    Save all your work.

  13. Now we'll do the same process for an employees page and task flow. Then we'll have two different components to add to the springboard.

  14. Right click the View Controller project and in the context menu select, New - Page...

    App navigator with ViewController project selected and New menu option selected in context menu.
  15. Name it Employees.jsf and create it using a blank page.

    App navigator with ViewController project selected and New menu option selected in context menu.
  16. From the Data Controls palette, expand the AppModuleDataControl and drag and drop the EmployeeView1 onto the page.
    In the popup menu, select ADF Form ...

    App navigator with ViewController project selected and New menu option selected in context menu.
  17. In the Create Form dialog, select the Read-Only Form checkbox and then delete the following fields.

    JobId, Salary, CommissionPct, ManagerId, and DepartmentId

    Then click OK.

    App navigator with ViewController project selected and New menu option selected in context menu.
  18. The resulting page should look like the image below.

    Save your work.

    App navigator with ViewController project selected and New menu option selected in context menu.
  19. Select the ViewController project, and from the context menu select New - ADF Task Flow...

    App navigator with ViewController project selected and New menu option selected in context menu.
  20. Name it emps-task-flow-definition.xml and deselect the Create with Page Fragments checkbox. Click OK to create the task flow.

    App navigator with ViewController project selected and New menu option selected in context menu.
  21. From the Applications navigator, drag the Employees.jsf page onto the task flow and drop it.

    App navigator with ViewController project selected and New menu option selected in context menu.

  22. Next, right-click inside the task flow and select Convert To Task Flow With Page Fragments...

    Remember, later on we'll create a page containing the panel springboard component. We can then add this task flow as a region on the springboard.

    App navigator with ViewController project selected and New menu option selected in context menu.
  23. In the popup, click OK to finish the process.

  24. Save your work.

  25. Create a page to contain the springboard. Create it in the ViewController project and name it springboard.jsf and select the Create Blank Page radio button. Then click OK.

    App navigator with ViewController project selected and New menu option selected in context menu.
  26. From the Components window, expand the Layout node and scroll to the Interactive Containers and Headers section. Then, select and drag and drop a Panel Springboard onto the page

    App navigator with ViewController project selected and New menu option selected in context menu.
  27. Select the panelSpringboard component and in the Properties window, set the Display Mode to grid.

    App navigator with ViewController project selected and New menu option selected in context menu.
  28. Inside the panelSpringboard component, right click and select Insert Inside Panel SpringBoard - Show Detail item

    App navigator with ViewController project selected and New menu option selected in context menu.

    Add another detail item to the springboard

    App navigator with ViewController project selected and New menu option selected in context menu.
  29. For each of the showDetailItems, use the Properties window to set the Text values.

    showDetailItem 1 = Show Departments
    showDetailItem 2 = Employees

    Save your work.

    App navigator with ViewController project selected and New menu option selected in context menu.
  30. For each showDetailItem, select and set the Icon property to the image names as follows..

    Show Departments = 36-toolbox.png
    Employee = 19-gear.jpg

    To set the property, move your cursor to the right side of the Icon property and click on the blue gear.

    App navigator with ViewController project selected and New menu option selected in context menu.

    Then click it, and select Edit.

  31. App navigator with ViewController project selected and New menu option selected in context menu.

    Select the appropriate image and click OK.

    App navigator with ViewController project selected and New menu option selected in context menu.

    When prompted to allow the image to be put in the 'resources' directory, click No.

    App navigator with ViewController project selected and New menu option selected in context menu.
  32. The next step is to determine and associate what page or task flow the springboard item will invoke. You can do this by dragging and and dropping a page or task flow onto the springboard detail item.

  33. Drag depts-task-flow-definition and drop it on the Show Departments detail item.

    When you release the mouse button, you're prompted for how you want the item created. In our case, create the item as a Region.

    App navigator with ViewController project selected and New menu option selected in context menu.
  34. Drag the emps-task-flow-definition to the Employees detailItem and create it as a Region.


  35. Save your work.

    App navigator with ViewController project selected and New menu option selected in context menu.
  36. Finally, right click in the springboard.jsf page and select Run.

    App navigator with ViewController project selected and New menu option selected in context menu.
  37. Click on each of the icons to see the see how the Springboard allows you to launch individual task flows.

    App navigator with ViewController project selected and New menu option selected in context menu.

    When one item is selected the icons move to the top of the browser, and the page details appear below.

    App navigator with ViewController project selected and New menu option selected in context menu.

    Click another icon and the page switches.


    App navigator with ViewController project selected and New menu option selected in context menu.

  38. Close your browser and exit JDeveloper.

Summary
In this tutorial you built a small Web application that interacts with a database. You learned how to: To learn more about building rich Web applications, refer to:

Bookmark Print Expand all | Hide all
Back to top

Did you find this page helpful?



Copyright © 2013, Oracle and/or its affiliates. All rights reserved.