Oracle ADF

926
Oracle® Fusion Middleware Web User Interface Developer's Guide for Oracle Application Development Framework 11g Release 1 (11.1.1) B31973-05 April 2010

Transcript of Oracle ADF

Oracle Fusion MiddlewareWeb User Interface Developer's Guide for Oracle Application Development Framework 11g Release 1 (11.1.1)B31973-05

April 2010

Oracle Fusion Middleware Web User Interface Developer's Guide for Oracle Application Development Framework, 11g Release 1 (11.1.1) B31973-05 Copyright 2010, Oracle and/or its affiliates. All rights reserved. Primary Authors: Robin Whitmore (lead), Peter Jew, Kathryn Munn, Walter Egan, Himanshu Marathe Poh Lee Tan and Odile Sullivan-Tarazi

Contributing Author: Contributors:

ADF Faces development team, Frank Nimphius, Laura Akel, Katia Obradovic-Sarkic

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065. This software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. This software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.

ContentsPreface ............................................................................................................................................................. xxvAudience................................................................................................................................................... Documentation Accessibility ................................................................................................................. Related Documents ................................................................................................................................. Conventions ............................................................................................................................................. xxv xxv xxvi xxvi

What's New ................................................................................................................................................... xxviiDocumentation Changes for Release 11.1.1.3.0.................................................................................. xxvii

Part I 1

Getting Started with ADF Faces

Introduction to ADF Faces Rich Client1.1 1.1.1 1.1.2 1.2 1.2.1 1.2.1.1 1.2.1.2 1.2.2 1.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 Introduction to Oracle ADF Faces Rich Client ....................................................................... 1-1 History of ADF Faces .......................................................................................................... 1-1 ADF Faces as Rich Client Components ............................................................................ 1-2 Architecture of ADF Faces Components ................................................................................. 1-3 Client-Side Architecture ..................................................................................................... 1-3 Client-Side Components.............................................................................................. 1-4 JavaScript Library Partitioning................................................................................... 1-4 ADF Faces Architectural Features..................................................................................... 1-5 ADF Faces Components............................................................................................................. 1-6 ADF Faces Demonstration Application................................................................................... 1-8 How to Download and Install the ADF Faces Demo Application ............................... 1-8 Using the ADF Faces Demo Application ......................................................................... 1-8 Overview of the File Explorer Application................................................................... 1-15 Viewing the Source Code In JDeveloper ....................................................................... 1-17

2

Getting Started with ADF Faces2.1 2.2 2.2.1 Developing Declaratively in JDeveloper ................................................................................. 2-1 Creating an Application Workspace ........................................................................................ 2-2 How to Create an Application Workspace ...................................................................... 2-2iii

2.2.2 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5 2.5.1 2.5.2 2.6 2.6.1 2.6.2 2.7

What Happens When You Create an Application Workspace ..................................... 2-3 Defining Page Flows................................................................................................................... 2-4 How to Define a Page Flow................................................................................................ 2-5 What Happens When You Use the Diagrammer to Create a Page Flow .................... 2-6 Creating a View Page ................................................................................................................. 2-7 How to Create JSF JSP Pages.............................................................................................. 2-9 What Happens When You Create a JSF JSP Page ........................................................ 2-10 What You May Need to Know About Automatic Component Binding .................. 2-14 How to Create a Facelets XHTML Page ........................................................................ 2-17 What Happens When You Create a JSF XHTML Page ............................................... 2-18 How to Add ADF Faces Components to JSF Pages..................................................... 2-21 What Happens When You Add Components to a Page ............................................. 2-23 How to Set Component Attributes................................................................................. 2-24 What Happens When You Use the Property Inspector .............................................. 2-26 Creating EL Expressions ......................................................................................................... 2-26 How to Create an EL Expression.................................................................................... 2-27 How to Use EL Expressions Within Managed Beans.................................................. 2-28 Creating and Using Managed Beans..................................................................................... 2-29 How to Create a Managed Bean in JDeveloper............................................................ 2-30 What Happens When You Use JDeveloper to Create a Managed Bean................... 2-31 Viewing ADF Faces Source Code and Javadoc ................................................................... 2-31

Part II 3

Understanding ADF Faces Architecture

Using ADF Faces Architecture3.1 3.2 3.3 3.3.1 3.3.2 3.3.3 3.4 3.5 3.5.1 3.6 3.6.1 3.6.2 3.6.3 3.7 3.7.1 3.7.2 3.8 3.8.1 3.8.2 Introduction to Using ADF Faces Architecture ...................................................................... 3-1 Listening for Client Events ........................................................................................................ 3-3 Adding JavaScript to a Page...................................................................................................... 3-4 How to Use Inline JavaScript ............................................................................................. 3-4 How to Import JavaScript Libraries .................................................................................. 3-5 What You May Need to Know About Accessing Client Event Sources ...................... 3-5 Instantiating Client-Side Components..................................................................................... 3-6 Locating a Client Component on a Page ................................................................................. 3-7 What You May Need to Know About Finding Components in Naming Containers ....... 3-7 Accessing Component Properties on the Client..................................................................... 3-9 How to Set Property Values on the Client .................................................................... 3-13 How to Unsecure the disabled Property ....................................................................... 3-13 What Happens at Runtime: How Client Properties Are Set on the Client............... 3-14 Using Bonus Attributes for Client-Side Components ........................................................ 3-14 How to Create Bonus Attributes .................................................................................... 3-14 What You May Need to Know About Marshalling Bonus Attributes...................... 3-15 Understanding Rendering and Visibility ............................................................................. 3-15 How to Set Visibility Using JavaScript .......................................................................... 3-16 What You May Need to Know About Visible and the isShowing Function............ 3-17

iv

4 Using the JSF Lifecycle with ADF Faces4.1 4.2 4.3 4.3.1 4.3.2 4.4 4.5 4.6 4.7 4.7.1 4.7.2 4.7.3 Introduction to the JSF Lifecycle and ADF Faces ................................................................... 4-1 Using the Immediate Attribute ................................................................................................. 4-4 Using the Optimized Lifecycle.................................................................................................. 4-9 What You May Need to Know About Using the Immediate Attribute and the Optimized Lifecycle 4-10 What You May Need to Know About Using an LOV Component and the Optimized Lifecycle 4-11 Using the Client-Side Lifecycle .............................................................................................. 4-13 Using Subforms to Create Regions on a Page...................................................................... 4-14 Object Scope Lifecycles ........................................................................................................... 4-15 Passing Values Between Pages .............................................................................................. 4-16 How to Use the pageFlowScope Scope Within Java Code ......................................... 4-17 How to Use the pageFlowScope Scope Without Writing Java Code ........................ 4-18 What Happens at Runtime: Passing Values ................................................................. 4-18

5

