Part 4: Using the Thematic Map Component
In this section you add a new view object to the existing Business Components and use this new data control to create a thematic map that reflects the most popular products in each state.
show more or lessRead more...

A thematic map represents business data as patterns in stylized areas or associated markers and does not require a connection to a remote Oracle MapViewer service. Thematic maps focus on data without the geographic details in a geographic map.

Step 1: Add a New View Object and Expose it

For this new graphical component you need to create the appropriate databound component. To create the View Object and add it as data control, perform the following steps:

  1. Expand the Model node in the Application Navigator.

    The Application Navigator
  2. Right-click the Application Sources node and select New from context..

    Context menu from the Application Navigator
  3. In the New Gallery, select the Business Tier | ADF Business Components category, and the View Object item.

    The New Gallery

    Click OK.

  4. In the Create View Object dialog, enter ProductPopularity as the name and select SQL Query as Data Source.

    The Create View Object dialog

    Click Next.

  5. In the Create View Object dialog, in the Query pane, enter the following SQL statement for the view object:


    The SQL code in the Query pane
    Using the Order By field. Show more or lessRead more...

    You can specify the ORDER BY criteria within the Select text as well as using the ORDER BY field.

    The above query counts items that are the most frequently present in customer's orders.
  6. Click the Test and Explain button to verify the SQL Statement.

    Result of the Test Query

    Click Close.

  7. Click Next up to the Application Module (Step 8 of 9).

    Check the Add to Application Module option. It should default to FODModule application module name.

    Application Module step in the Create View Object

    Click Finish.

  8. The new view object appears in the Application Navigator.

    The Application Navigator

  9. Click the Save All Save All icon icon to save your work.

  10. Right-click the FODModule and select Run from context .

    Run option from Application Navigator

    Running the Application Module allows you to validate the new View Object and see what the expected results can be.
  11. In the Business Component Browser, double-click ProductPopularity1 to open it in the Running pane.

    The BC Browser

    Click the Next icon The next icon to scroll through records, then close your browser window.

  12. Open the Data Controls accordion and click Refresh.

    Refresh option in Data Controls

    This refresh action is not always necessary but it will ensure that the new Business Components added to an Application Module appears in the Data Controls pane.
  13. The new Data Control is now ready for use.

    Data Controls pane

Step 2: Create the Product Popularity page tab
Now that the model component is available as a databound component, you can use it to create a new rendering as a Thematic Map.
  1. Click the OrdersAndStocks.jsf tab to open the page in the design editor.

    OrdersAndStocks tab
  2. Right-click within the OrdersPlanning tab and select Insert after Show Detail Item --> Show Detail Item.

    Context menu from tab selection
  3. In the Property Inspector, for the Show Detail Item, change the text to Product Popularity.

    The Property Inspector
  4. From the Data Controls accordion, select ProductPopularity1, then drag and drop it onto the Product Popularity page. From context, select Thematic Map.

    Dropping a Data Control onto the page
  5. In the Component Gallery dialog, select the USA states image.

    The Component Gallery dialog

    Click OK.

  6. In the Create Data Layer dialog, select StateProvince from the Location dropdown list.

    The Create Data Layer dialog

    Click OK.

  7. The State map displays in the design editor with the thematic map popup.

    
The page rendering in the design editor
  8. In the Thematic map popup, expand the Area nodes and selecting the Area - a1 one, click the Edit icon Edit icon to open it.

    Thematic map popup
  9. In the Configure Area dialog, select the Attribute Groups tab and click the New icon to create a grouping rule.

    The Configure Area dialog
  10. From the dropdown lists, select ProductPopularityIndex for the Group by value attribute and for the Legend Label attribute.

    The Configure Area dialog

    Click OK.

  11. The page should look like the following:

    The page rendering in the design editor
  12. Click the Save All icon Save All icon to save your work and click the Run button Run icon to launch the page in your browser.

  13. In the Browser window, click the Product Popularity tab.

    Product Popularity tab in the browser
  14. The state maps displays product popularity with the color legend on the top right corner indicating the number of times a product was specified in orders independently of the quantity ordered.

    Product Popularity page in the browser
  15. You can hide the legend too.

    Hiding the legend
  16. Try the Navigation toolbar by opening the toolbar in the upper left corner, allowing you to move, rotate or zoom in and out within the map.

    Navigation Toolbar
  17. Click the Fit Map icon to return to the general view.

    Product Popularity tab in the browser
  18. Close your browser window now.

You've successfully completed this tutorial.

Summary
In this tutorial you discovered how to use DVT components in a Web Application. You learned how to: To learn more about ADF Faces and DVT components, refer to:

Bookmark Print Expand all | Hide all
Back to top

Did you find this page helpful?



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