+ All Categories
Home > Documents > Oracle® ADF Developer Guide For Forms-4GL Developers

Oracle® ADF Developer Guide For Forms-4GL Developers

Date post: 16-Nov-2014
Category:
Upload: api-26825735
View: 1,263 times
Download: 1 times
Share this document with a friend
1160
Oracle® Application Development Framework Developer’s Guide For Forms/4GL Developers 10g Release 3 (10.1.3.0) B25947-01 June 2006
Transcript

Oracle Application Development FrameworkDevelopers Guide For Forms/4GL Developers 10g Release 3 (10.1.3.0)B25947-01

June 2006

Oracle Application Development Framework Developers Guide For Forms/4GL Developers, 10g Release 3 (10.1.3.0) B25947-01 Copyright 2006, Oracle. All rights reserved. Contributing Author: Ken Chu, Orlando Cordero, Ralph Gordon, Rosslynne Hefferan, Mario Korf, Robin Merrin, Steve Muench, Kathryn Munn, Barbara Ramsey, Jon Russell, Deborah Steiner, Odile Sullivan-Tarazi, Poh Lee Tan, Robin Whitmore, Martin Wykes The Programs (which include both the software and documentation) contain proprietary information; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the Programs, except to the extent required to obtain interoperability with other independently created software or as specified by law, is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. This document is not warranted to be error-free. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose. If the Programs are delivered to the United States Government or anyone licensing or using the Programs on behalf of the United States 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, use, duplication, disclosure, modification, and adaptation of the Programs, including documentation and technical data, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement, and, to the extent applicable, the additional rights set forth in FAR 52.227-19, Commercial Computer Software--Restricted Rights (June 1987). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065. The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup, redundancy and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and we disclaim liability for any damages caused by such use of the Programs. Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. The Programs may provide links to Web sites and access to content, products, and services from third parties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites. You bear all risks associated with the use of such content. If you choose to purchase any products or services from a third party, the relationship is directly between you and the third party. Oracle is not responsible for: (a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the third party, including delivery of products or services and warranty obligations related to purchased products or services. Oracle is not responsible for any loss or damage of any sort that you may incur from dealing with any third party.

ContentsPreface ......................................................................................................................................................... xxxviiAudience................................................................................................................................................ xxxvii Documentation Accessibility .............................................................................................................. xxxvii Related Documents ............................................................................................................................. xxxviii Conventions ......................................................................................................................................... xxxviii

Part I 1

Getting Started with Oracle ADF Applications Introduction to Oracle ADF Applications

1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.3 1.3.1 1.3.2 1.3.2.1 1.3.2.2 1.3.3 1.3.4 1.3.4.1 1.3.4.2 1.3.4.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4

Introduction to Oracle ADF....................................................................................................... 1-1 Framework Architecture and Supported Technologies........................................................ 1-1 View Layer Technologies Supported................................................................................ 1-2 Controller Layer Technologies Supported....................................................................... 1-3 Business Services Technologies Supported by ADF Model .......................................... 1-3 Recommended Technologies for Enterprise 4GL Developers ...................................... 1-3 Declarative Development with Oracle ADF and JavaServer Faces..................................... 1-4 Declarative Data Access and Validation with ADF Business Components................ 1-4 Declarative User Interface Design and Page Navigation with JavaServer Faces ....... 1-5 Declarative User Interface Design with JSF.............................................................. 1-5 Declarative Page Navigation with JSF....................................................................... 1-7 Declarative Data Binding with Oracle ADF Model Layer............................................. 1-8 Simple, Event-Driven Approach to Add Custom Logic ................................................ 1-9 Simple-to-Handle Events in the Controller Layer ................................................ 1-10 Simple-to-Handle Events in the Business Service Layer ..................................... 1-11 Simple to Globally Extend Basic Framework Functionality ............................... 1-12 Highlights of Additional ADF Features ............................................................................... 1-13 Comprehensive JDeveloper Design-Time Support ..................................................... 1-14 Sophisticated AJAX-Style Web Pages Without Coding .............................................. 1-16 Centralized, Metadata-Driven Functionality................................................................ 1-17 Generation of Complete Web Tier Using Oracle JHeadstart ..................................... 1-17

iii

2

Overview of Development Process with Oracle ADF and JSF2.1 2.2 2.3 2.4 2.5 2.5.1 2.5.2 2.5.3 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.7 2.8 2.9 2.10 2.11 2.12 2.12.1 2.12.2 2.13 2.13.1 2.13.2 2.13.3 2.13.4 2.13.5 2.14 Introduction to the Development Process............................................................................... 2-1 Creating an Application Workspace to Hold Your Files ...................................................... 2-2 Thinking About the Use Case and Page Flow ........................................................................ 2-3 Designing the Database Schema ............................................................................................... 2-5 Creating a Layer of Business Domain Objects for Tables ..................................................... 2-5 Dragging and Dropping to Reverse-Engineer Entity Objects for Tables .................... 2-6 Adding Business Validation Rules to Your Entity Object ............................................. 2-6 Defining UI Control Hints for Your Entity Objects ........................................................ 2-9 Building the Business Service to Handle the Use Case ......................................................... 2-9 Creating a Application Module to Manage Technicians ............................................... 2-9 Creating View Objects to Query Appropriate Data for the Use Case....................... 2-10 Using View Objects in the Application Module's Data Model .................................. 2-13 Testing Your Service......................................................................................................... 2-15 The Data Control for Your Application Module Enables Data Binding .................. 2-17 Dragging and Dropping Data to Create a New JSF Page .................................................. 2-18 Examining the Binding Metadata Files Involved................................................................ 2-21 Understanding How Components Reference Bindings via EL......................................... 2-22 Configuring Binding Properties If Needed.......................................................................... 2-23 Understanding How Bindings Are Created at Runtime.................................................... 2-24 Making the Display More Data-Driven ................................................................................ 2-24 Hiding and Showing Groups of Components Based on Binding Properties .......... 2-24 Toggling Between Alternative Sets of Components Based on Binding Properties. 2-25 Adding the Edit Page and Finishing the Use Case ............................................................. 2-27 Adding Another View Object to the Data Model ........................................................ 2-27 Creating the Edit Page ..................................................................................................... 2-28 Synchronizing the Search and Edit Page....................................................................... 2-29 Controlling Whether Data Appears Initially ................................................................ 2-30 Running the Final Result ................................................................................................. 2-30 Considering How Much Code Was Involved ..................................................................... 2-31

3

Oracle ADF Service Request Demo Overview3.1 3.1.1 3.1.2 3.2 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.3 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 Introduction to the Oracle ADF Service Request Demo ....................................................... 3-1 Requirements for Oracle ADF Service Request Application......................................... 3-2 Overview of the Schema ..................................................................................................... 3-2 Setting Up the Oracle ADF Service Request Demo ............................................................... 3-4 Downloading and Installing the Oracle ADF Service Request Application............... 3-4 Installing the Oracle ADF Service Request Schema ....................................................... 3-5 Creating the Oracle JDeveloper Database Connection .................................................. 3-7 Running the Oracle ADF Service Request Demo in JDeveloper .................................. 3-8 Running the Oracle ADF Service Request Demo Unit Tests in JDeveloper ............ 3-10 Quick Tour of the Oracle ADF Service Request Demo ...................................................... 3-11 Customer Logs In and Reviews Existing Service Requests ........................................ 3-12 Customer Creates a Service Request.............................................................................. 3-14 Manager Logs In and Assigns a Service Request......................................................... 3-17 Manager Views Reports and Updates Technician Skills ............................................ 3-19 Technician Logs In and Updates a Service Request .................................................... 3-22

iv

Part II 4

Building Your Business Services

Overview of ADF Business ComponentsPrescriptive Approach and Reusable Code for Business Services....................................... 4-1 What are ADF Business Components and What Can They Do? ......................................... 4-2 Relating ADF Business Components to Familiar 4GL Tools................................................ 4-4 Familiar Concepts for Oracle Forms Developers ............................................................ 4-4 Familiar Concepts for PeopleTools Developers .............................................................. 4-6 Familiar Concepts for SiebelTools Developers................................................................ 4-7 Familiar Functionality for ADO.NET Developers .......................................................... 4-8 Overview of ADF Business Components Implementation Architecture ........................... 4-8 Based on Standard Java and XML..................................................................................... 4-8 Works with Any Application Server or Database .......................................................... 4-9 Implements All of the J2EE Design Patterns You Need................................................. 4-9 Components are Organized into Packages ...................................................................... 4-9 Architecture of the Base ADF Business Components Layer ...................................... 4-11 Components Are Metadata-Driven With Optional Custom Java Code ................... 4-11 Example of an XML-Only Component................................................................... 4-11 Example of a Component with Custom Java Class .............................................. 4-12 Recommendations for Configuring ADF Business Components Design Time Preferences ........................................................................................................................ 4-13 4.4.7.1 Recommendation for Initially Disabling Custom Java Generation ................... 4-13 4.4.7.2 Recommendation for Disabling Use of Package XML File ................................. 4-14 4.4.8 Basic Datatypes ................................................................................................................. 4-14 4.4.9 Generic Versus Strongly-Typed APIs ............................................................................ 4-15 4.4.10 Client-Accessible Components Can Have Custom Interfaces ................................... 4-16 4.4.10.1 Framework Client Interfaces for Components...................................................... 4-16 4.4.10.2 Custom Client Interfaces for Components ............................................................ 4-16 4.5 Understanding the Active Data Model................................................................................. 4-17 4.5.1 What is an Active Data Model? ...................................................................................... 4-17 4.5.2 Examples of the Active Data Model In Action ............................................................. 4-17 4.5.3 Active Data Model Allows You to Eliminate Most Client-Side Code ...................... 4-18 4.6 Overview of ADF Business Components Design Time Facilities..................................... 4-19 4.6.1 Choosing a Connection, SQL Flavor, and Type Map .................................................. 4-19 4.6.2 Creating New Components Using Wizards ................................................................. 4-20 4.6.3 Quick-Creating New Components Using the Context Menu .................................... 4-20 4.6.4 Editing Components Using the Component Editor .................................................... 4-21 4.6.5 Visualizing, Creating, and Editing Components Using UML Diagrams ................. 4-21 4.6.6 Testing Application Modules Using the Business Components Browser................ 4-21 4.6.7 Refactoring Components ................................................................................................. 4-21 4.1 4.2 4.3 4.3.1 4.3.2 4.3.3 4.3.4 4.4 4.4.1 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.6.1 4.4.6.2 4.4.7

5

Querying Data Using View Objects5.1 5.2 5.2.1 5.2.2 Introduction to View Objects .................................................................................................... Creating a Simple, Read-Only View Object ............................................................................ How to Create a Read-Only View Object......................................................................... What Happens When You Create a Read-Only View Object ....................................... 5-1 5-2 5-2 5-5

v

5.2.3 What You May Need to Know About View Objects ...................................................... 5-5 5.2.3.1 Editing an Existing View Object Definition.............................................................. 5-5 5.2.3.2 Working with Queries That Include SQL Expressions ........................................... 5-5 5.2.3.3 Controlling the Length, Precision, and Scale of View Object Attributes ............. 5-6 5.3 Using a View Object in an Application Module's Data Model ............................................ 5-6 5.3.1 How to Create an Application Module ............................................................................ 5-7 5.3.1.1 Understanding the Difference Between View Object Components and View Object Instances......................................................................................................................... 5-8 5.3.2 What Happens When You Create an Application Module ........................................ 5-10 5.3.3 What You May Need to Know About Application Modules..................................... 5-11 5.3.3.1 Editing an Application Module's Runtime Configuration Properties............... 5-11 5.4 Defining Attribute Control Hints .......................................................................................... 5-12 5.4.1 How to Add Attribute Control Hints ............................................................................ 5-12 5.4.2 What Happens When You Add Attribute Control Hints ........................................... 5-13 5.4.3 What You May Need to Know About Message Bundles............................................ 5-14 5.5 Testing View Objects Using the Business Components Browser ..................................... 5-14 5.5.1 How to Test a View Object Using the Business Components Browser .................... 5-14 5.5.2 What Happens When You Use the Business Components Browser......................... 5-15 5.5.3 What You May Need to Know About the Business Components Browser ............. 5-16 5.5.3.1 Customizing Configuration Options for the Current Run .................................. 5-16 5.5.3.2 Enabling ADF Business Components Debug Diagnostics .................................. 5-17 5.6 Working Programmatically with View Object Query Results .......................................... 5-18 5.6.1 Common Methods for Working with the View Objects Default RowSet ............... 5-18 5.6.2 Counting the Number of Rows in a RowSet................................................................. 5-19 5.7 How to Create a Command-Line Java Test Client.............................................................. 5-19 5.7.1 What Happens When You Run a Test Client Program............................................... 5-21 5.7.2 What You May Need to Know About Running a Test Client.................................... 5-22 5.8 Filtering Results Using Query-By-Example View Criteria ................................................ 5-22 5.8.1 How to Use View Criteria to Filter View Object Results ............................................ 5-22 5.8.2 What Happens When You Use View Criteria to Filter View Object Results........... 5-24 5.8.3 What You May Need to Know About Query-By-Example Criteria.......................... 5-24 5.8.3.1 Use Attribute Names in View Criteria, Column Names in WHERE Clause.... 5-24 5.8.3.2 Testing View Criteria in the Business Component Browser ............................... 5-25 5.8.3.3 Altering Compound Search Conditions Using Multiple View Criteria Rows . 5-25 5.8.3.4 Searching for a Row Whose Attribute Value is NULL Value ............................. 5-26 5.8.3.5 Searching Case-Insensitively ................................................................................... 5-26 5.8.3.6 Clearing View Criteria in Effect .............................................................................. 5-26 5.8.3.7 Applying View Criteria Causes Query to be Re-parsed...................................... 5-26 5.9 Using Named Bind Variables................................................................................................. 5-26 5.9.1 Adding a Named Bind Variable ..................................................................................... 5-26 5.9.2 What Happens When You Add Named Bind Variables............................................. 5-27 5.9.3 What You May Need to Know About Named Bind Variables .................................. 5-28 5.9.3.1 Errors Related to Bind Variables ............................................................................. 5-28 5.9.3.2 Bind Variables Default to NULL If No Default Supplied.................................... 5-29 5.9.3.3 Setting Existing Bind Variable Values at Runtime ............................................... 5-29 5.9.3.4 Adding a Named Bind Variable at Runtime ......................................................... 5-30 5.9.3.5 Understanding the Default Use of Inline Views for Read-Only Queries.......... 5-32

vi

5.10 Working with Master/Detail Data........................................................................................ 5.10.1 How to Create a Read-Only View Object Joining Tables ........................................... 5.10.1.1 Using the Query Builder to Simplify Creating Joins ............................................ 5.10.1.2 Testing the Join View ................................................................................................ 5.10.2 How to Create Master/Detail Hierarchies Using View Links ................................... 5.10.3 What Happens When You Create Master/Detail Hierarchies Using View Links.. 5.10.4 What You May Need to Know About View Links ...................................................... 5.10.4.1 View Link Accessor Attributes Return a RowSet ................................................. 5.10.4.2 How to Access a Detail Collection Using the View Link Accessor.................... 5.10.4.3 How to Enable Active Master/Detail Coordination in the Data Model ........... 5.11 Generating Custom Java Classes for a View Object ........................................................... 5.11.1 How To Generate Custom Classes................................................................................. 5.11.1.1 Generating Bind Variable Accessors....................................................................... 5.11.1.2 Generating View Row Attribute Accessors ........................................................... 5.11.1.3 Exposing View Row Accessors to Clients.............................................................. 5.11.1.4 Configuring Default Java Generation Preferences ............................................... 5.11.2 What Happens When You Generate Custom Classes................................................. 5.11.2.1 Seeing and Navigating to Custom Java Files ........................................................ 5.11.3 What You May Need to Know About Custom Classes .............................................. 5.11.3.1 About the Framework Base Classes for a View Object ........................................ 5.11.3.2 You Can Safely Add Code to the Custom Component File ................................ 5.11.3.3 Attribute Indexes and InvokeAccessor Generated Code ....................................

5-33 5-34 5-34 5-36 5-36 5-38 5-38 5-39 5-39 5-41 5-43 5-43 5-44 5-45 5-45 5-46 5-46 5-47 5-47 5-47 5-48 5-48

6

Creating a Business Domain Layer Using Entity Objects6.1 6.2 6.2.1 6.2.2 6.2.2.1 6.2.3 6.2.4 6.2.5 6.2.6 6.2.6.1 6.2.7 6.2.8 6.3 6.3.1 6.3.1.1 6.3.1.2 6.3.2 6.3.3 6.4 6.4.1 6.4.1.1 6.4.2 Introduction to Entity Objects................................................................................................... 6-1 Creating Entity Objects and Associations ............................................................................... 6-2 How to Create Entity Objects and Associations from Existing Tables ........................ 6-2 What Happens When You Create Entity Objects and Associations from Existing Tables..................................................................................................................................... 6-4 What Happens When a Table Has No Primary Key ............................................... 6-5 Creating Entity Objects Using the Create Entity Wizard............................................... 6-6 Creating an Entity Object for a Synonym or View ......................................................... 6-6 Editing an Existing Entity Object or Association ............................................................ 6-6 Creating Database Tables from Entity Objects................................................................ 6-6 Using Database Key Constraints for an Association............................................... 6-7 Synchronizing an Entity with Changes to Its Database Table ...................................... 6-7 What You May Need to Know About Creating Entities................................................ 6-7 Creating and Configuring Associations .................................................................................. 6-8 How to Create an Association ........................................................................................... 6-8 Changing Entity Association Accessor Names ..................................................... 6-10 Renaming and Moving Associations to a Different Package.............................. 6-10 What Happens When You Create an Association ....................................................... 6-11 What You May Need to Know About Composition Associations ............................ 6-11 Creating an Entity Diagram for Your Business Layer ........................................................ 6-12 How to Create an Entity Diagram.................................................................................. 6-12 Publishing the Business Entity Diagram................................................................ 6-13 What Happens When You Create an Entity Diagram ................................................ 6-13

vii

6.4.3 What You May Need to Know About Creating Entities On a Diagram................... 6.4.3.1 UML Diagram is Actively Synchronized with Business Components.............. 6.4.3.2 UML Diagram Adds Extra Metadata to XML Component Descriptors ........... 6.5 Defining Attribute Control Hints .......................................................................................... 6.5.1 How to Add Attribute Control Hints ............................................................................ 6.5.2 What Happens When You Add Attribute Control Hints ........................................... 6.5.3 Internationalizing the Date Format................................................................................ 6.6 Configuring Declarative Runtime Behavior ........................................................................ 6.6.1 How To Configure Declarative Runtime Behavior ..................................................... 6.6.2 What Happens When You Configure Declarative Runtime Behavior ..................... 6.6.3 About the Declarative Entity Object Features .............................................................. 6.6.3.1 Legal Database and Java Data types for an Entity Object Attribute .................. 6.6.3.2 Indicating Datatype Length, Precision, and Scale ................................................ 6.6.3.3 Controlling the Updatability of an Attribute ........................................................ 6.6.3.4 Making an Attribute Mandatory............................................................................. 6.6.3.5 Defining the Primary Key for the Entity ................................................................ 6.6.3.6 Defining a Static Default Value ............................................................................... 6.6.3.7 Synchronization with Trigger-Assigned Values................................................... 6.6.3.8 Trigger-Assigned Primary Key Values from a Database Sequence ................... 6.6.3.9 Lost Update Protection ............................................................................................. 6.6.3.10 History Attributes...................................................................................................... 6.6.3.11 Setting the Discriminator Attribute for Entity Object Inheritance Hierarchies 6.6.3.12 Understanding and Configuring Composition Behavior.................................... 6.7 Using Declarative Validation Rules ...................................................................................... 6.7.1 How to Add a Validation Rule ....................................................................................... 6.7.2 What Happens When You Add a Validation Rule ...................................................... 6.7.3 What You May Need to Know About Validation Rules............................................. 6.7.3.1 Understanding the Built-in Entity-Level Validators ............................................ 6.7.3.2 Understanding the Built-in Attribute-Level Validators....................................... 6.7.3.3 Caveat About the List Validator.............................................................................. 6.8 Working Programmatically with Entity Objects and Associations .................................. 6.8.1 Finding an Entity Object by Primary Key ..................................................................... 6.8.2 Accessing an Associated Entity Using the Accessor Attribute .................................. 6.8.3 Updating or Removing an Existing Entity Row........................................................... 6.8.4 Creating a New Entity Row ............................................................................................ 6.8.5 Testing Using a Static Main Method.............................................................................. 6.9 Generating Custom Java Classes for an Entity Object........................................................ 6.9.1 How To Generate Custom Classes................................................................................. 6.9.1.1 Choosing to Generate Entity Attribute Accessors ................................................ 6.9.2 What Happens When You Generate Custom Classes................................................. 6.9.3 Seeing and Navigating to Custom Java Files................................................................ 6.9.4 What You May Need to Know About Custom Java Classes...................................... 6.9.4.1 About the Framework Base Classes for an Entity Object .................................... 6.9.4.2 You Can Safely Add Code to the Custom Component File ................................ 6.9.4.3 Configuring Default Java Generation Preferences ............................................... 6.9.4.4 Attribute Indexes and InvokeAccessor Generated Code .................................... 6.9.5 Programmatic Example for Comparison Using Custom Entity Classes ..................

6-14 6-14 6-14 6-15 6-15 6-16 6-16 6-17 6-17 6-18 6-19 6-19 6-20 6-20 6-20 6-21 6-21 6-21 6-22 6-23 6-23 6-24 6-24 6-26 6-26 6-27 6-28 6-29 6-29 6-29 6-30 6-30 6-31 6-33 6-34 6-36 6-38 6-38 6-39 6-40 6-40 6-41 6-41 6-41 6-41 6-41 6-44

viii

6.10 Adding Transient and Calculated Attributes to an Entity Object .................................... 6.10.1 How to Add a Transient Attribute................................................................................. 6.10.2 What Happens When You Add Transient Attribute................................................... 6.10.3 Adding Java Code in the Entity Class to Perform Calculation ..................................

6-47 6-47 6-48 6-48

7

Building an Updatable Data Model With Entity-Based View Objects7.1 Introduction to Entity-Based View Objects............................................................................. 7-1 7.2 Creating an Entity-Based View Object..................................................................................... 7-2 7.2.1 How to Create an Entity-Based View Object................................................................... 7-2 7.2.1.1 Creating a View Object Having All Attributes of an Entity Object ...................... 7-5 7.2.2 What Happens When You Create an Entity-Based View Object.................................. 7-6 7.2.3 Editing an Existing Entity-Based View Object Definition ............................................. 7-6 7.2.4 What You May Need to Know About View Objects ...................................................... 7-6 7.2.4.1 View Object Attributes Inherit Properties from Underlying Entity Object Attributes ....................................................................................................................... 7-6 7.3 Including Reference Entities in Join View Objects................................................................. 7-7 7.3.1 How to Include Reference Entities in a View Object...................................................... 7-8 7.3.1.1 Adding Additional Reference Entity Usages to the View Object.......................... 7-8 7.3.1.2 Selecting Additional Attributes from Reference Entity Usages ............................ 7-9 7.3.1.3 Renaming Attributes from Reference Entity Usages ........................................... 7-10 7.3.1.4 Removing Unnecessary Key Attributes from Reference Entity Usages............ 7-10 7.3.1.5 Hiding the Primary Key Attributes from Reference Entity Usages ................... 7-11 7.3.2 What Happens When You Reference Entities in a View Object ................................ 7-11 7.3.3 What You May Need to Know About Join View Objects ........................................... 7-12 7.3.3.1 Showing View Objects in a Business Components Diagram .............................. 7-12 7.3.3.2 Modify Default Join Clause to Be Outer Join When Appropriate...................... 7-13 7.4 Creating an Association-Based View Link........................................................................... 7-13 7.4.1 How to Create an Association-Based View Link ......................................................... 7-14 7.4.2 What Happens When You Create an Association-Based View Link ........................ 7-15 7.5 Testing Entity-Based View Objects Interactively ................................................................ 7-16 7.5.1 Overview of Business Component Browser Functionality for an Updatable Data Model ........................................................................................................................ 7-16 7.5.2 Adding View Object Instances to the Data Model....................................................... 7-16 7.5.3 How to Test Entity-Based View Objects Interactively ................................................ 7-17 7.5.4 What Happens When You Test Entity-Based View Objects Interactively ............... 7-17 7.5.5 Simulating End-User Interaction with Your Application Module Data Model ...... 7-19 7.5.5.1 Testing Master/Detail Coordination ...................................................................... 7-19 7.5.5.2 Testing UI Control Hints .......................................................................................... 7-19 7.5.5.3 Testing View Objects That Reference Entity Usages............................................ 7-19 7.5.5.4 Testing Business Domain Layer Validation........................................................... 7-20 7.5.5.5 Testing Alternate Language Message Bundles and Control Hints .................... 7-20 7.5.5.6 Testing Row Creation and Default Value Generation ......................................... 7-20 7.5.5.7 Testing New Detail Rows Have Correct Foreign Keys........................................ 7-20 7.6 Adding Calculated and Transient Attributes to an Entity-Based View Object .............. 7-21 7.6.1 How to Add a SQL-Calculated Attribute...................................................................... 7-21 7.6.2 What Happens When You Add a SQL-Calculated Attribute .................................... 7-22 7.6.3 How to Add a Transient Attribute................................................................................. 7-22

ix

7.6.3.1 Adding an Entity-Mapped Transient Attribute to a View Object...................... 7.6.4 What Happens When You Add a Transient Attribute................................................ 7.6.5 Adding Java Code in the View Row Class to Perform Calculation .......................... 7.6.6 What You May Need to Know About Transient Attributes....................................... 7.7 Understanding How View Objects and Entity Objects Cooperate at Runtime .............. 7.7.1 Each View Row or Entity Row Has a Related Key ...................................................... 7.7.2 What Role Does the Entity Cache Play in the Transaction ......................................... 7.7.3 Metadata Ties Together Cleanly Separated Roles of Data Source and Data Sink... 7.7.4 What Happens When a View Object Executes Its Query ........................................... 7.7.5 What Happens When You Modify a View Row Attribute......................................... 7.7.6 What Happens When You Change a Foreign Key Attribute ..................................... 7.7.7 What Happens When You Re-query Data .................................................................... 7.7.7.1 Unmodified Attributes in Entity Cache are Refreshed During Re-query ......... 7.7.7.2 Modified Attributes in Entity Cache are Left Intact During Re-query.............. 7.7.7.3 Overlapping Subsets of Attributes are Merged During Re-query ..................... 7.7.8 What Happens When You Commit the Transaction................................................... 7.7.9 Interactively Testing Multiuser Scenarios..................................................................... 7.8 Working Programmatically with Entity-Based View Objects ........................................... 7.8.1 Example of Iterating Master/Detail/Detail Hierarchy............................................... 7.8.2 Example of Finding a Row and Updating a Foreign Key Value ............................... 7.8.3 Example of Creating a New Service Request ............................................................... 7.8.4 Example of Retrieving the Row Key Identifying a Row ............................................. 7.9 Summary of Difference Between Entity-Based View Objects and Read-Only View Objects ....................................................................................................................................... 7.9.1 Runtime Features Unique to Entity-Based View Objects ........................................... 7.9.2 View Objects with No Entity Usage Are Read-Only................................................... 7.9.3 What You May Need to Know About Enabling View Object Key Management for Read-Only View Objects............................................................................................

7-23 7-23 7-24 7-24 7-24 7-25 7-26 7-27 7-28 7-29 7-31 7-31 7-32 7-32 7-33 7-33 7-34 7-34 7-34 7-36 7-38 7-39 7-40 7-40 7-40 7-41

8

Implementing Business Services with Application Modules8.1 Introduction to Application Modules ...................................................................................... 8.2 Creating an Application Module.............................................................................................. 8.2.1 Creating an Application Module....................................................................................... 8.2.2 What Happens When You Create an Application Module ........................................... 8.2.3 Editing an Existing Application Module.......................................................................... 8.2.4 Configuring Your Application Module Database Connection ..................................... 8.2.4.1 Using a JDBC URL Connection Type ........................................................................ 8.2.4.2 Using a JDBC Datasource Connection Type............................................................. 8.2.5 Managing Your Application Module's Runtime Configurations ................................. 8.2.6 What You Might Need to Know About Application Module Connections................ 8.2.6.1 The Business Components Browser Requires a JDBC URL Connection.............. 8.2.6.2 Testing the SRService Application Module in the Business Components Browser .......................................................................................................................... 8.3 Adding a Custom Service Method ........................................................................................... 8.3.1 How to Generate a Custom Class for an Application Module ..................................... 8.3.2 What Happens When You Generate a Custom Class for an Application Module .... 8.3.3 What You May Need to Know About Default Code Generation ................................. 8-1 8-2 8-3 8-3 8-3 8-3 8-4 8-4 8-6 8-6 8-6 8-6 8-6 8-7 8-7 8-8

x

8.3.4 Debugging the Application Module Using the Business Components Tester ........... 8-9 8.3.5 How to Add a Custom Service Method to an Application Module............................. 8-9 8.4 Publishing Custom Service Methods to Clients .................................................................. 8-10 8.4.1 How to Publish Custom Service Methods to Clients .................................................. 8-11 8.4.2 What Happens When You Publish Custom Service Methods to Clients ................. 8-11 8.4.3 How to Generate Client Interfaces for View Objects and View Rows...................... 8-12 8.4.4 What You May Need to Know About Method Signatures on the Client Interface 8-13 8.4.5 What You May Need to Know About Passing Information from the Data Model 8-13 8.5 Working Programmatically with an Application Module's Client Interface.................. 8-14 8.5.1 How to Work Programmatically with an Application Module's Client Interface .. 8-14 8.5.2 What Happens When You Work with an Application Module's Client Interface.. 8-16 8.5.3 How to Access an Application Module Client Interface............................................. 8-16 8.5.3.1 How to Access an Application Module Client Interface in a JSF Web Application ................................................................................................................. 8-17 8.5.3.2 How to Access an Application Module Client Interface in a JSP/Struts Web Application ........................................................................................................ 8-19 8.5.3.3 How to Access an Application Module Client Interface in an ADF Swing Application ................................................................................................................. 8-19 8.6 Overriding Built-in Framework Methods ............................................................................ 8-19 8.6.1 How to Override a Built-in Framework Method ......................................................... 8-20 8.6.2 What Happens When You Override a Built-in Framework Method........................ 8-20 8.6.3 How to Override prepareSession() to Set Up an Application Module for a New User Session....................................................................................................................... 8-21 8.7 Creating an Application Module Diagram for Your Business Service ............................ 8-23 8.7.1 How to Create an Application Module Diagram......................................................... 8-23 8.7.2 What Happens When You Create an Application Module Diagram ....................... 8-23 8.7.3 What You May Need to Know About Application Module Diagrams .................... 8-24 8.7.3.1 Using the Diagram for Editing the Application Module..................................... 8-24 8.7.3.2 Controlling Display Options.................................................................................... 8-24 8.7.3.3 Filtering Method Names........................................................................................... 8-25 8.7.3.4 Show Related Objects and Implementation Files ................................................. 8-25 8.7.3.5 Publishing the Application Module Diagram ....................................................... 8-26 8.7.3.6 Testing the Application Module From the Diagram............................................ 8-26 8.8 Supporting Multipage Units of Work................................................................................... 8-26 8.8.1 Overview of Application Module Pooling and State Management.......................... 8-26 8.8.2 Experimenting with State Management in the Business Components Browser ..... 8-27 8.9 Deciding on the Granularity of Application Modules ....................................................... 8-28 8.9.1 Use Cases Assist in Planning Your Application Modules.......................................... 8-28 8.9.2 Application Modules Are Designed to Support Assembly........................................ 8-29 8.9.3 Root Application Modules Versus Nested Application Module Usages ................. 8-30

9

Implementing Programmatic Business Rules in Entity Objects9.1 Introduction to Programmatic Business Rules ....................................................................... 9.2 Understanding the Validation Cycle ....................................................................................... 9.2.1 Types of Entity Object Validation Rules .......................................................................... 9.2.1.1 Attribute-Level Validation Rules ............................................................................... 9.2.1.2 Entity-Level Validation Rules..................................................................................... 9-1 9-2 9-2 9-3 9-3

xi

Understanding Commit Processing and Validation ...................................................... 9-3 Avoiding Infinite Validation Cycles ................................................................................. 9-4 What Happens When Validations Fail ............................................................................. 9-4 Understanding Entity Objects Row States ....................................................................... 9-4 Using Method Validators........................................................................................................... 9-5 How to Create an Attribute-Level Method Validation .................................................. 9-5 What Happens When You Create an Attribute-Level Method Validator................... 9-6 How to Create an Entity-Level Method Validator.......................................................... 9-7 What Happens When You Create an Entity-Level Method Validator ........................ 9-8 What You Might Need To Know About Translating Validation Rule Error Messages ............................................................................................................................... 9-8 9.3.6 What You May Need to Know About Referencing the Invalid Value in an Attribute-Level Validation Error Message....................................................................... 9-8 9.4 Assigning Programmatically-Derived Attribute Values....................................................... 9-8 9.4.1 Defaulting Values for New Rows at Create Time........................................................... 9-8 9.4.1.1 Choosing Between create() and initDefaults() Methods......................................... 9-9 9.4.1.2 Eagerly Defaulting an Attribute Value from a Database Sequence ...................... 9-9 9.4.2 Assigning Derived Values Before Saving ........................................................................ 9-9 9.4.3 Assigning Derived Values When an Attribute Value is Set ....................................... 9-10 9.5 Undoing Pending Changes to an Entity Using the Refresh Method ............................... 9-11 9.5.1 Controlling What Happens to New Rows During a Refresh ..................................... 9-11 9.5.2 Cascading Refresh to Composed Children Entity Rows ............................................ 9-11 9.6 Using View Objects for Validation ........................................................................................ 9-11 9.6.1 Creating View Objects at Runtime for Validation ....................................................... 9-11 9.6.2 Implementing an Efficient Existence Check ................................................................. 9-13 9.6.3 Validating Conditions Related to All Entities of a Given Type ................................. 9-14 9.7 How to Access Related Entity Rows Using Association Accessors.................................. 9-15 9.8 How to Reference Information About the Authenticated User ........................................ 9-16 9.8.1 Referencing Role Information About the Authenticated User................................... 9-16 9.8.2 Referencing the Name of the Authenticated User ....................................................... 9-17 9.9 How to Access Original Attribute Values ............................................................................ 9-18 9.10 How to Store Information About the Current User Session.............................................. 9-18 9.11 How to Access the Current Date and Time.......................................................................... 9-19 9.12 How to Send Notifications Upon a Successful Commit..................................................... 9-20 9.13 How to Conditionally Prevent an Entity Row from Being Removed .............................. 9-20 9.14 How to Implement Conditional Updatability for Attributes ............................................ 9-20 9.15 Additional Resources .............................................................................................................. 9-21 9.2.2 9.2.3 9.2.4 9.2.5 9.3 9.3.1 9.3.2 9.3.3 9.3.4 9.3.5

10

Overview of Application Module Data Binding10.1 Overview of Data Controls and Declarative Bindings ....................................................... 10.1.1 Data Controls Abstract the Implementation Technology of a Business Service ..... 10.1.2 Bindings Connect UI Controls to Data Collections and Operations ......................... 10.2 Understanding the Application Module Data Control ...................................................... 10.3 How an Application Module Appears in the Data Control Palette ................................. 10.3.1 Overview of the SRService Application Module ......................................................... 10.3.2 How to Change the Data Control Name Before You Begin Building Pages............ 10.3.3 How the Data Model and Service Methods Appear in the Data Control Palette ... 10-1 10-1 10-2 10-3 10-3 10-4 10-4 10-5

xii

10.3.4 How to Change View Instance Names Before You Begin Building Pages............... 10.3.5 How Transaction Control Operations Appear in the Data Control Palette............. 10.3.6 How View Objects Appear in the Data Control Palette.............................................. 10.3.6.1 Built-in Operations for View Object Data Collections ......................................... 10.3.7 How Nested Application Modules Appear in the Data Control Palette.................. 10.4 How to Add a Create Button on a Page.............................................................................. 10.4.1 What Happens When You Drop a Create Button on a Web Page........................... 10.4.2 What Happens When You Drop a Create Operation Onto a Swing Panel ............ 10.4.3 When to Use CreateInsert Instead of Create............................................................... 10.4.4 What You May Need to Know About Create and CreateInsert .............................. 10.5 Application Module Databinding Tips and Techniques.................................................. 10.5.1 How to Create a Record Status Display ...................................................................... 10.5.2 How to Work with Named View Object Bind Variables .......................................... 10.5.3 How to Use Find Mode to Implement Query-by-Example...................................... 10.5.4 How to Customize the ADF Page Lifecycle to Work Programmatically with Bindings ........................................................................................................................... 10.5.4.1 Globally Customizing the ADF Page Lifecycle................................................... 10.5.4.2 Customizing the Page Lifecycle for a Single Page.............................................. 10.5.4.3 Using Custom ADF Page Lifecycle to Invoke an onPageLoad Backing Bean Method ...................................................................................................................... 10.5.5 How to Use Refresh Correctly for InvokeAction and Iterator Bindings ................ 10.5.5.1 Correctly Configuring the Refresh Property of Iterator Bindings.................... 10.5.5.2 Refreshing an Iterator Binding Does Not Forcibly Re-Execute Query ............ 10.5.5.3 Correctly Configuring Refresh Property of InvokeAction Executables .......... 10.5.6 Understanding the Difference Between setCurrentRowWithKey and setCurrentRowWithKeyValue ...................................................................................... 10.5.7 Understanding Bundled Exception Mode .................................................................. 10.6 Overview of How SRDemo Pages Use the SRService ...................................................... 10.6.1 The SRList Page............................................................................................................... 10.6.1.1 Overview of Data Binding in the SRList Page .................................................... 10.6.1.2 Business Service Notes for the SRList Page ......................................................... 10.6.2 The SRMain Page ............................................................................................................ 10.6.2.1 Overview of Data Binding in the SRMain Page.................................................. 10.6.2.2 Business Service Notes for the SRMain Page ...................................................... 10.6.3 The SREdit Page.............................................................................................................. 10.6.3.1 Overview of Data Binding in the SREdit Page.................................................... 10.6.3.2 Business Service Notes for the SREdit Page ........................................................ 10.6.4 The SRSearch Page.......................................................................................................... 10.6.4.1 Overview of Data Binding in the SRSearch Page ............................................... 10.6.4.2 Business Service Notes for the SRSearch Page .................................................... 10.6.5 The SRStaffSearch Page ................................................................................................. 10.6.5.1 Overview of Data Binding in the SRStaffSearch Page ....................................... 10.6.5.2 Business Service Notes for the SRStaffSearch Page............................................ 10.6.6 The SRManage Page ....................................................................................................... 10.6.6.1 Overview of Data Binding in the SRManage Page............................................. 10.6.6.2 Business Service Notes for the SRManage Page ................................................. 10.6.7 The SRSkills Page............................................................................................................

10-6 10-7 10-7 10-8 10-9 10-10 10-10 10-11 10-11 10-11 10-12 10-12 10-13 10-15 10-16 10-16 10-17 10-17 10-19 10-19 10-20 10-20 10-21 10-23 10-23 10-23 10-23 10-24 10-24 10-24 10-25 10-26 10-26 10-27 10-28 10-28 10-29 10-29 10-29 10-30 10-31 10-31 10-32 10-32

xiii

10.6.7.1 10.6.7.2 10.6.8 10.6.8.1 10.6.8.2 10.6.9 10.6.9.1 10.6.9.2

Overview of Data Binding in the SRSkills Page.................................................. Business Service Notes for the SRSkills Page ...................................................... The SRCreate Page.......................................................................................................... Overview of Data Binding in the SRCreate Page................................................ Business Service Notes for the SRCreate Page .................................................... The SRConfirmCreate Page........................................................................................... Overview of Data Binding in the SRConfirmCreate Page................................. Business Service Notes for the SRCreate Page ....................................................

10-32 10-33 10-35 10-35 10-36 10-36 10-36 10-37

Part III 11

Building Your Web Interface

Getting Started with ADF Faces11.1 Introduction to ADF Faces...................................................................................................... 11.2 Setting Up a Workspace and Project ..................................................................................... 11.2.1 What Happens When You Use an Application Template to Create a Workspace . 11.2.1.1 Starter web.xml File................................................................................................... 11.2.1.2 Starter faces-config.xml File ..................................................................................... 11.2.2 What You May Need to Know About the ViewController Project ........................... 11.2.3 What You May Need to Know About Multiple JSF Configuration Files ................. 11.3 Creating a Web Page ............................................................................................................. 11.3.1 How to Add a JSF Page.................................................................................................. 11.3.2 What Happens When You Create a JSF Page ............................................................. 11.3.3 What You May Need to Know About Using the JSF Navigation Diagram ........... 11.3.4 What You May Need to Know About ADF Faces Dependencies and Libraries... 11.4 Laying Out a Web Page......................................................................................................... 11.4.1 How to Add UI Components to a JSF Page ................................................................ 11.4.2 What Happens When You First Insert an ADF Faces Component ......................... 11.4.2.1 More About the web.xml File ................................................................................ 11.4.2.2 More About the faces-config.xml File................................................................... 11.4.2.3 Starter adf-faces-config.xml File............................................................................ 11.4.3 What You May Need to Know About Creating JSF Pages ....................................... 11.4.3.1 Editing in the Structure Window .......................................................................... 11.4.3.2 Displaying Errors..................................................................................................... 11.4.4 Using the PanelPage Component................................................................................. 11.4.4.1 PanelPage Facets...................................................................................................... 11.4.4.2 Page Body Contents ................................................................................................ 11.5 Creating and Using a Backing Bean for a Web Page ........................................................ 11.5.1 How to Create and Configure a Backing Bean........................................................... 11.5.2 What Happens When You Create and Configure a Backing Bean.......................... 11.5.3 How to Use a Backing Bean in a JSF Page................................................................... 11.5.4 How to Use the Automatic Component Binding Feature ........................................ 11.5.5 What Happens When You Use Automatic Component Binding in JDeveloper... 11.5.6 What You May Need to Know About Backing Beans and Managed Beans .......... 11.5.7 Using ADF Data Controls and Backing Beans ........................................................... 11.6 Best Practices for ADF Faces ................................................................................................ 11-1 11-3 11-4 11-5 11-7 11-8 11-9 11-10 11-10 11-12 11-13 11-14 11-14 11-15 11-16 11-18 11-19 11-20 11-21 11-22 11-23 11-24 11-26 11-29 11-30 11-31 11-32 11-33 11-33 11-34 11-35 11-37 11-38

xiv

12

Displaying Data on a Page12.1 Introduction to Displaying Data on a Page.......................................................................... 12.2 Using the Data Control Palette .............................................................................................. 12.2.1 How to Understand the Items on the Data Control Palette ....................................... 12.2.2 How to Use the Data Control Palette............................................................................. 12.2.3 What Happens When You Use the Data Control Palette ........................................... 12.2.4 What Happens at Runtime .............................................................................................. 12.3 Working with the DataBindings.cpx File ............................................................................ 12.3.1 How to Create a DataBindings.cpx File ........................................................................ 12.3.2 What Happens When You Create a DataBindings.cpx File ..................................... 12.4 Configuring the ADF Binding Filter ................................................................................... 12.4.1 How to Configure the ADF Binding Filter.................................................................. 12.4.2 What Happens When You Configure an ADF Binding Filter.................................. 12.4.3 What Happens at Runtime ............................................................................................ 12.5 Working with Page Definition Files .................................................................................... 12.5.1 How to Create a Page Definition File .......................................................................... 12.5.2 What Happens When You Create a Page Definition File ......................................... 12.5.2.1 Binding Objects Defined in the parameters Element ......................................... 12.5.2.2 Binding Objects Defined in the executables Element......................................... 12.5.2.3 Binding Objects Defined in the bindings Element.............................................. 12.5.3 What Happens at Runtime ............................................................................................ 12.5.4 What You May Need to Know About Binding Container Scope ............................ 12.6 Creating ADF Data Binding EL Expressions ..................................................................... 12.6.1 How to Create an ADF Data Binding EL Expression................................................ 12.6.2 How to Use the Expression Builder ............................................................................. 12.6.3 What Happens When You Create ADF Data Binding Expressions ........................ 12.6.3.1 EL Expressions That Reference Attribute Binding Objects ............................... 12.6.3.2 EL Expressions That Reference Table Binding Objects...................................... 12.6.3.3 EL Expressions That Reference Action Binding Objects.................................... 12.6.4 What You May Need to Know About ADF Binding Properties.............................. 12-1 12-2 12-3 12-6 12-7 12-8 12-9 12-9 12-10 12-10 12-10 12-11 12-12 12-12 12-12 12-13 12-14 12-15 12-18 12-19 12-19 12-20 12-20 12-21 12-24 12-24 12-24 12-25 12-27

13

Creating a Basic Page13.1 Introduction to Creating a Basic Page................................................................................... 13.2 Using Attributes to Create Text Fields.................................................................................. 13.2.1 How to Use the Data Control Palette to Create a Text Field ...................................... 13.2.2 What Happens When You Use the Data Control Palette to Create a Text Field..... 13.2.2.1 Creating and Using Iterator Bindings ................................................................... 13.2.2.2 Creating and Using Value Bindings ....................................................................... 13.2.2.3 Using EL Expressions to Bind UI Components ................................................... 13.2.3 What Happens at Runtime: The JSF and ADF Lifecycles ........................................... 13.3 Creating a Basic Form.............................................................................................................. 13.3.1 How to Use the Data Control Palette to Create a Form .............................................. 13.3.2 What Happens When You Use the Data Control Palette to Create a Form........... 13.3.2.1 Using Facets.............................................................................................................. 13.4 Incorporating Range Navigation into Forms..................................................................... 13.4.1 How to Insert Navigation Controls into a Form ........................................................ 13-1 13-2 13-2 13-3 13-3 13-4 13-5 13-6 13-9 13-9 13-11 13-11 13-12 13-13

xv

What Happens When Command Buttons Are Created Using the Data Control Palette ............................................................................................................................... 13.4.2.1 Using Action Bindings for Built-in Navigation Operations.............................. 13.4.2.2 Iterator RangeSize Attribute .................................................................................. 13.4.2.3 Using EL Expressions to Bind to Navigation Operations ................................. 13.4.3 What Happens at Runtime: About Action Events and Action Listeners ............... 13.4.4 What You May Need to Know About the Browser Back Button............................. 13.5 Creating a Form to Edit an Existing Record ...................................................................... 13.5.1 How to Use the Data Control Palette to Create Edit Forms ..................................... 13.5.2 What Happens When You Use Built-in Operations to Change Data ..................... 13.6 Creating an Input Form ........................................................................................................ 13.6.1 How to Create an Input Form....................................................................................... 13.6.2 What Happens When You Create an Input Form...................................................... 13.6.3 What You May Need to Know About Displaying Sequence Numbers.................. 13.6.4 What You May Need to Know About Create Forms and the RefreshCondition.. 13.7 Modifying the UI Components and Bindings on a Form ................................................ 13.7.1 How to Modify the UI Components and Bindings.................................................... 13.7.1.1 Changing the Value Binding for a UI Component ............................................. 13.7.1.2 Changing the Action Binding for a UI Component............................................ 13.7.2 What Happens When You Modify Attributes and Bindings ................................... 13.4.2

13-14 13-14 13-14 13-15 13-16 13-17 13-18 13-18 13-19 13-21 13-21 13-22 13-23 13-24 13-25 13-25 13-26 13-26 13-27

14

Adding Tables14.1 Introduction to Adding Tables .............................................................................................. 14.2 Creating a Basic Table ............................................................................................................. 14.2.1 How to Create a Basic Table............................................................................................ 14.2.2 What Happens When You Use the Data Control Palette to Create a Table ............ 14.2.2.1 Iterator and Value Bindings for Tables .................................................................. 14.2.2.2 Code on the JSF Page for an ADF Faces Table ...................................................... 14.3 Incorporating Range Navigation into Tables....................................................................... 14.3.1 How to Use Navigation Controls in a Table................................................................. 14.3.2 What Happens When You Use Navigation Controls in a Table................................ 14.3.3 What Happens at Runtime .............................................................................................. 14.3.4 What You May Need to Know About the Browser Back Button............................... 14.4 Modifying the Attributes Displayed in the Table ............................................................... 14.4.1 How to Modify the Displayed Attributes .................................................................. 14.4.2 How to Change the Binding for a Table...................................................................... 14.4.3 What Happens When You Modify Bindings or Displayed Attributes ................... 14.5 Adding Hidden Capabilities to a Table.............................................................................. 14.5.1 How to Use the DetailStamp Facet .............................................................................. 14.5.2 What Happens When You Use the DetailStamp Facet ............................................. 14.5.3 What Happens at Runtime ............................................................................................ 14.6 Enabling Row Selection in a Table ...................................................................................... 14.6.1 How to Use the TableSelectOne Component in the Selection Facet ....................... 14.6.2 What Happens When You Use the TableSelectOne Component ............................ 14.6.3 What Happens at Runtime ............................................................................................ 14.6.4 What You May Need to Know About Using Links Instead of the Selection Facet .................................................................................................................................. 14-1 14-2 14-2 14-4 14-5 14-5 14-7 14-8 14-8 14-9 14-9 14-9 14-10 14-11 14-12 14-12 14-12 14-13 14-14 14-14 14-16 14-17 14-17 14-17

xvi

14.6.5 How to Use the TableSelectMany Component in the Selection Facet .................... 14.6.6 What Happens When You Use the TableSelectMany Component ......................... 14.6.7 What Happens at Runtime ............................................................................................ 14.7 Setting the Current Object Using a Command Component ............................................ 14.7.1 How to Manually Set the Current Row....................................................................... 14.7.2 What Happens When You Set the Current Row........................................................ 14.7.3 What Happens At Runtime...........................................................................................

14-18 14-19 14-21 14-22 14-23 14-23 14-24

15

Displaying Master-Detail Data15.1 Introduction to Displaying Master-Detail Data................................................................... 15.2 Identifying Master-Detail Objects on the Data Control Palette ........................................ 15.3 Using Tables and Forms to Display Master-Detail Objects ............................................... 15.3.1 How to Display Master-Detail Objects in Tables and Forms ..................................... 15.3.2 What Happens When You Create Master-Detail Tables and Forms ........................ 15.3.2.1 Code Generated in the JSF Page .............................................................................. 15.3.2.2 Binding Objects Defined in the Page Definition File............................................ 15.3.3 What Happens at Runtime .............................................................................................. 15.3.4 What You May Need to Know About Master-Detail on Separate Pages ................. 15.4 Using Trees to Display Master-Detail Objects ..................................................................... 15.4.1 How to Display Master-Detail Objects in Trees ......................................................... 15.4.2 What Happens When You Create ADF Databound Trees ....................................... 15.4.2.1 Code Generated in the JSF Page ............................................................................ 15.4.2.2 Binding Objects Defined in the Page Definition File.......................................... 15.4.3 What Happens at Runtime ............................................................................................ 15.4.4 What You May Need to Know About Adding Command Links to Tree Nodes .. 15.5 Using Tree Tables to Display Master-Detail Objects ........................................................ 15.5.1 How to Display Master-Detail Objects in Tree Tables .............................................. 15.5.2 What Happens When You Create a Databound Tree Table..................................... 15.5.2.1 Code Generated in the JSF Page ............................................................................ 15.5.2.2 Binding Objects Defined in the Page Definition File.......................................... 15.5.3 What Happens at Runtime ............................................................................................ 15.6 Using an Inline Table to Display Detail Data in a Master Table..................................... 15.6.1 How to Display Detail Data Using an Inline Table ................................................... 15.6.2 What Happens When You Create an Inline Detail Table ........................................ 15.6.2.1 Code Generated in the JSF Page ............................................................................ 15.6.2.2 Binding Objects Defined in the Page Definition File.......................................... 15.6.3 What Happens at Runtime ........................................................................................... 15-1 15-2 15-4 15-5 15-6 15-6 15-7 15-8 15-9 15-9 15-10 15-13 15-13 15-14 15-15 15-15 15-17 15-18 15-18 15-19 15-19 15-19 15-20 15-21 15-22 15-23 15-23 15-24

16

Adding Page Navigation16.1 Introduction to Page Navigation ........................................................................................... 16.2 Creating Navigation Rules ..................................................................................................... 16.2.1 How to Create Page Navigation Rules .......................................................................... 16.2.1.1 About Navigation Rule Elements ........................................................................... 16.2.1.2 Using the Navigation Modeler to Define Navigation Rules ............................... 16.2.1.3 Using the JSF Configuration Editor ........................................................................ 16.2.2 What Happens When You Create a Navigation Rule ................................................. 16-1 16-2 16-2 16-2 16-3 16-5 16-8

xvii

16.2.3 What Happens at Runtime ............................................................................................ 16.2.4 What You May Need to Know About Navigation Rules and Cases....................... 16.2.4.1 Defining Rules in Multiple Configuration Files.................................................. 16.2.4.2 Overlapping Rules................................................................................................... 16.2.4.3 Conflicting Navigation Rules ................................................................................ 16.2.4.4 Splitting Navigation Cases Over Multiple Rules................................................ 16.2.5 What You May Need to Know About the Navigation Modeler.............................. 16.3 Using Static Navigation ........................................................................................................ 16.3.1 How to Create Static Navigation.................................................................................. 16.3.2 What Happens When You Create Static Navigation................................................. 16.4 Using Dynamic Navigation.................................................................................................. 16.4.1 How to Create Dynamic Navigation ........................................................................... 16.4.2 What Happens When You Create Dynamic Navigation .......................................... 16.4.3 What Happens at Runtime ............................................................................................ 16.4.4 What You May Need to Know About Using Default Cases .................................... 16.4.5 What You May Need to Know About Action Listener Methods ............................ 16.4.6 What You May Need to Know About Data Control Method Outcome Returns ..

16-10 16-11 16-11 16-11 16-12 16-12 16-13 16-14 16-14 16-15 16-16 16-17 16-18 16-19 16-20 16-20 16-21

17

Creating More Complex Pages17.1 Introduction to More Complex Pages................................................................................... 17.2 Using a Managed Bean to Store Information....................................................................... 17.2.1 How to Use a Managed Bean to Store Information ..................................................... 17.2.2 What Happens When You Create a Managed Bean.................................................... 17.3 Creating Command Components to Execute Methods ..................................................... 17.3.1 How to Create a Command Component Bound to a Service Method...................... 17.3.2 What Happens When You Create Command Components Using a Method ......... 17.3.2.1 Using Parameters in a Method ................................................................................ 17.3.2.2 Using EL Expressions to Bind to Methods ............................................................ 17.3.3 What Happens at Runtime .............................................................................................. 17.4 Setting Parameter Values Using a Command Component ............................................... 17.4.1 How to Set Parameters Using Command Components.............................................. 17.4.2 What Happens When You Set Parameters ................................................................... 17.4.3 What Happens at Runtime .............................................................................................. 17.5 Overriding Declarative Methods........................................................................................... 17.5.1 How to Override a Declarative Method........................................................................ 17.5.2 What Happens When You Override a Declarative Method..................................... 17-1 17-2 17-2 17-3 17-4 17-5 17-5 17-5 17-6 17-7 17-7 17-7 17-8 17-8 17-8 17-9 17-12

18

Creating a Search Form18.1 Introduction to Creating Search Forms ................................................................................ 18.2 Creating a EnterQuery/ExecuteQuery Search Form.......................................................... 18.2.1 How to Create an EnterQuery/ExecuteQuery Search Page ...................................... 18.2.2 What Happens When You Create a Search Form ........................................................ 18.3 Creating a Web-type Search Form......................................................................................... 18.3.1 How to Create a Search Form and Separate Results Page.......................................... 18.3.2 What Happens When You Create A Web-type Search Form..................................... 18.3.3 What You May Need to Know........................................................................................ 18.3.4 About Creating Search and Results on the Same Page ............................................... 18-1 18-3 18-4 18-5 18-6 18-6 18-7 18-8 18-8

xviii

18.3.5 How To Create Search and Results on the Same Page................................................ 18.3.6 What Happens When Search and Results are on the Same Page .............................. 18.4 Creating Search Page Using Named Bind Variables ........................................................ 18.4.1 How to Create a Parameterized Search Form ............................................................ 18.4.2 What Happens When You Use Parameter Methods ................................................. 18.4.3 What Happens at Runtime ............................................................................................ 18.5 Conditionally Displaying the Results Table on a Search Page........................................ 18.5.1 How to Add Conditional Display Capabilities .......................................................... 18.5.2 What Happens When you Conditionally Display the Results Table......................

18-8 18-9 18-10 18-11 18-11 18-13 18-14 18-15 18-16

19

Using Complex UI Components19.1 Introduction to Complex UI Components ........................................................................... 19.2 Using Dynamic Menus for Navigation................................................................................. 19.2.1 How to Create Dynamic Navigation Menus ................................................................ 19.2.1.1 Creating a Menu Model............................................................................................ 19.2.1.2 Creating the JSF Page for Each Menu Item.......................................................... 19.2.1.3 Creating the JSF Navigation Rules........................................................................ 19.2.2 What Happens at Runtime ............................................................................................ 19.2.3 What You May Need to Know About Menus ............................................................ 19.3 Using Popup Dialogs............................................................................................................. 19.3.1 How to Create Popup Dialogs ...................................................................................... 19.3.1.1 Defining a JSF Navigation Rule for Launching a Dialog................................... 19.3.1.2 Creating the JSF Page That Launches a Dialog .................................................. 19.3.1.3 Creating the Dialog Page and Returning a Dialog Value.................................. 19.3.1.4 Handling the Return Value .................................................................................... 19.3.1.5 Passing a Value into a Dialog ................................................................................ 19.3.2 How the SRDemo Popup Dialogs Are Created ......................................................... 19.3.3 What You May Need to Know About ADF Faces Dialogs....................................... 19.3.4 Other Information........................................................................................................... 19.4 Enabling Partial Page Rendering......................................................................................... 19.4.1 How to Enable PPR ........................................................................................................ 19.4.2 What Happens at Runtime ............................................................................................ 19.4.3 What You May Need to Know About PPR and Screen Readers ............................. 19.5 Creating a Multipage Process .............................................................................................. 19.5.1 How to Create a Process Train...................................................................................... 19.5.1.1 Creating a Process Train Model ............................................................................ 19.5.1.2 Creating the JSF Page for Each Train Node ......................................................... 19.5.1.3 Creating the JSF Navigation Rules........................................................................ 19.5.2 What Happens at Runtime ............................................................................................ 19.5.3 What You May Need to Know About Process Trains and Menus .......................... 19.6 Providing File Upload Capability ....................................................................................... 19.6.1 How to Support File Uploading on a Page ................................................................. 19.6.2 What Happens at Runtime ............................................................................................ 19.6.3 What You May Need to Know About ADF Faces File Upload ............................... 19.6.4 Configuring File Uploading Initialization Parameters ............................................. 19.6.5 Configuring a Custom Uploaded File Processor ....................................................... 19.7 Creating Selection Lists ......................................................................................................... 19-1 19-2 19-3 19-3 19-13 19-16 19-17 19-18 19-19 19-21 19-22 19-23 19-24 19-27 19-28 19-29 19-33 19-33 19-33 19-35 19-36 19-36 19-37 19-38 19-39 19-43 19-45 19-46 19-46 19-47 19-49 19-52 19-53 19-53 19-54 19-55

xix

19.7.1 How to Create a List with a Fixed List of Values....................................................... 19.7.2 What Happens When You Create a List Bound to a Fixed List of Values ............. 19.7.3 How to Create a List with a Dynamic List of Values ................................................ 19.7.4 What Happens When You Create a List Bound to a Dynamic List of Values ....... 19.7.5 How to Create a List with Navigation List Binding .................................................. 19.7.6 What Happens When You Create a List With Navigation List Binding ................ 19.8 Creating a Shuttle................................................................................................................... 19.8.1 How to Create a Shuttle................................................................................................. 19.8.2 What Happens at Runtime ............................................................................................

19-55 19-58 19-59 19-61 19-63 19-64 19-65 19-67 19-71

20

Using Validation and Conversion20.1 Introduction to Validation and Conversion......................................................................... 20.2 Validation, Conversion, and the Application Lifecycle ..................................................... 20.3 Adding Validation ................................................................................................................... 20.3.1 How to Add Validation ................................................................................................... 20.3.1.1 Adding ADF Faces Validation................................................................................. 20.3.1.2 Adding ADF Model Validation .............................................................................. 20.3.2 What Happens When You Create Input Fields Using the Data Control Palette..... 20.3.3 What Happens at Runtime ............................................................................................ 20.3.4 What You May Need to Know........................


Recommended