Handling Events5.1 5.1.1 5.1.2 5.2 5.3 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.3.6 5.3.7 5.4 5.4.1 5.4.2 5.4.3 5.5 5.6 5.6.1 Introduction to Events and Event Handling........................................................................... 5-1 Events and Partial Page Rendering................................................................................... 5-2 Client-Side Event Model..................................................................................................... 5-3 Using ADF Faces Server Events................................................................................................ 5-3 Using JavaScript for ADF Faces Client Events ....................................................................... 5-5 How to Return the Original Source of the Event ............................................................ 5-9 How to Use Client-Side Attributes for an Event............................................................. 5-9 How to Block UI Input During Event Execution ......................................................... 5-10 How to Prevent Events from Propagating to the Server ............................................ 5-11 How to Trigger Event Handler Execution .................................................................... 5-11 What Happens at Runtime: How Client-Side Events Work ...................................... 5-12 What You May Need to Know About Using Naming Containers............................ 5-13 Sending Custom Events from the Client to the Server....................................................... 5-14 How to Send Custom Events from the Client to the Server ....................................... 5-15 What Happens at Runtime: How Client and Server Listeners Work Together ...... 5-16 What You May Need to Know About Marshalling and Unmarshalling Data ........ 5-16 Executing a Script Within an Event Response..................................................................... 5-18 Using Client Behavior Tags .................................................................................................... 5-20 How to Use the scrollComponentIntoViewBehavior Tag .......................................... 5-20

6 Validating and Converting Input6.1 6.2 6.3 6.3.1 6.3.2 6.3.3 6.4 6.4.1 Introduction to ADF Faces Converters and Validators......................................................... Conversion, Validation, and the JSF Lifecycle........................................................................ Adding Conversion .................................................................................................................... How to Add a Converter .................................................................................................... How to Set Attributes on a Converter .............................................................................. What Happens at Runtime ................................................................................................. Creating Custom JSF Converters .............................................................................................. How to Create a Custom JSF Converter........................................................................... 6-1 6-2 6-2 6-3 6-4 6-4 6-5 6-5

v

6.4.2 What Happens When You Use a Custom Converter ..................................................... 6-9 6.5 Adding Validation ...................................................................................................................... 6-9 6.5.1 How to Add Validation ................................................................................................... 6-10 6.5.1.1 Adding ADF Faces Validation................................................................................. 6-10 6.5.1.2 Using Validation Attributes ..................................................................................... 6-10 6.5.1.3 Using ADF Faces Validators .................................................................................... 6-10 6.5.2 What Happens at Runtime .............................................................................................. 6-11 6.5.3 What You May Need to Know About Multiple Validators........................................ 6-12 6.6 Creating Custom JSF Validation............................................................................................ 6-12 6.6.1 How to Create a Backing Bean Validation Method ..................................................... 6-13 6.6.2 What Happens When You Create a Backing Bean Validation Method.................... 6-13 6.6.3 How to Create a Custom JSF Validator ......................................................................... 6-13 6.6.4 What Happens When You Use a Custom JSF Validator............................................. 6-15

7

Rerendering Partial Page Content7.1 7.2 7.2.1 7.2.2 7.2.3 7.3 7.4 7.4.1 7.4.2 Introduction to Partial Page Rendering................................................................................... Enabling Partial Page Rendering Declaratively ..................................................................... How to Enable Partial Page Rendering ............................................................................ What You May Need to Know About Using the Browser Back Button ...................... What You May Need to Know About PPR and Screen Readers .................................. Enabling Partial Page Rendering Programmatically ............................................................. Using Partial Page Navigation.................................................................................................. How to Use Partial Page Navigation ................................................................................ What You May Need to Know About PPR Navigation................................................. 7-1 7-2 7-4 7-6 7-6 7-6 7-7 7-7 7-8

Part III

Using ADF Faces Components

8 Organizing Content on Web Pages8.1 8.2 8.2.1 8.2.2 8.2.3 8.2.4 8.2.5 8.3 8.3.1 8.3.2 8.4 8.4.1 8.4.2 8.5 8.6 8.6.1 Introduction to Organizing Content on Web Pages .............................................................. 8-1 Starting to Lay Out a Page......................................................................................................... 8-5 Geometry Management and Component Stretching ..................................................... 8-6 Nesting Components Inside Components That Allow Stretching ............................... 8-9 Using Quick Start Layouts .............................................................................................. 8-11 Tips for Using Geometry-Managed Components ....................................................... 8-12 How to Configure the document Tag............................................................................ 8-13 Arranging Contents to Stretch Across a Page...................................................................... 8-14 How to Use the panelStretchLayout Component ........................................................ 8-16 What You May Need to Know About Geometry Management and the panelStretchLayout Component 8-17 Using Splitters to Create Resizable Panes ............................................................................ 8-18 How to Use the panelSplitter Component .................................................................... 8-20 What You May Need to Know About Geometry Management and the panelSplitter Component 8-22 Arranging Page Contents in Predefined Fixed Areas ........................................................ 8-23 Arranging Content in Forms .................................................................................................. 8-25 How to Use the panelFormLayout Component........................................................... 8-27

vi

8.6.2 8.7 8.7.1 8.7.2 8.8 8.8.1 8.8.2 8.8.3 8.8.4 8.9 8.9.1 8.9.2 8.9.3 8.9.4 8.9.5 8.10 8.10.1 8.11 8.11.1 8.11.2 8.12 8.12.1 8.12.2 8.13 8.13.1 8.13.2

What You May Need to Know About Using the group Component with the panelFormLayout Component 8-30 Arranging Contents in a Dashboard ..................................................................................... 8-34 How to Use the panelDashboard Component ............................................................. 8-36 What You May Need to Know About Geometry Management and the panelDashboard Component 8-38 Displaying and Hiding Contents Dynamically ................................................................... 8-39 How to Use the showDetail Component ...................................................................... 8-43 How to Use the showDetailHeader Component ......................................................... 8-44 How to Use the panelBox Component .......................................................................... 8-46 What You May Need to Know About Disclosure Events........................................... 8-48 Displaying or Hiding Contents in Accordion Panels and Tabbed Panels....................... 8-48 How to Use the panelAccordion Component .............................................................. 8-52 How to Use the panelTabbed Component.................................................................... 8-53 How to Use the showDetailItem Component to Display Content in panelAccordion or panelTabbed Components 8-54 What You May Need to Know About Geometry Management and the showDetailItem Component 8-57 What You May Need to Know About showDetailItem Disclosure Events ............. 8-58 Displaying Items in a Static Box ............................................................................................ 8-59 How to Use the panelHeader Component.................................................................... 8-61 Displaying a Bulleted List in One or More Columns ......................................................... 8-62 How to Use the panelList Component .......................................................................... 8-63 What You May Need to Know About Creating a List Hierarchy ............................. 8-64 Grouping Related Items .......................................................................................................... 8-65 How to Use the panelGroupLayout Component......................................................... 8-67 What You May Need to Know About Geometry Management and the panelGroupLayout Component 8-69 Separating Content Using Blank Space or Lines ................................................................. 8-69 How to Use the spacer Component ............................................................................... 8-70 How to Use the Separator Component.......................................................................... 8-70

9

Using Input Components and Defining Forms9.1 9.2 9.2.1 9.2.2 9.2.3 9.3 9.3.1 9.3.2 9.4 9.4.1 9.4.2 9.5 9.5.1 9.5.2 Introduction to Input Components and Forms ...................................................................... 9-1 Defining Forms............................................................................................................................ 9-3 How to Add a Form to a Page ........................................................................................... 9-5 How to Add a Subform to a Page...................................................................................... 9-5 How to Add a Reset Button to a Form ............................................................................. 9-5 Using the inputText Component .............................................................................................. 9-6 How to Add an inputText Component ............................................................................ 9-7 How to Add the Ability to Insert Text into an inputText Component ........................ 9-9 Using the Input Number Components ................................................................................. 9-10 How to Add an inputNumberSlider or an inputRangeSlider Component ............. 9-11 How to Add an inputNumberSpinbox Component.................................................... 9-11 Using Color and Date Choosers ............................................................................................ 9-12 How to Add an inputColor Component ....................................................................... 9-13 How to Add an InputDate Component ........................................................................ 9-14

vii

9.5.3 9.6 9.6.1 9.7 9.7.1 9.7.2 9.8 9.8.1 9.8.2 9.8.3 9.9 9.9.1 9.9.2

What You May Need to Know About Selecting Time Zones Without the inputDate Component 9-15 Using Selection Components ................................................................................................. 9-16 How to Use Selection Components................................................................................ 9-19 Using Shuttle Components..................................................................................................... 9-21 How to Add a selectManyShuttle or selectOrderShuttle Component...................... 9-23 What You May Need to Know About Using a Client Listener for Selection Events ........ 9-24 Using the richTextEditor Component................................................................................... 9-26 How to Add a richTextEditor Component ................................................................... 9-28 How to Add the Ability to Insert Text into a richTextEditor Component ............... 9-29 How to Customize the Toolbar....................................................................................... 9-30 Using File Upload .................................................................................................................... 9-31 How to Use the inputFile Component........................................................................... 9-34 What You May Need to Know About Temporary File Storage................................. 9-34

10

Using Tables and Trees10.1 Introduction to Tables, Trees, and Tree Tables ................................................................... 10-1 10.1.1 Content Delivery............................................................................................................... 10-4 10.1.2 Row Selection .................................................................................................................... 10-5 10.1.3 Editing Data in Tables, Trees, and Tree Tables ............................................................ 10-5 10.1.4 Using Popup Dialogs in Tables, Trees, and Tree Tables............................................. 10-7 10.1.5 Accessing Client Table, Tree, and Tree Table Components ....................................... 10-9 10.2 Displaying Data in Tables....................................................................................................... 10-9 10.2.1 Columns and Column Data .......................................................................................... 10-11 10.2.2 Formatting Tables ........................................................................................................... 10-11 10.2.3 Formatting Columns ...................................................................................................... 10-13 10.2.4 How to Display a Table on a Page ............................................................................... 10-14 10.2.5 What Happens When You Add a Table to a Page ..................................................... 10-21 10.2.6 What Happens at Runtime: Data Delivery ................................................................. 10-22 10.2.7 What You May Need to Know About Programmatically Enabling Sorting for Table Columns 10-22 10.2.8 What You May Need to Know About Performing an Action on Selected Rows in Tables 10-23 10.2.9 What You May Need to Know About Dynamically Determining Values for Selection Components in Tables 10-24 10.2.10 What You May Need to Know About Using the Iterator Tag ................................. 10-25 10.3 Adding Hidden Capabilities to a Table.............................................................................. 10-25 10.3.1 How to Use the detailStamp Facet ............................................................................... 10-26 10.3.2 What Happens at Runtime: Disclosing Row Data..................................................... 10-27 10.4 Enabling Filtering in Tables.................................................................................................. 10-27 10.4.1 How to Add Filtering to a Table................................................................................... 10-29 10.5 Displaying Data in Trees....................................................................................................... 10-29 10.5.1 How to Display Data in Trees....................................................................................... 10-32 10.5.2 What Happens When You Add a Tree to a Page....................................................... 10-34 10.5.3 What Happens at Runtime: Tree Component Events ............................................... 10-35 10.5.4 What You May Need to Know About Programmatically Expanding and Collapsing Nodes 10-35

viii

10.5.5 What You May Need to Know About Programmatically Selecting Nodes ........... 10.6 Displaying Data in Tree Tables............................................................................................ 10.6.1 How to Display Data in a Tree Table........................................................................... 10.7 Passing a Row as a Value...................................................................................................... 10.8 Displaying Table Menus, Toolbars, and Status Bars ........................................................ 10.8.1 How to Add a panelCollection with a Table, Tree, or Tree Table ........................... 10.9 Exporting Data from Table, Tree, or Tree Table................................................................ 10.9.1 How to Export Table, Tree, or Tree Table Data to an External Format .................. 10.9.2 What Happens at Runtime: How Row Selection Affects the Exported Data ........ 10.10 Accessing Selected Values on the Client from Components That Use Stamping ........ 10.10.1 How to Access Values from a Selection in Stamped Components. ........................ 10.10.2 What You May Need to Know About Accessing Selected Values ..........................

10-37 10-37 10-39 10-39 10-40 10-42 10-42 10-44 10-45 10-45 10-45 10-48

11

Using List-of-Values Components11.1 11.2 11.3 11.4 Introduction to List-of-Values Components ........................................................................ Creating the ListOfValues Data Model................................................................................. Using the inputListOfValues Component............................................................................ Using the InputComboboxListOfValues Component ...................................................... 11-1 11-6 11-8 11-10

12 Using Query Components12.1 Introduction to Query Components...................................................................................... 12-1 12.2 Implementing the Model for Your Query ............................................................................ 12-3 12.3 Using the quickQuery Component ..................................................................................... 12-10 12.3.1 How to Add the quickQuery Component Using a Model ....................................... 12-11 12.3.2 How to Use a quickQuery Component Without a Model ........................................ 12-12 12.3.3 What Happens at Runtime: How the Framework Renders the quickQuery Component and Executes the Search 12-13 12.4 Using the query Component ................................................................................................ 12-14 12.4.1 How to Add the Query Component ............................................................................ 12-17

13 Using Popup Dialogs, Menus, and Windows13.1 13.2 13.2.1 13.2.2 13.2.3 13.2.4 13.2.5 13.3 13.3.1 13.4 13.4.1 13.5 13.5.1 13.5.2 Introduction to Using Popup Elements ................................................................................ 13-1 Declaratively Creating Popup Elements .............................................................................. 13-2 How to Create a Dialog.................................................................................................... 13-4 How to Create a Panel Window ..................................................................................... 13-8 How to Create a Context Menu .................................................................................... 13-10 How to Create a Note Window .................................................................................... 13-11 What Happens at Runtime: Popup Component Events ........................................... 13-13 Invoking Popup Elements .................................................................................................... 13-14 How to Use the af:showPopupBehavior Tag ............................................................. 13-15 Displaying Contextual Information .................................................................................... 13-16 How to Create Contextual Information....................................................................... 13-17 Controlling the Automatic Cancellation of Inline Popups .............................................. 13-18 How to Disable the Automatic Cancellation of an Inline Popup ............................ 13-19 What Happens When You Disable the Automatic Cancellation of an Inline Popup ........ 13-19

ix

14

Using Menus, Toolbars, and Toolboxes14.1 Introduction to Menus, Toolbars, and Toolboxes ............................................................... 14.2 Using Menus in a Menu Bar................................................................................................... 14.2.1 How to Create and Use Menus in a Menu Bar............................................................. 14.3 Using Toolbars ....................................................................................................................... 14.3.1 How to Create and Use Toolbars ................................................................................. 14.3.2 What Happens at Runtime: Determining the Size of Menu Bars and Toolbars ... 14.3.3 What You May Need to Know About Toolbars......................................................... 14-1 14-2 14-7 14-13 14-15 14-19 14-19

15

Creating a Calendar Application15.1 15.2 15.2.1 15.2.2 15.3 15.3.1 15.3.2 15.4 15.4.1 15.5 15.5.1 15.6 15.6.1 15.6.2 15.6.3 Introduction to Creating a Calendar Application ............................................................... Creating the Calendar ............................................................................................................. Calendar Classes ............................................................................................................... How to Create a Calendar ............................................................................................... Configuring the Calendar Component................................................................................. How to Configure the Calendar Component ............................................................... What Happens at Runtime: Calendar Events and PPR .............................................. Adding Functionality Using Popup Components .............................................................. How to Add Functionality Using Popup Components ............................................ Customizing the Toolbar ...................................................................................................... How to Customize the Toolbar..................................................................................... Styling the Calendar .............................................................................................................. How to Style Activities .................................................................................................. What Happens at Runtime: Activity Styling .............................................................. How to Customize Dates............................................................................................... 15-1 15-4 15-4 15-5 15-6 15-6 15-8 15-9 15-10 15-12 15-13 15-15 15-15 15-17 15-17

16 Using Output Components16.1 Introduction to Output Text, Image, Icon, and Media Components ............................... 16-1 16.2 Displaying Output Text and Formatted Output Text ........................................................ 16-2 16.2.1 How to Display Output Text .......................................................................................... 16-3 16.2.2 What You May Need to Know About Allowed Format and Character Codes in the outputFormatted Component 16-4 16.3 Displaying Icons....................................................................................................................... 16-5 16.4 Displaying Images ................................................................................................................... 16-5 16.5 Using Images as Links............................................................................................................. 16-6 16.6 Displaying Images in a Carousel ........................................................................................... 16-7 16.6.1 How to Create a Carousel................................................................................................ 16-9 16.6.2 What You May Need to Know About the Carousel Component and Different Browsers 16-13 16.7 Displaying Application Status Using Icons ....................................................................... 16-13 16.8 Playing Video and Audio Clips ........................................................................................... 16-14 16.8.1 How to Allow Playing of Audio and Video Clips ..................................................... 16-15

17

Displaying Tips, Messages, and Help17.1 17.2 Introduction to Displaying Tips and Messages................................................................... 17-1 Displaying Tips for Components .......................................................................................... 17-5

x

17.3 Displaying Hints and Error Messages for Validation and Conversion ........................... 17.3.1 How to Define Custom Validator and Converter Messages...................................... 17.3.2 What You May Need to Know About Overriding Default Messages Globally ...... 17.3.3 How to Display Component Messages Inline .............................................................. 17.3.4 How to Display Global Messages Inline ....................................................................... 17.4 Grouping Components with a Single Label and Message................................................. 17.5 Displaying Help for Components ....................................................................................... 17.5.1 How to Create Resource Bundle-Based Help............................................................. 17.5.2 How to Create XLIFF-Based Help................................................................................ 17.5.3 How to Create Managed Bean Help ............................................................................ 17.5.4 How to Use JavaScript to Launch an External Help Window ................................. 17.5.5 How to Create a Java Class Help Provider ................................................................. 17.5.6 How to Access Help Content from a UI Component................................................ 17.5.7 What You May Need to Know About Combining Different Message Types .......

17-5 17-7 17-8 17-8 17-9 17-9 17-11 17-14 17-16 17-18 17-20 17-21 17-23 17-23

18 Working with Navigation Components18.1 Introduction to Navigation Components ............................................................................. 18-1 18.2 Using Buttons and Links for Navigation.............................................................................. 18-2 18.2.1 How to Use Command Buttons and Command Links ............................................... 18-3 18.2.2 How to Use Go Buttons and Go Links .......................................................................... 18-4 18.3 Configuring a Browsers Context Menu for Command Links .......................................... 18-5 18.3.1 How to Configure a Browsers Context Menu for Command Links ........................ 18-6 18.3.2 What Happens When You Configure a Browsers Context Menu for Command Links .. 18-7 18.4 Using Buttons or Links to Invoke Functionality ................................................................. 18-7 18.4.1 How to Use a Command Component to Download Files .......................................... 18-7 18.4.2 How to Use a Command Component to Reset Input Fields ...................................... 18-9 18.5 Using Navigation Items for a Page Hierarchy..................................................................... 18-9 18.6 Using a Menu Model to Create a Page Hierarchy............................................................. 18-13 18.6.1 How to Create the Menu Model Metadata ................................................................. 18-14 18.6.2 What Happens When You Use the Create ADF Menu Model Wizard .................. 18-21 18.6.3 How to Bind to the XMLMenuModel in the JSF Page .............................................. 18-22 18.6.4 How to Use the breadCrumbs Component ................................................................ 18-26 18.6.5 What Happens at Runtime ............................................................................................ 18-28 18.6.6 What You May Need to Know About Using Custom Attributes............................ 18-29 18.7 Creating a Simple Navigational Hierarchy........................................................................ 18-31 18.7.1 How to Create a Simple Page Hierarchy..................................................................... 18-32 18.7.2 How to Use the breadCrumbs Component ................................................................ 18-35 18.8 Using Train Components to Create Navigation Items for a Multi-Step Process.......... 18-36 18.8.1 How to Create the Train Model.................................................................................... 18-40 18.8.2 How to Configure Managed Beans for the Train Model .......................................... 18-42 18.8.3 How to Bind to the Train Model in JSF Pages ............................................................ 18-46

19 Creating and Reusing Fragments, Page Templates, and Components19.1 19.2 Introduction to Reusable Content ......................................................................................... 19-1 Using Page Fragments............................................................................................................. 19-2

xi

19.2.1 How to Create a Page Fragment..................................................................................... 19.2.2 What Happens When You Create a Page Fragment.................................................... 19.2.3 How to Use a Page Fragment in a JSF Page.................................................................. 19.2.3.1 Adding a Page Fragment Using the Component Palette..................................... 19.2.3.2 Adding a Page Fragment Using the Application Navigator............................... 19.2.4 What Happens at Runtime: Resolving Page Fragments ............................................. 19.3 Using Page Templates ............................................................................................................. 19.3.1 How to Create a Page Template ................................................................................... 19.3.2 What Happens When You Create a Page Template .................................................. 19.3.3 How to Create JSF Pages Based on Page Templates.................................................. 19.3.4 What Happens When You Use a Template to Create a Page................................... 19.3.5 What Happens at Runtime: How Page Templates Are Resolved ........................... 19.3.6 What You May Need to Know About Page Templates and Naming Containers. 19.4 Using Declarative Components ........................................................................................... 19.4.1 How to Create a Declarative Component ................................................................... 19.4.2 What Happens When You Create a Declarative Component .................................. 19.4.3 How to Deploy Declarative Components ................................................................... 19.4.4 How to Use Declarative Components in JSF Pages ................................................... 19.4.5 What Happens When You Use a Declarative Component on a JSF Page .............. 19.4.6 What Happens at Runtime ............................................................................................ 19.5 Adding Resources to Pages .................................................................................................. 19.5.1 How to Add Resources to Page Templates and Declarative Components ............ 19.5.2 What Happens at Runtime: Adding Resources to the Document Header.............

19-5 19-6 19-7 19-7 19-7 19-7 19-7 19-11 19-15 19-15 19-17 19-18 19-18 19-18 19-21 19-25 19-27 19-28 19-29 19-30 19-30 19-31 19-31

20 Customizing the Appearance Using Styles and Skins20.1 20.1.1 20.1.2 20.1.3 20.2 20.2.1 20.2.2 20.2.3 20.2.4 20.3 20.3.1 20.3.2 20.3.3 20.3.4 20.3.5 20.3.6 20.4 20.4.1 20.4.2 20.5 20.6 Introduction to Skins, Style Selectors, and Style Properties .............................................. Oracle ADF Faces Skins ................................................................................................... Skin Style Selectors ........................................................................................................... Component Style Properties ........................................................................................... Applying Custom Skins to Applications.............................................................................. How to Add a Custom Skin to an Application .......................................................... How to Register the XML Schema Definition File for a Custom Skin .................... How to Register a Custom Skin.................................................................................... How to Configure an Application to Use a Custom Skin......................................... Defining Skin Style Properties ............................................................................................. How to Apply Skins to Text .......................................................................................... How to Apply Skins to Icons ........................................................................................ How to Apply Skins to Messages................................................................................. How to Apply Themes to Components....................................................................... How to Create a Custom Alias ..................................................................................... How to Configure a Component for Changing Skins Dynamically ....................... Changing the Style Properties of a Component ............................................................... How to Set an Inline Style ............................................................................................. How to Set a Style Class................................................................................................. Referring to URLs in a Skins CSS File................................................................................ Deploying a Custom Skin File in a JAR File ...................................................................... 20-1 20-2 20-4 20-9 20-9 20-10 20-10 20-11 20-13 20-14 20-16 20-18 20-18 20-19 20-20 20-21 20-22 20-22 20-23 20-23 20-24

xii

21 Internationalizing and Localizing Pages21.1 Introduction to Internationalization and Localization of ADF Faces Pages ................... 21.2 Using Automatic Resource Bundle Integration in JDeveloper ......................................... 21.2.1 How to Set Resource Bundle Options............................................................................ 21.2.2 What Happens When You Set Resource Bundle Options .......................................... 21.2.3 How to Create an Entry in a JDeveloper-Generated Resource Bundle .................... 21.2.4 What Happens When You Create an Entry in a JDeveloper-Generated Resource Bundle 21-6 21.3 Manually Defining Resource Bundles and Locales ............................................................ 21.3.1 How to Define the Base Resource Bundle..................................................................... 21.3.2 How to Edit a Resource Bundle File ............................................................................ 21.3.3 How to Register Locales and Resource Bundles in Your Application.................... 21.3.4 How to Use Resource Bundles in Your Application ................................................. 21.3.5 What You May Need to Know About Custom Skins and Control Hints............... 21.4 Configuring Pages for an End User to Specify Locale at Runtime ................................. 21.4.1 How to Configure a Page for an End User to Specify Locale................................... 21.4.2 What Happens When You Configure a Page to Specify Locale .............................. 21.4.3 What Happens at Runtime When an End User Specifies a Locale.......................... 21.5 Configuring Optional ADF Faces Localization Properties .............................................. 21.5.1 How to Configure Optional Localization Properties ................................................ 21-1 21-3 21-4 21-5 21-6

21-7 21-8 21-10 21-12 21-14 21-15 21-15 21-15 21-16 21-17 21-17 21-18

22 Developing Accessible ADF Faces Pages22.1 22.2 22.2.1 22.3 22.3.1 22.3.2 22.3.3 22.4 22.4.1 22.4.2 22.4.3 22.4.4 22.4.5 22.5 Introduction to Accessible ADF Faces Pages ....................................................................... Exposing Accessibility Preferences ....................................................................................... How to Configure Accessibility Support in trinidad-config.xml .............................. Specifying Component-Level Accessibility Properties ...................................................... ADF Faces Component Accessibility Guidelines......................................................... How to Define Access Keys for an ADF Faces Component ....................................... How to Define Localized Labels and Access Keys ...................................................... Creating Accessible Pages ...................................................................................................... How to Use Partial Page Rendering .............................................................................. How to Use Scripting ....................................................................................................... How to Use Styles............................................................................................................. How to Use Page Structures and Navigation............................................................. How to Use WAI-ARIA Landmark Regions .............................................................. Running Accessibility Audit Rules ..................................................................................... 22-1 22-2 22-2 22-3 22-3 22-6 22-7 22-8 22-8 22-9 22-9 22-10 22-11 22-11

Part IV

Using ADF Data Visualization Components

23 Introduction to ADF Data Visualization Components23.1 Introduction to ADF Data Visualization Components....................................................... 23.2 Defining the ADF Data Visualization Components ........................................................... 23.2.1 Graph .................................................................................................................................. 23.2.2 Gauge.................................................................................................................................. 23.2.3 Pivot Table ......................................................................................................................... 23.2.4 Geographic Map ............................................................................................................... 23-1 23-1 23-2 23-6 23-8 23-8

xiii

23.2.5 Gantt Chart ........................................................................................................................ 23.2.6 Hierarchy Viewer............................................................................................................ 23.3 Providing Data for ADF Data Visualization Components .............................................. 23.4 Downloading Custom Fonts for Flash Images ..................................................................

23-9 23-10 23-11 23-11

24 Using ADF Graph Components24.1 Introduction to the Graph Component................................................................................. 24.2 Understanding the Graph Tags ............................................................................................. 24.2.1 Graph-Specific Tags ......................................................................................................... 24.2.2 Common Graph Child Tags ............................................................................................ 24.2.3 Graph-Specific Child Tags............................................................................................... 24.2.4 Child Set Tags.................................................................................................................... 24.3 Understanding Data Requirements for Graphs .................................................................. 24.3.1 Area Graphs Data Requirements.................................................................................... 24.3.2 Bar Graph Data Requirements........................................................................................ 24.3.3 Bubble Graph Data Requirements ................................................................................. 24.3.4 Combination Graph Data Requirements..................................................................... 24.3.5 Funnel Graph Data Requirements ............................................................................... 24.3.6 Line Graph Data Requirements .................................................................................... 24.3.7 Pareto Graph Data Requirements ................................................................................ 24.3.8 Pie Graph Data Requirements ...................................................................................... 24.3.9 Polar Graph Data Requirements .................................................................................. 24.3.10 Radar Graph Data Requirements ................................................................................. 24.3.11 Scatter Graph Data Requirements................................................................................ 24.3.12 Sparkchart Data Requirements ..................................................................................... 24.3.13 Stock Graph Data Requirements .................................................................................. 24.3.13.1 Stock Graphs: High-Low-Close ............................................................................. 24.3.13.2 Stock Graphs: High-Low-Close with Volume..................................................... 24.3.13.3 Stock Graphs: Open-High-Low-Close.................................................................. 24.3.13.4 Stock Graphs: Open-High-Low-Close with Volume.......................................... 24.3.13.5 Candle Stock Graphs: Open-Close ....................................................................... 24.3.13.6 Candle Stock Graphs: Open-Close with Volume ............................................... 24.3.13.7 Candle Stock Graphs: Open-High-Low-Close ................................................... 24.3.13.8 Candle Stock Graphs: Open-High-Low-Close with Volume ........................... 24.4 Creating a Graph ................................................................................................................... 24.4.1 How to Create a Graph Using Tabular Data ............................................................. 24.4.1.1 Storing Tabular Data for a Graph in a Managed Bean....................................... 24.4.1.2 Creating a Graph Using Tabular Data.................................................................. 24.4.2 What Happens When You Create a Graph Using Tabular Data ............................. 24.5 Changing the Graph Type .................................................................................................... 24.6 Customizing the Appearance of Graphs ............................................................................ 24.6.1 Changing the Color, Style, and Display of Graph Data Values............................... 24.6.1.1 How to Specify the Color and Style for Individual Series Items...................... 24.6.1.2 How to Control the Number of Different Colors Used for Series Items ......... 24.6.1.3 How to Enable Hiding and Showing Series Items ............................................. 24.6.2 Formatting Numbers in Graphs ................................................................................... 24.6.2.1 How to Format Numbers in the y1-Axis of a Graph.......................................... 24-1 24-3 24-4 24-5 24-6 24-7 24-7 24-8 24-9 24-9 24-10 24-10 24-10 24-11 24-11 24-11 24-12 24-12 24-12 24-13 24-13 24-13 24-14 24-14 24-14 24-14 24-15 24-15 24-15 24-15 24-15 24-17 24-17 24-17 24-18 24-19 24-20 24-20 24-20 24-21 24-21

xiv

24.6.2.2 How to Format Numbers for the Marker Text of a Graph ............................... 24.6.3 Formatting Text in Graphs ............................................................................................ 24.6.3.1 How to Globally Set Graph Font Using a Skin ................................................... 24.6.4 Changing Graph Size and Style ................................................................................... 24.6.4.1 How to Specify the Size of a Graph at Initial Display........................................ 24.6.4.2 How to Provide for Dynamic Resizing of a Graph ............................................ 24.6.4.3 How to Use a Specific Style Sheet for a Graph.................................................... 24.6.5 Changing Graph Background, Plot Area, and Title .................................................. 24.6.5.1 How to Customize the Background and Plot Area of a Graph ........................ 24.6.5.2 How to Specify Titles and Footnotes in a Graph ................................................ 24.6.6 Customizing Graph Axes and Labels .......................................................................... 24.6.6.1 How to Specify the Title, Appearance, and Scaling of an Axis ........................ 24.6.6.2 How to Specify Scrolling on an Axis .................................................................... 24.6.6.3 How to Control the Appearance of Tick Marks and Labels on an Axis.......... 24.6.6.4 How to Format Numbers on an Axis ................................................................... 24.6.6.5 How to Set Minimum and Maximum Values on a Data Axis .......................... 24.6.7 Customizing Graph Legends ........................................................................................ 24.6.8 Customizing Tooltips in Graphs .................................................................................. 24.7 Customizing the Appearance of Specific Graph Types ................................................... 24.7.1 Changing the Appearance of Pie Graphs.................................................................... 24.7.1.1 How to Customize the Overall Appearance of Pie Graphs .............................. 24.7.1.2 How to Customize an Exploding Pie Slice .......................................................... 24.7.2 Changing the Appearance of Lines in Graphs ........................................................... 24.7.2.1 How to Display Either Data Lines or Markers in Graphs ................................. 24.7.2.2 How to Change the Appearance of Lines in a Graph Series............................. 24.7.3 Customizing Pareto Graphs .......................................................................................... 24.7.4 Customizing Scatter Graph Series Markers ................................................................ 24.8 Adding Specialized Features to Graphs ............................................................................. 24.8.1 Adding Reference Lines or Areas to Graphs .............................................................. 24.8.1.1 How to Create Reference Lines or Areas During Design .................................. 24.8.1.2 What Happens When You Create Reference Lines or Areas During Design. 24.8.1.3 How to Create Reference Lines or Areas Dynamically...................................... 24.8.2 Using Gradient Special Effects in Graphs ................................................................... 24.8.2.1 How to Add Gradient Special Effects to a Graph............................................... 24.8.2.2 What Happens When You Add a Gradient Special Effect to a Graph ............ 24.8.3 Specifying Transparent Colors for Parts of a Graph ................................................. 24.8.4 Providing Interactive Capability for Graphs .............................................................. 24.8.4.1 How to Provide Marker and Legend Dimming.................................................. 24.8.4.2 How to React to Changes in the Zoom and Scroll Levels ................................. 24.8.5 Providing an Interactive Time Axis for Graphs ......................................................... 24.8.5.1 How to Define a Relative Range of Time Data for Display............................... 24.8.5.2 How to Define an Explicit Range of Time Data for Display ............................. 24.8.6 Adding Alerts and Annotations to Graphs................................................................. 24.9 Animating Graphs with Active Data .................................................................................. 24.9.1 How to Configure Graph Components to Display Active Data.............................. 24.9.2 How to Add Animation Effects that Use Active Data ..............................................

24-22 24-22 24-23 24-24 24-24 24-25 24-25 24-25 24-26 24-26 24-27 24-28 24-28 24-29 24-30 24-30 24-30 24-31 24-33 24-33 24-33 24-33 24-34 24-34 24-34 24-35 24-35 24-36 24-37 24-37 24-38 24-39 24-39 24-40 24-41 24-41 24-41 24-41 24-42 24-42 24-42 24-43 24-43 24-44 24-45 24-45

xv

25 Using ADF Gauge Components25.1 Introduction to the Gauge Component ................................................................................ 25.1.1 Types of Gauges................................................................................................................ 25.1.2 Gauge Terminology.......................................................................................................... 25.2 Understanding Data Requirements for Gauges .................................................................. 25.3 Creating a Gauge...................................................................................................................... 25.3.1 Creating a Gauge Using Tabular Data........................................................................... 25.3.1.1 Storing Tabular Data for a Gauge in a Managed Bean ........................................ 25.3.1.2 Structure of the List of Tabular Data ...................................................................... 25.3.2 How to Create a Gauge Using Tabular Data ................................................................ 25.3.3 What Happens When You Create a Gauge Using Tabular Data............................... 25.4 Customizing Gauge Type, Layout, and Appearance ......................................................... 25.4.1 How to Change the Type of the Gauge ......................................................................... 25.4.2 How to Determine the Layout of Gauges in a Gauge Set......................................... 25.4.3 Changing Gauge Size and Style.................................................................................... 25.4.3.1 Specifying the Size of a Gauge at Initial Display ................................................ 25.4.3.2 Providing Dynamic Resizing of a Gauge............................................................. 25.4.3.3 Using a Custom Style Class for a Gauge.............................................................. 25.4.4 How to Add Thresholds to Gauges ............................................................................. 25.4.4.1 Adding Static Thresholds to Gauges .................................................................... 25.4.5 How to Format Numbers in Gauges............................................................................ 25.4.5.1 Formatting the Number in a Gauge Metric Label .............................................. 25.4.6 What Happens When You Format the Number in a Gauge Metric Label ............. 25.4.7 How to Format Text in Gauges..................................................................................... 25.4.8 How to Specify an N-Degree Dial ................................................................................ 25.4.9 How to Customize Gauge Labels................................................................................. 25.4.9.1 Controlling the Position of Gauge Labels ............................................................ 25.4.9.2 Customizing the Colors and Borders of Gauge Labels...................................... 25.4.10 How to Customize Indicators and Tick Marks .......................................................... 25.4.10.1 Controlling the Appearance of Gauge Indicators............................................... 25.4.10.2 Specifying Tick Marks and Labels ....................................................................... 25.4.10.3 Creating Exterior Tick Labels ................................................................................ 25.4.11 Specifying Transparency for Parts of a Gauge ........................................................... 25.5 Adding Gauge Special Effects and Animation .................................................................. 25.5.1 How to Use Gradient Special Effects in a Gauge ....................................................... 25.5.1.1 Adding Gradient Special Effects to a Gauge ....................................................... 25.5.2 What Happens When You Add a Gradient Special Effect to a Gauge ................... 25.5.3 How to Add Interactivity to Gauges ........................................................................... 25.5.4 How to Animate Gauges ............................................................................................... 25.5.5 How to Animate Gauges with Active Data ................................................................ 25.5.5.1 Configuring Gauge Components to Display Active Data................................. 25.5.5.2 Adding Animation to Gauges ............................................................................... 25.6 Using Custom Shapes in Gauges......................................................................................... 25.6.1 How to Create a Custom Shapes Graphic File ........................................................... 25.6.2 How to Use a Custom Shapes File ............................................................................... 25.6.3 What You May Need to Know About Supported SVG Features ............................ 25.6.4 How to Set Custom Shapes Styles................................................................................ 25-1 25-3 25-5 25-6 25-6 25-7 25-7 25-7 25-8 25-9 25-9 25-9 25-10 25-10 25-10 25-11 25-11 25-11 25-11 25-12 25-12 25-13 25-13 25-14 25-14 25-14 25-14 25-15 25-15 25-15 25-16 25-16 25-17 25-17 25-17 25-18 25-18 25-19 25-20 25-20 25-21 25-21 25-21 25-24 25-24 25-25

xvi

26 Using ADF Pivot Table Components26.1 Introduction tithe ADF Pivot Table Component................................................................. 26.1.1 Pivot Table Elements and Terminology ........................................................................ 26.2 Understanding Data Requirements for a Pivot Table ........................................................ 26.3 Pivoting Layers......................................................................................................................... 26.4 Using Selection in Pivot Tables.............................................................................................. 26.5 Sorting in a Pivot Table ........................................................................................................... 26.6 Sizing in a Pivot Table ............................................................................................................. 26.6.1 How to Set the Overall Size of a Pivot Table ................................................................ 26.6.2 How to Resize Rows, Columns, and Layers ................................................................. 26.6.3 What You May Need to Know About Resizing Rows, Columns, and Layers ........ 26.7 Updating Pivot Tables with Partial Page Rendering.......................................................... 26.8 Exporting from a Pivot Table ................................................................................................. 26.9 Customizing the Cell Content of a Pivot Table ................................................................... 26.9.1 How to Create a CellFormat Object for a Data Cell..................................................... 26.9.2 How to Construct a CellFormat Object ....................................................................... 26.9.3 How to Change Format and Text Styles...................................................................... 26.9.4 How to Create Stoplight and Conditional Formatting in a Pivot Table ................ 26.10 Pivot Table Data Cell Stamping and Editing ..................................................................... 26.10.1 How to Specify Custom Images for Data Cells .......................................................... 26.10.2 How to Specify Images, Icons, Links, and Read-Only Content in Header Cells .. 26.11 Using a Pivot Filter Bar with a Pivot Table ........................................................................ 26.11.1 How to Associate a Pivot Filter Bar with a Pivot Table ............................................ 26-1 26-2 26-3 26-3 26-5 26-6 26-6 26-6 26-7 26-7 26-7 26-8 26-9 26-9 26-10 26-10 26-12 26-13 26-14 26-14 26-15 26-16

27

Using ADF Geographic Map Components27.1 Introduction to Geographic Maps ......................................................................................... 27.1.1 Available Map Themes .................................................................................................... 27.1.2 Geographic Map Terminology ....................................................................................... 27.1.3 Geographic Map Component Tags ................................................................................ 27.1.3.1 Geographic Map Parent Tags .................................................................................. 27.1.3.2 Geographic Map Child Tags .................................................................................... 27.1.3.3 Tags for Modifying Map Themes............................................................................ 27.2 Understanding Data Requirements for Geographic Maps ................................................ 27.3 Customizing Map Size, Zoom Control, and Selection Area Totals .................................. 27.3.1 How to Adjust the Map Size ........................................................................................... 27.3.2 How to Specify Strategy for Map Zoom Control ......................................................... 27.3.3 How to Total Map Selection Values............................................................................... 27.4 Customizing Map Themes...................................................................................................... 27.4.1 How to Customize Zoom Levels for a Theme.............................................................. 27.4.2 How to Customize the Labels of a Map Theme ........................................................... 27.4.3 How to Customize Color Map Themes ......................................................................... 27.4.4 How to Customize Point Images in a Point Theme................................................... 27.4.5 What Happens When You Customize the Point Images in a Map ......................... 27.4.6 How to Customize the Bars in a Bar Graph Theme................................................... 27.4.7 What Happens When You Customize the Bars in a Map Bar Graph Theme ........ 27.4.8 How to Customize the Slices in a Pie Graph Theme ................................................. 27-1 27-1 27-2 27-4 27-5 27-5 27-5 27-6 27-6 27-6 27-7 27-7 27-8 27-8 27-9 27-9 27-10 27-10 27-11 27-12 27-12

xvii

27.4.9 What Happens When You Customize the Slices in a Map Pie Graph Theme....... 27.5 Adding a Toolbar to a Map .................................................................................................. 27.5.1 How to Add a Toolbar to a Map .................................................................................. 27.5.2 What Happens When You Add a Toolbar to a Map .................................................

27-13 27-14 27-14 27-14

28 Using ADF Gantt Chart Components28.1 Introduction to the ADF Gantt Chart Components ............................................................ 28.1.1 Types of Gantt Charts ...................................................................................................... 28.1.2 Functional Areas of a Gantt Chart ................................................................................. 28.1.3 Description of Gantt Chart Tasks ................................................................................... 28.2 Understanding Gantt Chart Tags and Facets....................................................................... 28.3 Understanding Gantt Chart User Interactivity.................................................................... 28.3.1 Navigating in a Gantt Chart............................................................................................ 28.3.1.1 Scrolling and Panning the List Region or the Chart Region ............................... 28.3.1.2 How to Navigate to a Specific Date in a Gantt Chart........................................... 28.3.1.3 How to Control the Visibility of Columns in the Table Region.......................... 28.3.2 How to Display Data in a Hierarchical List or a Flat List........................................... 28.3.3 How to Change the Gantt Chart Time Scale................................................................. 28.4 Understanding Data Requirements for the Gantt Chart ................................................... 28.4.1 Data for a Project Gantt Chart......................................................................................... 28.4.2 Data for a Resource Utilization Gantt Chart............................................................... 28.4.3 Data for a Scheduling Gantt Chart ............................................................................... 28.5 Creating an ADF Gantt Chart .............................................................................................. 28.6 Customizing Gantt Chart Legends, Toolbars, and Context Menus ............................... 28.6.1 How to Customize a Gantt Chart Legend................................................................... 28.6.2 Customizing Gantt Chart Toolbars .............................................................................. 28.6.3 Customizing Gantt Chart Context Menus .................................................................. 28.7 Working with Gantt Chart Tasks and Resources .............................................................. 28.7.1 How to Create a New Task Type ................................................................................. 28.7.2 How to Specify Custom Data Filters............................................................................ 28.7.3 How to Add a Double-Click Event to a Task Bar ...................................................... 28.8 Specifying Nonworking Days, Read-Only Features, and Time Axes ............................ 28.8.1 Identifying Nonworking Days in a Gantt Chart ........................................................ 28.8.1.1 How to Specify Weekdays as Nonworking Days............................................... 28.8.1.2 How to Identify Specific Dates as Nonworking Days ....................................... 28.8.2 How to Apply Read-Only Values to Gantt Chart Features...................................... 28.8.3 Customizing the Time Axis of a Gantt Chart ............................................................. 28.8.3.1 How to Create and Use a Custom Time Axis...................................................... 28.9 Printing a Gantt Chart ........................................................................................................... 28.9.1 Print Options ................................................................................................................... 28.9.2 Action Listener to Handle the Print Event.................................................................. 28.10 Using Gantt Charts as a Drop Target or Drag Source ...................................................... 28-1 28-2 28-3 28-4 28-5 28-6 28-7 28-7 28-7 28-8 28-8 28-8 28-9 28-9 28-11 28-12 28-13 28-13 28-13 28-14 28-15 28-16 28-16 28-17 28-18 28-19 28-19 28-19 28-19 28-20 28-21 28-22 28-22 28-23 28-23 28-24

29

Using ADF Hierarchy Viewer Components29.1 Introduction to Hierarchy Viewers ....................................................................................... 29-1 29.1.1 Understanding the Hierarchy Viewer Component ..................................................... 29-1 29.1.2 Hierarchy Viewer Elements and Terminology............................................................. 29-4

xviii

29.1.3 Available Hierarchy Viewer Layout Options............................................................... 29-6 29.2 Data Requirements for Hierarchy Viewers .......................................................................... 29-8 29.3 Managing Nodes in a Hierarchy Viewer.............................................................................. 29-8 29.3.1 How to Specify Node Content ...................................................................................... 29-10 29.3.2 How to Configure the Controls on a Node................................................................. 29-12 29.3.3 How to Specify a Node Definition for an Accessor ................................................... 29-13 29.3.4 How to Associate a Node Definition with a Particular Set of Data Rows.............. 29-13 29.3.5 How to Specify Ancestor Levels for an Anchor Node .............................................. 29-14 29.4 Navigating in a Hierarchy Viewer ...................................................................................... 29-14 29.4.1 How to Configure Upward Navigation in a Hierarchy Viewer .............................. 29-14 29.4.2 How to Configure Same-Level Navigation in a Hierarchy Viewer ........................ 29-15 29.4.3 What Happens When You Configure Same-Level Navigation in a Hierarchy Viewer .... 29-15 29.5 Adding Interactivity to a Hierarchy Viewer Component................................................ 29-16 29.5.1 How to Configure Node Selection Action .................................................................. 29-16 29.5.2 How to Configure a Hierarchy Viewer to Invoke a Popup Window ..................... 29-16 29.5.3 How to Configure a Hierarchy View Node to Invoke a Menu................................ 29-18 29.6 Using Panel Cards.................................................................................................................. 29-18 29.6.1 How to Create a Panel Card.......................................................................................... 29-19 29.6.2 What Happens at Runtime When a Panel Card Component Is Rendered ............ 29-19 29.7 Customizing the Appearance of a Hierarchy Viewer ...................................................... 29-20 29.7.1 How to Adjust the Size of a Hierarchy Viewer .......................................................... 29-20 29.7.2 How to Include Images in a Hierarchy Viewer.......................................................... 29-20 29.7.3 How to Configure the Display of the Control Panel ................................................. 29-21 29.7.4 How to Configure the Display of Links and Labels .................................................. 29-21 29.8 Adding Search to a Hierarchy Viewer................................................................................ 29-23 29.8.1 How to Configure Searching in a Hierarchy Viewer ................................................ 29-23 29.8.2 What You May Need to Know About Configuring Search in a Hierarchy Viewer........... 29-25

Part V 30

Advanced Topics

Creating Custom ADF Faces Components30.1 Introduction to Custom ADF Faces Components ............................................................... 30.1.1 Developing a Custom Component with JDeveloper................................................... 30.1.2 An Example Custom Component .................................................................................. 30.2 Setting Up the Workspace and Starter Files......................................................................... 30.2.1 How to Set Up the JDeveloper Custom Component Environment ........................ 30.2.2 How to Add a Faces Configuration File...................................................................... 30.2.3 How to Add a MyFaces Trinidad Skins Configuration File..................................... 30.2.4 How to Add a Cascading Style Sheet .......................................................................... 30.2.5 How to Add a Resource Kit Loader ............................................................................ 30.2.6 How to Add a JavaServer Pages Tag Library Descriptor File ................................. 30.2.7 How to Add a JavaScript Library Feature Configuration File ................................. 30.2.8 How to Add a Facelets Tag Library Configuration File............................................ 30.3 Client-Side Development...................................................................................................... 30.3.1 How to Create a JavaScript File for a Component..................................................... 30-1 30-2 30-5 30-9 30-10 30-12 30-12 30-13 30-13 30-13 30-14 30-14 30-15 30-16

xix

30.3.2 30.3.3 30.3.4

How to Create a Javascript File for an Event.............................................................. 30-17 How to Create a JavaScript File for a Peer .................................................................. 30-19 How to Add a Custom Component to a JavaScript Library Feature Configuration File . 30-20 30.4 Server-Side Development ..................................................................................................... 30-20 30.4.1 How to Create a Class for an Event Listener .............................................................. 30-21 30.4.2 How to Create a Class for an Event ............................................................................. 30-22 30.4.3 Creating the Component ............................................................................................... 30-23 30.4.4 How to Create a Class for a Component..................................................................... 30-25 30.4.5 How to Add the Component to the faces-config.xml File ........................................ 30-27 30.4.6 How to Create a Class for a Resource Bundle ............................................................ 30-28 30.4.7 How to Create a Class for a Renderer.......................................................................... 30-30 30.4.8 How to Add the Renderer to the faces-config.xml File............................................. 30-31 30.4.9 How to Create JSP Tag Properties................................................................................ 30-31 30.4.10 How to Configure the Tag Library Descriptor........................................................... 30-34 30.4.11 How to Create a Resource Loader................................................................................ 30-36 30.4.12 How to Create a MyFaces Trinidad Cascading Style Sheet ..................................... 30-37 30.5 Deploying a Component Library......................................................................................... 30-39 30.6 Adding the Custom Component to an Application ......................................................... 30-39 30.6.1 How to Configure the Web Deployment Descriptor................................................. 30-40 30.6.2 How to Enable JavaScript Logging and Assertions................................................... 30-40 30.6.3 How to Add a Custom Component to JSF Pages....................................................... 30-41 30.6.4 What You May Need to Know About Using the tagPane Custom Component ... 30-41

31

Allowing User Customization on JSF Pages31.1 Introduction to User Customization ..................................................................................... 31-1 31.2 Implementing Session Change Persistence.......................................................................... 31-4 31.2.1 How to Implement Session Change Persistence .......................................................... 31-4 31.2.2 What Happens When You Configure Your Application to Use Change Persistence ....... 31-4 31.2.3 What Happens at Runtime .............................................................................................. 31-4 31.2.4 What You May Need to Know About Using Change Persistence on Templates and Regions 31-5

32 Adding Drag and Drop Functionality32.1 32.2 32.3 32.3.1 32.3.2 32.3.3 32.4 32.4.1 32.4.2 32.5 32.5.1 Introduction to Drag and Drop Functionality ..................................................................... Adding Drag and Drop Functionality for Attributes ......................................................... Adding Drag and Drop Functionality for Objects .............................................................. How to Add Drag and Drop Functionality for a Single Object ................................. What Happens at Runtime ......................................