SlideShare a Scribd company logo
Oracle Application Framework
      Developer's Guide


         Release 12.1.3




           July 2010
OAF Developer Guide 13.1.3
Table of Contents
ORACLE APPLICATION FRAMEWORK DEVELOPER'S GUIDE, RELEASE 12.1.3.................................17

  Preface .................................................................................................................................17

  Oracle Application Framework Support Guidelines for Customers ................................20

CHAPTER 1: GETTING STARTED ..................................................................................................25

  Introduction to OA Framework ...........................................................................................25

  Setting Up Your Development Environment ......................................................................33

      Customer, Consultant or Support Representative Using JDeveloper on Windows ............ 33

      Customer, Consultant or Support Representative Using JDeveloper on Linux .................. 36

  Building and Running 'Hello, World!' .................................................................................40

  OA Framework Development Runtime Configuration.......................................................71

CHAPTER 2: OA FRAMEWORK ESSENTIALS .................................................................................75

  JSP Application Primer .......................................................................................................75

  Anatomy of an OA Framework Page ..................................................................................86

      Page Basics ...................................................................................................................... 86

      The Model ......................................................................................................................... 87

      The View........................................................................................................................... 92

      The Controller ................................................................................................................... 98

      Web Bean Architecture ................................................................................................... 103

      Guide to OA Framework Javadoc ................................................................................... 105

  OA Framework State Management ...................................................................................109

      Architectural Overview .................................................................................................... 109

      Root Application Modules (Database Session and Transaction State) ............................ 110

      Servlet Session ............................................................................................................... 115


                                                                                                                                           3
Oracle Application Framework Developer's Guide


       Oracle E-Business Suite User Session ........................................................................... 116

       Page Context .................................................................................................................. 117

       Request .......................................................................................................................... 120

       State Persistence Model ('Passivation') .......................................................................... 122

       Application Module Pooling ............................................................................................. 122

CHAPTER 3: BUILDING AN OA FRAMEWORK APPLICATION (THE BASICS) ....................................125

    Implementing the Model....................................................................................................125

       Designing Model Objects ................................................................................................ 125

       Recommended Build Approach ...................................................................................... 127

       Business Components Packages.................................................................................... 128

       Entity Objects.................................................................................................................. 128

       Entity Associations (Association Objects) ....................................................................... 135

       View Objects and View Rows ......................................................................................... 138

       View Links ...................................................................................................................... 147

       Application Modules ........................................................................................................ 150

       Entity Objects, Entity Experts, 'Validation' Application Modules and 'Validation' View
       Objects ........................................................................................................................... 165

          Validation View Objects ............................................................................................... 165

          Validation Application Modules (VAMs) ....................................................................... 165

          Entity Experts .............................................................................................................. 166

       Reusing Business Objects .............................................................................................. 167

    Implementing the View ......................................................................................................169

       Designing the User Interface........................................................................................... 169

       Pages ............................................................................................................................. 170

       Reusable Components ................................................................................................... 172

4
Table of Contents


   Attribute Sets .................................................................................................................. 176

   URL Parameters: Tokens, Encryption, Encoding ............................................................ 180

   Style Sheets ................................................................................................................... 182

   Accessibility .................................................................................................................... 183

   Internationalization .......................................................................................................... 183

   Model Interaction ............................................................................................................ 184

   Menus and Page Security ............................................................................................... 191

Implementing the Controller .............................................................................................196

   Designing an OA Controller ............................................................................................ 196

   Creating an OA Controller ............................................................................................... 199

   Handling an HTTP GET .................................................................................................. 202

      Modifying Bean Properties .......................................................................................... 204

      Creating Beans Programmatically ............................................................................... 206

   Handling an HTTP POST (Form Submit) ........................................................................ 209

   Model Interaction ............................................................................................................ 213

   Disabling Validation ........................................................................................................ 218

   Javascript ....................................................................................................................... 220

Error Handling ...................................................................................................................221

Creating Attribute Sets......................................................................................................239

   Designing Attribute Sets ................................................................................................. 239

   Creating Attribute Set Packages Manually ...................................................................... 240

   Creating Attribute Sets Manually ..................................................................................... 240

   Generating Attribute Sets Automatically (Only on Linux) ................................................. 240

Internationalization............................................................................................................246



                                                                                                                                       5
Oracle Application Framework Developer's Guide


       User Preferences ............................................................................................................ 246

       Language........................................................................................................................ 247

       Timezone ........................................................................................................................ 248

       Client Character Encoding .............................................................................................. 249

       Date and Time ................................................................................................................ 249

       Numbers/Currency .......................................................................................................... 252

       Text and Component Alignment ...................................................................................... 255

       Localized Layouts ........................................................................................................... 256

       Calendar Support............................................................................................................ 256

       Character Encoding of BC4J XML Files .......................................................................... 258

    Files in a Typical OA Framework Application..................................................................259

CHAPTER 4: IMPLEMENTING SPECIFIC UI FEATURES ..................................................................263

    Accelerator Keys ('Hot Keys') ...........................................................................................263

    Attachments .......................................................................................................................266

    Auto-Repeating Layout (ARL) ...........................................................................................300

    BI Publisher Integration - Printing A Report From Within an OA Framework Page ......305

    Bound Values ....................................................................................................................307

    Branding.............................................................................................................................318

    Bulleted List .......................................................................................................................325

    Buttons (Action/Navigation) .............................................................................................329

    Buttons (Global) ................................................................................................................342

    Charts and Graphs ............................................................................................................352

    Component-Level Function Security (Dynamic User Interface) .....................................381

    Concurrent Processing: Request Submission and Monitoring......................................409



6
Table of Contents


Content Containers ...........................................................................................................416

Contextual Information .....................................................................................................420

Controlling UIX Rendering Output ...................................................................................423

Custom HTML ....................................................................................................................427

Daily Business Intelligence / OA Framework Integration ...............................................431

Data Export ........................................................................................................................436

Date Picker .........................................................................................................................443

Declarative Page Flow .......................................................................................................449

Dialog Pages ......................................................................................................................465

Dynamic User Interface .....................................................................................................381

File Upload and Download ................................................................................................470

Flexfields ............................................................................................................................475

Forms / OA Framework Page Integration.........................................................................508

Headers and Subheaders ..................................................................................................512

HGrid ..................................................................................................................................520

Hide/Show ..........................................................................................................................539

Images in Your Pages .......................................................................................................551

Include Content (URL and Servlet) ...................................................................................560

Inline Messaging, Tips, Hints and Bubble Text ...............................................................563

Instruction Text..................................................................................................................569

Links ...................................................................................................................................572

List of Values (LOV) ..........................................................................................................576

Locator Element: Breadcrumbs .......................................................................................606

Locator Element: Page/Record Navigation......................................................................620



                                                                                                                                          7
Oracle Application Framework Developer's Guide


    Locator Element: Train......................................................................................................632

    Message Box .....................................................................................................................637

    Mobile Applications...........................................................................................................642

    Notifications (Workflow Worklist).....................................................................................643

    Page Access Tracking.......................................................................................................647

    Page Contents Bottom Line (the 'Ski') .............................................................................650

    Page Footer........................................................................................................................652

    Page Layout (How to Place Content) ...............................................................................655

    Page Security .....................................................................................................................676

    Page Stamps ......................................................................................................................686

    Partial Page Rendering (Dynamic User Interface) ...........................................................381

    Personalizable Pages ........................................................................................................691

       Creating a Configurable Page ......................................................................................... 691

       Creating an End-User Personalizable Page .................................................................... 708

       Developer Information for Admin-Level Personalizations ................................................ 709

       OA Framework Personalization Caveats......................................................................... 713

    Pop-Ups .............................................................................................................................714

    Portlets ...............................................................................................................................721

    Printable Page ...................................................................................................................730

    Processing Page................................................................................................................733

    Quick Links ........................................................................................................................739

    Record History ...................................................................................................................742

    Related Links / Shortcuts..................................................................................................748

    Rich Content Container.....................................................................................................751



8
Table of Contents


  Rich Text Editor .................................................................................................................757

  Save Model ('Warn About Changes') ................................................................................770

  Separator Line ...................................................................................................................775

  Search ................................................................................................................................777

  Shuttle ................................................................................................................................837

  Standard Web Widgets......................................................................................................844

  Submitting the Form..........................................................................................................862

  SubTab Navigation ............................................................................................................870

  Switchers (Application and Context) ...............................................................................878

  Tables - Advanced .............................................................................................................882

  Tables - Classic .................................................................................................................947

  Tabs / Navigation .............................................................................................................1009

  Tree...................................................................................................................................1030

CHAPTER 5: IMPLEMENTING SERVER-SIDE FEATURES ..............................................................1045

  Java Entity Objects .........................................................................................................1045

     Create ............................................................................................................................1046

     Update / Validate ...........................................................................................................1059

     Delete ............................................................................................................................1068

     Lock ...............................................................................................................................1072

     Rollback .........................................................................................................................1074

     Transaction Undo ..........................................................................................................1077

     Object Version Number Column.....................................................................................1080

     Standard WHO Columns ...............................................................................................1084

     Error Handling................................................................................................................1084



                                                                                                                                           9
Oracle Application Framework Developer's Guide


     Entity Experts, Validation Applications Modules and Validation View Objects ................1084

     Calling PL/SQL Functions and Procedures ....................................................................1087

     Entity Objects for Translatable (_TL) Tables ..................................................................1089

     Standard Validation Patterns and Examples ..................................................................1091

  PL/SQL Entity Object Design and Development ...........................................................1097

     Create ............................................................................................................................1098

     Insert .............................................................................................................................1100

     Lock ...............................................................................................................................1102

     Update / Validate ...........................................................................................................1105

     Delete ............................................................................................................................1107

     Rollback .........................................................................................................................1110

     WHO Column Support ...................................................................................................1110

     Error Handling................................................................................................................1110

     PL/SQL Entity Objects for _TL Tables ...........................................................................1111

  Business Service Objects ...............................................................................................1112

     Business Service Objects Architecture...........................................................................1112

     Business Service Objects in Detail.................................................................................1121

     Developing Services ......................................................................................................1134

     Methods in Detail ..........................................................................................................1176

     Testing Services ............................................................................................................1191

     Deploying Services ........................................................................................................1206

     Using Services ...............................................................................................................1207

     Service FAQ ..................................................................................................................1227

     Oracle Application Web Services ...................................................................................1229



10
Table of Contents


  RESTful Service Interface ...............................................................................................1233

  View Objects in Detail .....................................................................................................1246

  Application Modules in Detail .........................................................................................1273

  Entity Object and View Object Attribute Setters ...........................................................1281

CHAPTER 6: ADVANCED OA FRAMEWORK DEVELOPMENT TOPICS ............................................1291

  Supporting the Browser Back Button ............................................................................1291

  Browser Back Button Support Use Cases .....................................................................1316

  OA Framework State Persistence Model (Passivation) ................................................1372

  Advanced Java Entity Object Development Topics ......................................................1403

  Controlling UIX Rendering Output .................................................................................1417

  OA Framework and AOL/J Caching ...............................................................................1421

  Application Module and Connection Pooling ................................................................1422

  Advanced View Object Development Topics .................................................................1440

  JTT/OA Framework Interoperability ...............................................................................1463

  Cross-Site Scripting ........................................................................................................1470

  Accelerated Validation ....................................................................................................1473

CHAPTER 7: TESTING AND DEBUGGING ...................................................................................1489

  Discovering Page, Technology Stack and Session Information ..................................1489

  Inspecting the MDS Repository Content........................................................................1500

  Debugging OA Framework Applications .......................................................................1509

     JDeveloper Debugging ..................................................................................................1509

     Remote Debugging w/ Apache Installation.....................................................................1511

     Remote Debugging w/ Quik Apache ..............................................................................1513

     Examining Page Content ...............................................................................................1513



                                                                                                                               11
Oracle Application Framework Developer's Guide


     Examining the Validation Failure Message Log Output ..................................................1514

  Logging ............................................................................................................................1517

  Testing .............................................................................................................................1523

     Running in 'Test' Modes .................................................................................................1523

     Using the Business Component Browser (BC4J Tester) ................................................1533

     Verifying HTML Page Size .............................................................................................1534

     Verifying SQL Performance (Enabling a Database Trace) .............................................1535

     Monitoring the Application Monitor / JDBC Connection Pools ........................................1536

     Running Oracle Accessibility Checker (OAC).................................................................1536

CHAPTER 8: STANDARDS AND GUIDELINES ..............................................................................1537

  Oracle E-Business Suite Java Coding Standards .........................................................1537

  OA Framework File Standards (Naming, Package Structure and Standard Content).1544

  OA Framework Model Coding Standards ......................................................................1570

  OA Framework View Coding Standards.........................................................................1594

  OA Framework Controller Coding Standards ................................................................1608

CHAPTER 9: EXTENDING AND DEPLOYING OA FRAMEWORK APPLICATIONS ..............................1621

  Extending OA Framework Applications .........................................................................1621

  Deploying Customer Extensions ....................................................................................1632

  Deploying Personalizations ............................................................................................1640

CHAPTER 10: INTEGRATING WITH OTHER PRODUCTS ...............................................................1655

  Portlets ...............................................................................................................................721

  Integrating with Oracle ADF............................................................................................1655

  Embedding OBIEE Analytics in an OA Framework Page .............................................1656

  BI Publisher Integration - Printing A Report From Within an OA Framework Page ......305



12
Table of Contents


   JTT/OA Framework Interoperability ...............................................................................1463

   Forms / OA Framework Page Integration.........................................................................508

APPENDICES ..........................................................................................................................1657

   Summary of OA Component Properties ........................................................................1657

   Oracle Application Framework Profile Options .............................................................1658

   OA Framework ToolBox Technical Reference Manual (TRM) ......................................1688

   OA Framework Development Frequently Asked Questions (FAQ) ..............................1698

   OA Framework Known Key Issues Release 12..............................................................1699

   Oracle Application Framework Troubleshooting ..........................................................1708

   Oracle Application Framework URL Parameters...........................................................1709

   Oracle Application Framework Extensible Regions......................................................1715

   Oracle Application Framework: JDeveloper 9.0.3 IDE vs JDeveloper 10.1.3 IDE ........1716

   Sample Code....................................................................................................................1725

GLOSSARY .............................................................................................................................1731




                                                                                                                                      13
OAF Developer Guide 13.1.3
15
Oracle Application Framework Developer's Guide




16
Oracle Application Framework Developer's Guide, Release 12.1.3



Oracle Application Framework Developer's
Guide, Release 12.1.3
Preface
This manual describes how to set up your development environment, build, test and deploy
Oracle E-Business Suite OA Framework applications. It also includes the coding standards
followed by the Oracle E-Business Suite development staff, instructions for creating pages that
comply with the Oracle Browser Look and Feel (BLAF) UI Guidelines, and information on
extending the products shipped by Oracle E-Business Suite development.

Note: Some of the screenshots used in this Guide were captured using Release 11.5.10 which
displayed the BLAF Look-and-Feel. Although the colors and interface elements of these images
have the 11.5.10 appearance, the functionality that they illustrate also applies for Release 12
(and the Oracle Look-and-Feel).

Contents

   •   Audience
   •   Related Publications
   •   Typographic Conventions
   •   Send Us Your Comments

Audience
This documentation is written for the application developer and assumes familiarity with Java
and SQL.

Related Publications
Additional Oracle JDeveloper 10g helpsets that apply to OA Framework application
development include:

   •   OA Framework ToolBox Tutorial
   •   OA Component Reference
   •   Getting Started with the OA Extension
   •   Getting Started with JDeveloper
   •   Developing Business Components

As an application designer, you should also be familiar with the Oracle Browser Look and Feel
(BLAF) UI Guidelines and the documentation for the Oracle 10g Database.

For a full list of documentation resources for the Oracle E-Business Suite Release 12, see
Oracle E-Business Suite Documentation Resources, Release 12, OracleMetaLink Document
394692.1.


                                                                                                17
Oracle Application Framework Developer's Guide


Typographic Conventions
This manual uses the following typographic conventions to distinguish important elements from
the body of the manual.

Command and Example Syntax

Commands and examples appear in a monotype font, as follows:

Syntax:

OAPageContext.getParameter("<parameterName>");

Example:



/*
** Creates a SupplierEOImpl entity object and a corresponding row in
the SuppliersVO.

*/

public void createSupplier()
{
  OAViewObject vo = getSuppliersVO();
  vo.insertRow(vo.createRow());
}

Command and example syntax adhere to the following conventions:

Convention                        Explanation
plain monotype                    Used for code fragments and examples.
< Italic monotype in              Indicates developer-supplied values.
angle brackets >
...                               An ellipsis indicates that the actual code extends beyond the
                                  example shown.
/*                                A C-style comment.
*/
/**                               A Javadoc comment.
*/
//                                A Java comment.
Indentation                       Oracle standard indentation helps to show code structure.


Send Us Your Comments

18
Oracle Application Framework Developer's Guide, Release 12.1.3


Oracle Corporation welcomes your comments and suggestions on the quality and usefulness of
this manual. Your input is an important part of the information used for revisions.

   •   Did you find any errors?
   •   Is the information clearly presented?
   •   Do you need more information? If so, where?
   •   Are the examples correct? Do you need more examples?
   •   What features did you like most?

If you find any errors or have any other suggestions for improvement, please indicate the
document title, and the chapter, section, and page number (if available). You can send
comments to us in the following ways:

   •   Electronic mail: appsdoc_us@oracle.com
   •   FAX: (650) 506-7200 Attn: Oracle E-Business Suite Documentation Manager
   •   Postal service:

       Oracle Corporation
       Oracle E-Business Suite Documentation Manager
       500 Oracle Parkway
       Redwood Shores, CA 94065
       USA

If you would like a reply, please give your name, address, telephone number, and (optionally)
electronic mail address.

If you have problems with the software, please contact your local Oracle Support Services.




                                                                                                19
Oracle Application Framework Developer's Guide



Oracle Application Framework Support
Guidelines for Customers
Overview
The Oracle Application Framework Developer's Guide documents the extensive set of features
and capabilities made available by the Oracle Application Framework. The information included
in this book is intended to provide our customers with a complete understanding of the
technology, tools, and standards upon which OA Framework based applications in the E-
Business Suite are built.

With Release 12, we now provide customers with tools to perform certain types of
customizations to OA Framework based applications that were not available with prior releases.
In reviewing the capabilities and methods presented in this document, it is very important that
you take into consideration that the type of resources available to support your work, depend
upon the extent and type of customization that you are planning to perform.

This document is intended to provide guidelines to customers regarding what support options
will be available, primarily for customizations with OA Framework Release 12. We expect that
this document will be updated with additional information and details on an ongoing basis. The
most current version of this document is published in My Oracle Support Note 395441.1. Before
starting any customization work, it is essential that you review the latest version of this
document.

Contents

     •   Understanding the Support Options Available
     •   Important Limitations and Guidelines

Understanding the Available Support Options
Release 12 of the Oracle Application Framework (OA Framework) provides significant new
capabilities to perform personalizations, and extend OA Framework based web applications, in
a variety of ways. For a full description of available options, please refer to the Customization
Primer in the Oracle Applications Framework Personalization Guide. In this note, the use of the
term customizations collectively refers to those capabilities.

The objective of this note is to assist Oracle E-Business Suite customers with understanding the
level of support provided for the different types of customizations possible, including alternative
resources that are available for certain types of work, which fall beyond the scope of standard
support processes that customers may already be familiar with.

Personalizations

Personalizations performed within the scope of the OA Personalization Framework are a fully
supported means of customizing OA Framework based applications.

20
Oracle Application Framework Developer's Guide, Release 12.1.3


Due to its declarative nature and durable architecture, the OA Personalization Framework
continues to be recommended as the primary means for customizing OA Framework based
applications. The supported capabilities, methods and tools for performing personalizations are
documented in the Oracle Application Framework Personalization Guide. The most current
version of this Personalization guide is published in the Oracle E-Business Suite Documentation
Library, which is supplied on a physical CD in the Oracle E-Business Suite Release 12 software
bundle. This document may also be obtained in hard copy format from the Oracle Store.

Access the latest content from the Oracle E-Business Suite Online Documentation CD.

Methods or capabilities that not detailed in the Oracle Application Framework Personalization
Guide, fall beyond the scope of the OA Personalization Framework, and are not supported for
Oracle E-Business Suite installations.

Customers leveraging the capabilities of the OA Personalization Framework must ensure their
Release 12 instance is kept current with the latest OA Framework patchset applied. When
reporting issues against Personalization, Oracle Support will as a first step, require you to check
and confirm you have applied the most current patchset to ensure that the latest fixes for known
issues have been applied to your instance. You can find more information about the current
patchset, if available, including known issues addressed in that patchset by referring to the
Oracle Application Framework Documentation Resources, Release 12 (Metalink Note
391554.1).

Extensions

Release 12 of the OA Framework and the accompanying Oracle 10g JDeveloper release
provide features for developing a new class of Oracle applications extensions not available to
customers in prior releases.

Assistance with customer-developed extensions is available via the following resources:

   •   Oracle Application Framework Developer's Guide
       The Developer's Guide fully documents the capabilities of the Framework including
       instructions, examples and essential standards for implementing business-tier objects,
       UI components and server-side features. Specifically, Chapter 9 of the Developer's
       Guide under the section Extending OA Framework Applications, provides instructions on
       how to extend OA Framework based applications with custom business logic, including
       detailed guidelines for BC4J code extensions.
   •   Oracle Application Framework ToolBox Tutorial Application
       The ToolBox Tutorial application is a sample application accompanied by extensive
       examples with step-by-step instructions that demonstrate the usage of business objects
       and UI components to build OA Framework based application pages, against a simple
       Purchase Order type application schema, installed on your Release 12 instance.
       The ToolBox includes a specific tutorial lab on Extending OA Framework Applications.
   •   OA Framework Javadoc
       Documents all core Oracle Application Framework packages and classes, including UIX
       and BC4J objects extended by the Framework.
   •   OA Framework Discussion Forum on the Oracle Technology Network
       OTN (http://otn.oracle.com) hosts a discussion forum for OA Framework
       Extensions and the OA Extension to Oracle JDeveloper 10g. Navigate to OTN Forums

                                                                                                 21
Oracle Application Framework Developer's Guide


         under the E-Business Suite
         (http://forums.oracle.com/forums/index.jsp?cat=3). You can use the
         forum to post questions and exchange information with other customers on the OTN
         community working on extensions. The OA Framework Development team and Oracle
         Support will monitor and participate in some of the discussion threads on this forum.
         Additionally, you may also consider participating in the OTN JDeveloper forum for usage
         questions concerning Oracle JDeveloper 10g.
     •   Oracle E-Business Suite Product Documentation
         Some products may provide additional information on extending application specific
         business objects and functionality. Consult My Oracle Support
         (http://support.oracle.com) under the respective product for more information.

For issues logged with Oracle Support to address questions concerning OA Framework based
extensions or usage of the OA Extension tool, Oracle Support will evaluate the nature of the
question, and in most cases refer the customer to one or more of the resources outlined above.

Important Limitations and Guidelines
Before starting work on any customizations, it is essential that customers be aware of the
following limitations and guidelines:

     •   Customers who intend to work with Oracle JDeveloper 10g OA Extension, and develop
         extensions to their installed OA Framework-based self-service applications must use the
         specific build of the Oracle JDeveloper 10g that corresponds to the OA Framework
         Release 12 installed in their runtime environment.

         Please consult the corresponding "About Oracle E-Business Suite Technology
         Update" document for the JDeveloper ARU that corresponds to the Release 12
         ATG patchset you install.

     •   Oracle does not provide access to Java source code for OA Framework or products.
         You should consider the Developer's guide and available Javadoc for the classes you
         are working with as the only documented sources of information available to determine
         the characteristics of the object you are extending.
     •   Design-time options and expected run-time behavior of OA Framework components are
         fully documented in the Developer's Guide and Javadoc mentioned above.
     •   In order to log issues with Oracle Support concerning components, such as unexpected
         run-time behavior of a component, customers will be required to provide a simple
         reproducible test case written against the OA Framework ToolBox Tutorial schema or an
         E-Business Suite product schema. The test case must not rely on any custom schema
         elements or custom class libraries, and must be runnable by Oracle Support without any
         custom dependencies.
     •   Oracle does not recommend that customers extend controller objects associated with
         regions or web beans in shipped E-Business Suite product pages. Controller class
         (oracle.apps.fnd.framework.webui.OAControllerImpl) methods should
         effectively be considered private, since their implementation is subject to change.
         Controller extensions are therefore not considered to be durable between upgrades. If it
         is absolutely essential to handle custom form submit events on a shipped product page,



22
Oracle Application Framework Developer's Guide, Release 12.1.3


    processFormRequest() is the only method that should be overriden in a controller
    class, although the risks outlined above still apply.
•   Customers are fully responsible for all custom code written to support customer-
    developed extensions. Oracle Support and E-Business Suite development will not
    review custom code. Questions such as those relating to design, and usage of
    components to develop extensions, will generally be redirected to the OTN forums
    mentioned above.
•   To facilitate transparent upgrades and new feature uptake, custom code must comply
    with the Oracle E-Business Suite OA
    Framework coding standards described in Chapter 8 of the OA Framework Developer's
    Guide.

    Note: Information about the forthcoming passivation feature is provided throughout the
    Developer's Guide (including the coding standards) for preview/planning purposes only;
    passivation is not supported in Release 12.

•   Customers planning to undertake advanced or complex extension projects may consider
    engaging services available from Oracle Consulting or Oracle Partner resources. Oracle
    Consulting and Partner organizations offer an alternative means of support through
    consulting resources who have been specially trained or certified on OA Framework and
    Oracle E-Business Suite technology. For more information on what options are
    available, please refer to the information under Oracle Consulting Services
    (http://www.oracle.com/consulting) and the Oracle Partner Network
    (http://www.oracle.com/webapps/opus/pages/SimpleSearch.jsp).




                                                                                        23
Oracle Application Framework Developer's Guide




24
Oracle Application Framework Developer's Guide, Release 12.1.3



Chapter 1: Getting Started
Introduction to OA Framework
This document provides an overview of OA Framework and discusses:

   •   Architecture
   •   Key features
   •   Summary

Overview
Oracle Application Framework (OA Framework) is the Oracle E-Business Suite development
and deployment platform for HTML-based business applications. OA Framework consists of a
set of middle-tier runtime services and a design-time extension to Oracle JDeveloper called
Oracle E-Business Suite Extension (OA Extension).

During the first few years after the Internet evolution, the software industry witnessed an influx
of rapidly changing technologies. These technologies matured, yet there are still a myriad of
low-level and complex technologies that are hard to learn and implement. Under these
circumstances, OA Framework has emerged as an integrated platform for developing and
deploying Oracle E-Business Suite HTML-based applications, leveraging technological
advances without taking on associated complexity. Since its inception, OA Framework
embraces the following principles:

End User Productivity

The shift from client-server to multi-tier deployments comes with many cost savings, but not
without compromise. HTML-based applications started out very much like old mainframe
terminals; actions on the client side resulted in a round trip to the middle tier.

Over time, user interface interactivity improved. OA Framework has always kept user interface
interactivity a top priority with features such as partial page rendering (PPR), hot keys, smart
choice lists and auto-completion of fields with lists of values. In addition, Oracle focuses a
wealth of resources and expertise on user behavior and psychology, to develop a set of user
interface layout and interaction standards, commonly known as the BLAF (Browser-Look-And-
Feel) guidelines. BLAF is the default look and feel that all OA Framework applications assume,
but can be personalized in many ways to meet customer branding and style requirements. OA
Framework's implementation of BLAF standards yields a consistent user experience and further
enhances user productivity.

Enterprise-Grade Performance and Scalability

OA Framework has aggressive performance and scalability targets. Most Oracle E-Business
Suite application pages have sub-second response times to most user interactions. It takes a bit
longer the first time a page is accessed within the same Java Virtual Machine, but thereafter,
most of the commonly needed information (such as user information) is cached in the middle

                                                                                                 25
Oracle Application Framework Developer's Guide


tier, allowing faster response. Resources are conserved through a number of resource pooling
mechanisms and the swapping of idle resource data between memory and database.

Developer Productivity

OA Framework is designed around the simple Model-View-Controller (MVC) architecture. To
shield application developers from costs associated with the rapidly changing technological
landscape, Oracle has adopted a declarative flavor of the MVC architecture. Key building blocks
of an application are defined in a descriptive manner using a simple JDeveloper user interface
and then saved in an industry standard XML format. Oracle extends access and benefits of the
OA Framework development environment to all Oracle E-Business Suite customers and
partners. Customers and partners can leverage the proven OA Framework technology to add
extensions to their Oracle E-Business Suite applications.

Application Customizability

Oracle is able to exploit its twenty plus years of experience in building and deploying business
applications, to architect OA Framework with durable and economical customizations. Oracle
has kept that goal in focus and produced a very compelling solution with plenty of flexibility to
tailor the user interface (look-and-feel) and business logic. Thanks to the declarative and object
oriented nature of OA Framework, application personalization and extensibility is readily
available at a fraction of the industry startup cost and at a very minimal maintenance cost, if
any.

Open Standards

Oracle continues to be a champion of industry standards and an active participant in the
development of several emerging standards. OA Framework technologies have driven several
industry standards and have adopted several others as they were published. Several Oracle
technology architects are active members on a number of standards drafting committees. OA
Framework is J2EE based and features several industry standards such as XML, HTML, Java,
JSP, SQL and Web Services.

Architecture
OA Framework is based on the industry-standard J2EE MVC design pattern. Developers
manipulate the application's metadata using Oracle JDeveloper OA Extension, while OA
Framework uses the most efficient manner to execute the application. The MVC architecture is
a component-based design pattern with clean interfaces between the Model, View, and
Controller. The Model is where the application implements its business logic. The View is where
the application implements its user interface and the Controller is where the application handles
user interaction and directs business flow.

Figure 1: OA Framework MVC architecture.




26
Oracle Application Framework Developer's Guide, Release 12.1.3




OA Extension offers the following design time tools:

   •   UML tools to model and generate business logic.
   •   Guided user interface (and visual editors in a future release) to lay out client user
       interfaces.
   •   Code generation for Controller classes.

The OA Framework Model is implemented using Oracle Business Components for Java (BC4J).
BC4J provides optimized, ready-to-use implementations of the J2EE design patterns that
developers otherwise would have to code, debug, and test by hand. By leveraging BC4J's
combination of tested code and productivity tools inside the Oracle JDeveloper IDE,
development teams can focus immediately and only, on writing business logic and user
interfaces instead of on designing, coding, and debugging handcrafted application "plumbing"
code.

OA Framework View is implemented using UI XML (UIX). UIX uses XML to describe the
components and hierarchy that make up an application page. UIX also provides runtime

                                                                                               27
Oracle Application Framework Developer's Guide


capabilities to translate that metadata into HTML output so that it can be shown on a Browser or
a mobile device. The metadata used to describe the UI is loaded into a database repository,
called Meta Data Services (MDS), at deployment time and optionally at design time as well.

The OA Controller, which is a pure Java class implementation, handles user and application-
driven interactions. Simple page flows (such as a 2-step transaction) are implemented directly
into the Controller object; others are implemented using Oracle Workflow. In a future release,
business flows will be implemented in a declarative manner similar to that used to define model
and view objects.

Key Features
This section the following key features of OA Framework:

     •   Integrated development environment
     •   Durable personalizations and extensions
     •   Consistent and compelling user interface
     •   User interface interactivity
     •   Object oriented reuse
     •   Oracle portal interoperability
     •   Built-in security
     •   Deployment environment

Integrated Development Environment

Oracle JDeveloper with OA Extension (OA Extension) is a world-class J2EE-based integrated
development environment. Oracle customers and third party consultants have access to the
same tools used by Oracle E-Business Suite developers to build complementary applications as
well as extend the Oracle E-Business Suite applications. OA Extension provides features such
as easy-to-use wizards, a hierarchy navigator, and a property sheet. These features enable
developers to populate the metadata for declarative application business logic and user
interfaces. JDeveloper offers a wealth of productivity tools such as the UML modeler, code
coach, integrated debugger, local testing environment and documentation generator.

With the OA Extension software comes a wealth of documentation and learning aids including a
Developer's Guide, Javadoc, Online Help, a Sample Library and a rich set of Tutorials.

Durable Personalizations and Extensions

Personalization is about declaratively tailoring the UI look-and-feel, layout or visibility of page
content to suit a business need or a user preference. Examples of personalization include:

     •   Tailoring the color scheme of the UI.
     •   Tailoring the order in which table columns are displayed.
     •   Tailoring a query result

Extensibility is about extending the functionality of an application beyond what can be done
through personalization. Examples of extensibility include:


28
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   Adding new functional flows.
   •   Extending or overriding existing functional flows.
   •   Extending or overriding existing business logic.

OA Framework is designed with durable personalization and extensibility capabilities, achieved
through the declarative architecture and the underlying object oriented implementation.

Declarative UI component definitions are stored in the form of metadata in a database
repository. Personalizations are translated into offsets from the base metadata definition and
stored separately. At runtime, all applicable personalization metadata is loaded from the
repository and layered over the base metadata definition to produce the net effect. Product
upgrades and patching only affect the base metadata definition so that customer
personalizations are preserved and continue to function properly.

Personalizations can be implemented at several levels by one of three authors: application
developer, application administrator and end user.

An end-user can create a personalization to be applied to specific user interface components
that is only visible in the context of that authoring user. For example, an end user may save an
employee search result sorted by manager and hide the employee's date of birth column. Once
this personalized view is saved under a given name, the user can retrieve that view again in the
future by that name.

Application administrators and application developers have the flexibility to tailor the user
experience at several levels. They can author personalizations that affect all users, users of a
particular locale, users of a particular organization, users with a particular role and in the context
of a particular function. Several levels can apply at the same time with a predetermined
precedence order that yields a very personalized user experience.

Using a combination of OA Extension wizards and built-in personalization screens, several user
interface and business logic extensions are made possible at a minimal cost to development
with little-to-no maintenance cost. In addition, Oracle E-Business Suite customers continue to
enjoy the extensibility features offered by Oracle Flexfields, Oracle Workflow and Business
Events.

Consistent and Compelling User Interface

OA Framework offers developers a wide range of user interface components that make the
building of applications into a more assembly process, freeing developers from the repetitive
composition of common user interface constructs. Moreover, OA Framework's declarative
approach to building application user interfaces frees developers from the need to learn a vast
array of changing technologies, while offering end users a consistent application look and
experience. OA Framework user interface components range from simple widgets such as
buttons and fields to compound components such as tables-in-tables and hierarchical grids.

User Interface Interactivity

OA Framework is always exploring the technology frontiers to enrich the interactivity of HTML-
based user interfaces. Along those lines, OA Framework provides several features:

                                                                                                   29
Oracle Application Framework Developer's Guide


Partial Page Rendering (PPR)

PPR is a means by which designated parts of a page, rather than the whole page, is refreshed
when the user performs certain actions. OA Framework supports PPR on actions such as: table
record-set navigation, table sorting, table column totaling, adding a row to a table, row-level and
cell-level detail disclosure, toggling the visibility of a Hide/Show component, populating a LOV,
subtab navigation, Gantt chart refreshing and descriptive Flexfields context switching. Moreover,
developers can declaratively enable PPR events on several components. For example, a
developer can:

     •   Configure the selection of a poplist to cause related fields to render, be updatable, be
         required or be disabled based on the selected value.
     •   Configure the value change of a text field to set related field values (for example, if you
         set a Supplier value and tab to the next field, the dependent Supplier Site defaults
         automatically).
     •   Configure the selection of a master table's record to automatically query and display
         related rows in a detail table.

Accelerator (Hot) Keys

OA Framework supports mnemonic accelerator keys for selected buttons and enables
developers to assign numeric access keys to product specific user actions.

Enhanced Save Model

OA Framework provides a default implementation to warn users when they are about to lose
changes such as when they click on a link that takes them outside the context of the current
transaction. Developers can override the default behavior on a component-by-component basis.

Smart Poplist

OA Framework supports a personalizable hybrid between a static poplist and a searchable list
of values. The poplist includes the most popular values a user uses to populate a particular
attribute. The user can personalize the values that show up in the poplist by picking new values
from a list of values. Moreover, the user can personalize the order in which values are listed in
the poplist as well as remove less popular values. This feature is also referred to as a LOV
Choicelist.

LOV Auto Completion

Lists of values (LOVs) are used when the list of possible values is long and the user may want
to conduct a search before picking a value. In some business scenarios, especially with clerical
jobs, the user uses a small set of values or may find it faster to type a partial value. If the user
enters a partial value in a field that is associated with an LOV, OA Framework conducts a
search before bringing up the LOV window. If the search leads to a unique record, OA
Framework completes the rest of value for the unique record and saves the user from having to
use the LOV window.

Object Oriented Reuse

30
Oracle Application Framework Developer's Guide, Release 12.1.3


OA Framework applications can be abstracted into a series of concentric layers, like an onion.
The core layer represents the database and the surface layer represents the application pages.
In between is a number of business logic and user interface layers. This layering allows for
generic code and components to be implemented at the inner layers to maximize their reuse
across the outer layers. For example, attribute validation is implemented at the Entity Object (a
BC4J object-oriented representation of a database table in the middle tier) level. All application
pages that provide the user with the ability to populate or update the value of the subject
attribute would receive attribute validation for free through the underlying entity object. On the
user-interface side, reusable components can be saved as shared regions in the metadata
services (MDS) repository and reused across several pages. An administrator can choose to
personalize the shared region such that the personalization impacts all instances of the same
region across pages or personalize the shared region only in the context of the current page.




Oracle Portal Interoperability

OA Framework offers developers a simple approach to publishing OA Framework components
(commonly known as regions) as Oracle Portal-compatible portlets. Oracle Portal provides you
with a common, integrated starting point for accessing all your data. Since Oracle Portal lets you
personalize the content and look of your page, you can also personalize the application region
that is displayed as a portlet. Any personalizations you make to that portlet region appear only
when you display that region from the same portlet.

Built-in Security

HTML-based applications offer great user and administrator convenience, but special care must
be taken to ensure that these applications are secure. Developing HTML applications that are
truly unbreakable is very difficult, historically requiring application developers to also be security
experts. In fact, most application developers are not security experts, and they should not need

                                                                                                   31
Oracle Application Framework Developer's Guide


to be. It is the responsibility of the application framework to ensure that HTML transactions are
authorized, private, and free from tampering. OA Framework provides built in protection against
known HTML hacking strategies, leaving the application developer free to concentrate on
application functionality. Also, since UI components are defined in metadata rather than in code,
the security protection offered by OA Framework can be advanced to keep up with the state of
the art, without requiring applications to be rewritten.

Deployment Environment

OA Framework applications are deployed using standard Oracle 10g AS / Apache and
Oracle10g Database servers. Application pages can be rendered on Internet Explorer 5.0 or
above, Netscape 4.73 or above and Mozilla 1.5 or above. The data and middle tiers can be
deployed on several platforms including Linux, UNIX and Windows.

Summary
Based on the Model-View-Controller (MVC) architecture, OA Framework lets application
developers focus on the business requirements rather than on the underlying technologies. By
using declarative and guided-coding (and soon visual) techniques, OA Framework allows
application developers who are not necessarily J2EE experts to quickly become productive. OA
Framework-based applications offer a highly consistent user experience with the highest levels
of user interactivity without a client footprint. Applications are optimized for sub-second
response to most user interactions and competitive scalability trends. OA Framework exploits its
declarative and object-oriented architecture to offer the most durable personalization and
extensibility capabilities on the market, at a fraction of the cost. OA Framework features
translate to lower costs of ownership, better user experience and competitive deployments.




32
Oracle Application Framework Developer's Guide, Release 12.1.3



Setting Up Your Development Environment
This document describes how to configure and test an OA Framework Release 12 development
environment for the following use cases:

   •   Customer, Consultant or Support Representative Using JDeveloper on Windows.
   •   Customer, Consultant or Support Representative Using JDeveloper on Linux.

Note: Oracle employees who have installed Oracle JDeveloper OA Extension and want to set
up and test this environment should select the Customer link.

Customer, Consultant or Support Representative Using
JDeveloper on Windows
This section contains instructions to configure and test OA Framework if you are a customer,
consultant or support representative using JDeveloper on Windows. It provides an overview of
the directory structure and discusses how to:

   •   Configure the JDEV_USER_HOME environment variable.
   •   Obtain a database connection file.
   •   Create a desktop shortcut to JDeveloper.
   •   Assign Toolbox responsibilities.
   •   Launch JDeveloper and configure the database connection and user.
   •   Test the setup.

Overview

These instructions assume you have successfully installed the JDeveloper OA Extension zip file
which creates the following directory structure on your drive of choice.

Directory                          Description
Tip: To open any of the documentation in the jdevdoc directories, open the
jdevdocindex.htm.
jdevdocjavadocfwk                Includes OA Framework Javadoc.
jdevdocjavadocaolj               Includes AOL/J Javadoc.
jdevdocjavadocbc4j               Includes BC4J Javadoc.
jdevdocjavadocuix                Includes UIX Javadoc.
jdevdoctoolbox                    Includes OA Framework ToolBox Tutorial lesson/lab
                                   documentation.
jdevdocdevguide                   Includes the OA Framework Developer's Guide.
jdevbin                           Includes an extended version of the Oracle JDeveloper 10g
                                   executable and OA Framework class libraries.
jdevhome                          Includes the OA Framework ToolBox Tutorial source and
                                   developer working area.

                                                                                           33
Oracle Application Framework Developer's Guide


Task 1: Configuring the JDEV_USER_HOME Environment Variable

Warning: This is a requirement for JDeveloper. Do not skip this task.

Configure the JDEV_USER_HOME environment variable using Windows XP or Windows
2000:

     1. Go to your desktop and select My Computer, right-click and select Properties.
     2. On the System Properties dialog, select the Advanced tab.
     3. On the Advanced page, select the Environment Variables... button.
     4. On the Environment Variables dialog, select the New... button from the User variables
        for <username> box.
     5. On the New User Variable dialog, enter JDEV_USER_HOME in the Variable Name field.
        Set the Variable Value field to <drive>:jdevhomejdev where <drive> is the drive
        where you installed the JDeveloper OA Extension zip file. For example:
        c:jdevhomejdev.
     6. Select OK in each of the dialogs you opened to save the new user environment variable.

Warning: The variable value should not contain a leading space before the drive name. If it
does, your environment will not work properly.

Task 2: Obtaining a Database Connection File

Obtain the FND database connection (.dbc) file from the system administrator who installed the
OA Framework database where you want to do your development. Place this file in the
<JDEV_USER_HOME>dbc_filessecure directory.

Task 3: Creating a Desktop Shortcut to JDeveloper

To facilitate launching JDeveloper, create a desktop shortcut to
jdevbinjdevbinjdevw.exe.

Task 4: Assigning ToolBox Responsibilities

If you have not already done so as part of your installation verification, assign the following
ToolBox Tutorial responsibilities to a test user. Refer to the Oracle E-Business Suite System
Administrators Guide for information about creating users and assigning responsibilities to
users.

Note: Use an existing user in your system or create a new test user.

     •    OA Framework ToolBox Tutorial (responsibility key is FWK_TBX_TUTORIAL).
     •    OA Framework ToolBox Tutorial Labs (responsibility key is
          FWK_TOOLBOX_TUTORIAL_LABS).

Task 5: Launching JDeveloper and Configuring the Database Connection
and User

34
Oracle Application Framework Developer's Guide, Release 12.1.3


Use this procedure to launch JDeveloper and configure the database connection and user:

   1. Select the desktop shortcut created in Task 3 to launch Oracle JDeveloper.
   2. Select File > Open from the main menu, then navigate to
       <JDEV_USER_HOME>myprojects. Open the OA Framework ToolBox Tutorial
       workspace file (toolbox.jws).
   3. Expand the toolbox.jws in the JDeveloper System Navigator, to display its contents.
       Select the Tutorial.jpr project, then select Project > Project Settings.
   4. Expand the Oracle Applications node, which is In the Project Settings dialog, and
       select Runtime Connection.
   5. Locate the DBC file that you saved in Task 2 by using the Browse... button, which is In
       the Connection box. The file should be in the
       <JDEV_USER_HOME>dbc_filessecure directory.
   6. Specify the User Name and Password for the test user. This is the user that you
       assigned the ToolBox responsibilities to in Task 4. Select OK.
   7. Repeat Steps 3 - 6 for the LabSolutions.jpr project.
   8. Expand the Connections node in the JDeveloper System Navigator and then expand the
       Database node. Right-click on the Database node and select New Connection... to open
       the Connection Wizard. Follow the JDeveloper instructions to define a new database
       connection for the Oracle E-Business Suite database identified by the DBC file you
       selected above.
   9. Select the Tutorial.jpr project In the System Navigator. Right-click and select Edit
       Business Components Project....
   10. Select the Connection option in the Business Components Project Wizard and set the
       Connection Name to the connection you just defined. Select OK to save your changes.
   11. Repeat steps 8 - 10 for the LabSolutions.jpr project.

Task 6: Configuring the Environment Encoding of JDeveloper

   •   Confirm the environment encoding of your JDeveloper if it is appropriately set.
       To see the environment encoding, see your preferences of JDeveloper.
       If Encoding is not set to "UTF-8", set it to "UTF-8".

Task 7: Test your Setup

Perform the following steps to test your setup:

Tip: If you want pages to look as they do in the OA Framework ToolBox Tutorial / Sample
Librar, use Internet Explorer 5.0+ as your default browser.

   1. Open the toolbox.jws workspace in the JDeveloper Navigator using the instructions
      in Task 5 above.
   2. Go to the System Navigator, select toolbox.jws and then select Project > Rebuild
      toolbox.jws from the main menu. You should get 0 errors (warnings are okay and
      expected).
   3. Go to the System Navigator, expand the Tutorial.jpr project again, then select
      Project > Show Categories from the main menu.



                                                                                          35
Oracle Application Framework Developer's Guide


         Note: this helps to organize the files in a large project.

     4. Expand the HTML Sources category beneath Tutorial.jpr. Select
        test_fwktutorial.jsp, then select Run > Run test_fwktutorial.jsp from the main
        menu. Perform the following:
           o Select Hello, World! from the list of lesson links displayed on the Test
              Framework ToolBox Tutorial page. This runs a very simple page.

                 Note: If you can't run the Hello, World! page; revisit the steps listed above to ensure
                 that you completed everything correctly. If the problem persists, follow the support
                 procedure described in the Release Notes accompanying this ARU.

You are now ready for hands-on experience with the Oracle JDeveloper OA Extension. The
ToolBox Tutorial lessons can be launched from jdevdocindex.htm

Customer, Consultant or Support Representative Using
JDeveloper on Linux
This section contains instructions to configure and test OA Framework if you are a customer,
consultant or support representative using JDeveloper on Linux. It provides an overview of the
directory structure and discusses how to:

     •   Configure the JDEV_USER_HOME and JDEV_JAVA_HOME environment variables.
     •   Obtain a database connection file.
     •   Assign Toolbox responsibilities.
     •   Launch JDeveloper on Linux.
     •   Configure the database connection and user.
     •   Test the setup.

Overview

These instructions assume you have successfully installed the JDeveloper OA Extension zip file
which creates the following directory structure on your drive of choice.

Directory                              Description

Tip: To open any of the documentation in the jdevdoc directories, open the
jdevdocindex.htm.
jdevdocjavadocfwk                    Includes OA Framework Javadoc.
jdevdocjavadocaolj                   Includes AOL/J Javadoc.
jdevdocjavadocbc4j                   Includes BC4J Javadoc.
jdevdocjavadocuix                    Includes UIX Javadoc.
jdevdoctoolbox                        Includes OA Framework ToolBox Tutorial lesson/lab
                                       documentation.
jdevdocdevguide                       Includes the OA Framework Developer's Guide.
jdevbin                               Includes an extended version of the Oracle JDeveloper 10g

36
Oracle Application Framework Developer's Guide, Release 12.1.3


                                   executable and OA Framework class libraries.
jdevhome                          Includes the OA Framework ToolBox Tutorial source and
                                   developer working area.

Task 1: Configuring the JDEV_USER_HOME and JDEV_JAVA_HOME
Environment Variables

Attention: These commands must be executed from the bourne shell.

   1. Assign a value to the JDEV_USER_HOME variable. For example:

       JDEV_USER_HOME=/home/<username>/jdevhome/jdev

   2. Assign a value to the JDEV_JAVA_HOME variable.

       Example - OS Red Hat version 2.1:

       JDEV_JAVA_HOME=/jdevbin/linux/j2sdk1.4.2_03

       Example - OS Red Hat version 3.0:




       JDEV_JAVA_HOME=/jdevbin/linux/j2sdk1.4.2_04

       unset LD_ASSUME_KERNEL

       Note: Both Red Hat versions, (2.1 and 3.0); have been tested successfully by Oracle
       JDeveloper OA Extension.

   3. Export the two variables:




       export JDEV_USER_HOME

       export JDEV_JAVA_HOME

Task 2: Obtaining a Database Connection File

Obtain the FND database connection (.dbc) file from the system administrator who installed the
OA Framework database where you want to do your development. Place this file in the
<JDEV_USER_HOME>dbc_filessecure directory.

Task 3: Assigning ToolBox Responsibilities


                                                                                             37
Oracle Application Framework Developer's Guide


If you have not already done so as part of your installation verification, assign the following
ToolBox Tutorial responsibilities to a test user. Refer to the Oracle E-Business Suite System
Administrators Guide for information about creating users and assigning responsibilities to
users.

Note: Use an existing user in your system or create a new test user.

     •   OA Framework ToolBox Tutorial (responsibility key is FWK_TBX_TUTORIAL).
     •   OA Framework ToolBox Tutorial Labs (responsibility key is
         FWK_TOOLBOX_TUTORIAL_LABS).

Task 4: Launching JDeveloper on Linux

Run this command from the bourne shell to launch JDeveloper:

/jdevbin/jdev/bin/jdev -verbose

Task 5: Configuring the Database Connection and User

Use this procedure to configure the database connection and user:

     1. Launch JDeveloper and then select File > Open from the main menu. Navigate to
         <JDEV_USER_HOME>myprojects and open the OA Framework ToolBox Tutorial
         workspace file (toolbox.jws).
     2. Expand the toolbox.jws in the JDeveloper System Navigator, to display its contents.
         Select the Tutorial.jpr project, then select Project > Project Settings.
     3. Expand the Oracle Applications node, which is In the Project Settings dialog, and
         select Runtime Connection.
     4. Locate the DBC file that you saved in Task 2 by using the Browse... button, which is In
         the Connection box. The file should be in the
         <JDEV_USER_HOME>dbc_filessecure directory.
     5. Specify the User Name and Password for the test user. This is the user that you
         assigned the ToolBox responsibilities to in Task 3. Select OK.
     6. Repeat Steps 2 - 5 for the LabSolutions.jpr project.
     7. Expand the Connections node in the JDeveloper System Navigator and then expand the
         Database node. Right-click on the Database node and select New Connection... to open
         the Connection Wizard. Follow the JDeveloper instructions to define a new database
         connection for the Oracle E-Business Suite database identified by the DBC file you
         selected above.
     8. Select the Tutorial.jpr project In the System Navigator. Right-click and select Edit
         Business Components Project....
     9. Select the Connection option in the Business Components Project Wizard and set the
         Connection Name to the connection you just defined. Select OK to save your changes.
     10. Repeat steps 7 - 9 for the LabSolutions.jpr project.

Task 6: Testing the Setup



38
Oracle Application Framework Developer's Guide, Release 12.1.3


Tip: To use Mozilla as your default browser, create a symbolic link. For example, netscape
= local/bin/mozilla.

To test your setup:

   1. Open the OA Framework ToolBox Tutorial workspace file by selecting File > Open from
      the main menu. Navigate to <JDEV_USER_HOME>myprojects and open the file
      toolbox.jws.
   2. Select toolbox.jws and select Project > Rebuild toolbox.jws from the System
      Navigator main menu. You should get 0 errors (warnings are okay and expected).
   3. Expand the Tutorial.jpr project and then select Project > Show Categories from the
      System Navigator main menu. (This helps to organize the files in a large project).
   4. Expand the HTML Sources category beneath Tutorial.jpr. Select
      test_fwktutorial.jsp, and select Run > Run test_fwktutorial.jsp from the main
      menu:
   5. Select Hello, World! from a list of lesson links displayed on the Test Framework ToolBox
      Tutorial page, to run a very simple page.

       Note: If you can't run the Hello, World! page; revisit the steps listed above to ensure that you
       completed everything correctly. If the problem persists, check the Oracle JDeveloper OA
       Extension FAQ for troubleshooting tips. If it still doesn't work, send an email to the OA
       Framework support mail list (see the OA Framework web site for additional information about
       this).




                                                                                                    39
Oracle Application Framework Developer's Guide



Building and Running 'Hello, World!'
Overview
This tutorial leads you through using Oracle JDeveloper with OA Extensions to create a very
simple page. This tutorial has minimal explanation, few steps and no BC4J.

This tutorial also assumes a basic prior knowledge of working with JDeveloper.

You should also have your development environment set up and working. For assistance in
setting up your development environement see "Setting Up Your Development Environment"

This lab takes approximately 1-3 hours.

Hello, World Lab Goals
After completing this exercise, you will have learned how to:

     •   Create an Oracle Applications (OA) JDeveloper workspace and project.
     •   Configure a project to enable Developer Mode testing and diagnostics.
     •   Use the JDeveloper OA Extension to create a very simple page.
     •   Create a controller and associate it with a region.
     •   Handle a submit button press action (an HTTP POST request).
     •   Run a page in regular and debug modes.

The resulting page has the global links (such as Preferences, Logout, and Return to Portal), a
header, a footer, a Personalize Region link, one empty field and one Go button.

The finished "Hello World" page does nothing other than display a message when you enter a
value in the field and click the Go button. Your final page and layout will look like the following:




40
Oracle Application Framework Developer's Guide, Release 12.1.3




Note that there are several profile options that control features such as personalization, the
visual appearance of global links, and other features, so what you see may be different from the
picture above. Differences you are most likely to encounter are not seeing the Personalize
Region link, seeing button icons above the corresponding global links, or not seeing certain
global links such as Customize (if personalization is not enabled for your username).

Step 1. Create a New OA Workspace and Empty OA Project
with the New... Dialog.
Select File > New... to open the New... dialog (shown in the following diagram). This dialog is
also called the New Object Gallery.




                                                                                                  41
Oracle Application Framework Developer's Guide




Choose General > Workspace Configured for Oracle Applications from the New... dialog, or
highlight Workspaces in the Navigator and choose New OA Workspace... from the context
menu (right mouse button menu that changes depending on the context). You'll be prompted to
create an OA workspace. Verify that the default workspace directory name points to your own
<JDEV_USER_HOME>myprojects directory, as shown in the following diagram. Modify the
workspace file name as well (any name is okay for a workspace, such as
HelloWorldOAWorkspace.jws). Check the Add a New OA Project check box.




After you click OK, you will see the Oracle Applications Project Wizard after a Wizard Welcome
screen. You can skip the welcome screen and select Next.

42
Oracle Application Framework Developer's Guide, Release 12.1.3


In Step 1 of the wizard, verify that the default project directory name points to your own
JDEV_USER_HOMEmyprojects directory, as shown in the following diagram. Modify the
project file name as well (any name is okay for a project, such as
HelloWorldOAProject.jpr). Set the default package name to the following (where "hello" is
the component):



oracle.apps.ak.hello

Note: For this exercise and for all later lab exercises, you must use the exact package,
page, region, item and variable names specified in the instructions, because the
instructions depend on having these names. Specifically, you must use oracle.apps.... in
your package names for the labs even if you are an Oracle E-Business Suite customer or
partner (though you would use <3rd party identifier>.oracle.apps.... in production objects
you create).




In Step 2 of the wizard, verify that the XML Path points to your own
JDEV_USER_HOMEmyprojects directory, as shown in the following diagram. You can include
additional directories in the XML Path field if you have files in your project that do not reside
under your myprojects directory.

For your Hello World project, you do not use the Repository for metadata in the database (the
Hello World example uses only the XML files). In regular development work, where you use


                                                                                                43
Oracle Application Framework Developer's Guide


standard components that have been imported into the Repository, you would check the Use
Repository for Design Time check box and provide connection information in Step 2.




In Step 3 of the wizard, adjust the runtime connection information, if necessary, for the database
and Oracle E-Business Suite username, password, and responsibility you are using (it must be
a valid user and responsibility for your installation).




44
Oracle Application Framework Developer's Guide, Release 12.1.3




You will then have a screen after the one above that verifies the wizard is done, or you can
select Finish on this page of the Wizard. When you select Finish, you will notice that
JDeveloper will build some new files within your JDev Home directories.

Step 2. Set Run Options in OA Project Settings
To verify that your project includes all of the appropriate libraries, paths and other settings,
select your project in the Navigator and choose Project Properties... from the context menu, or
double-click on your project.

Select the Oracle Applications > Run Options settings page. Select OADeveloperMode and
OADiagnostic, and move them to the Selected Options List. OADeveloperMode provides extra
code checking and standards checking at runtime. OADiagnostic enables the Diagnostics
button in the global buttons at the top of the page, overriding any corresponding profile option
set for the application. You should always have these two modes turned on during development.
The other modes are generally used for testing towards the end of developing your page, and
are fully described in Chapter 7 of the Developer's Guide.




                                                                                               45
Oracle Application Framework Developer's Guide




Step 3. Create the OA Components Page File
Within your new workspace, select your new project (your .jpr file). To add an OA Components
page file to your project, choose New... from the context menu or use File > New... on the main
menu to open the New... dialog.




46
Oracle Application Framework Developer's Guide, Release 12.1.3




Select Web Tier > OA Components in the Categories column. Then select Page, and press OK
as shown in the following diagram:




                                                                                       47
Oracle Application Framework Developer's Guide




You will then see a dialog box that asks for the name and package file for your new page. This
dialog box is shown in the following diagram:




Name your page HelloWorldPG. Your page name cannot include any spaces.

In the Package field, type the following:



oracle.apps.ak.hello.webui




48
Oracle Application Framework Developer's Guide, Release 12.1.3


Note: Be aware that the Wizard will populate a package name (the default package for the
project) so be sure to check it carefully.

Your package file name (which determines the location of the XML page file in the directory
structure) should be set to
oracle.apps.<application_shortname>.<optional_modulename>.<optional_subcomponent
>.webui (to comply with Oracle E-Business Suite directory structure standards), where the
application shortname is lowercase and is an existing Oracle E-Business Suite product
shortname, such as INV.

Note: Pages migrated from old AK pages may use a different directory structure (pages
instead of webui).

Be sure to follow the package name, directory location and object naming standards in the OA
Framework File / Package / Directory Structure standards.

Your initial page structure appears in the Structure window as shown below, with an initial
pageLayout region called region1, and a folder called pageLayout Components. The
pageLayout Components folder contains a standard corporate branding image ("Oracle") that
you can change through personalizations and through profile options. Changing the logo is not
part of this exercise.




Step 4. Modify the Page Layout (Top-level) Region
JDeveloper creates your top-level page layout region for you automatically when you create
your page.




                                                                                             49
Oracle Application Framework Developer's Guide




If the Property Inspector is not already open, select View > Property Inspector from the main
menu. You can alternate between the alphabetical list of properties and the categorized list by
clicking on the Categories button at the top of the Property Inspector (shown above with
categories enabled).

Set the following properties for your page layout region:

     •   Set the ID property to PageLayoutRN.
     •   Verify that the Region Style property is set to pageLayout.
     •   Verify that the Form property is set to True.
     •   Verify that the Auto Footer property is set to True.
     •   Set the Window Title property to <your name>: Hello World Window Title.
         This becomes the window title for the page.
     •   Set the Title property to <your name>: Hello World Page Header. This
         becomes the page header for the page (it appears under the blue bar).

50
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   Set the AM Definition property to
       oracle.apps.fnd.framework.server.OAApplicationModule (you will have to
       type in the value). This is a generic application module supplied by the OA Framework.




Step 5. Create the Second Region (Main Content Region)
Create your second region under the page layout region by selecting the page layout region in
the Structure window and choosing New > Region from the context menu.




                                                                                            51
Oracle Application Framework Developer's Guide




This region is merely going to provide a container for your items and ensure that the items are
properly indented. Set the following properties for your second region:

     •   Replace the default value in the ID property with MainRN.
     •   Set the Region Style property to messageComponentLayout (this provides an
         indented single- or multiple-column layout for the child items of the region).

If you want to, you can run your page at this point. You will see the global links, the copyright
and privacy footer elements, and your page header text.

Step 6. Create the First Item (Empty Field)
Create your first item under the second region (main content region) by selecting the second
region in the Structure window and choosing New > messageTextInput from the context menu.




52
Oracle Application Framework Developer's Guide, Release 12.1.3




Set the following properties for your item:

   •   Set the ID property to HelloName.
   •   Verify that your Item Style property is set to messageTextInput (this style provides a
       text label and an input field).
   •   Set the Prompt property to Name (in the later labs, you will use an attribute set to set the
       prompt).
   •   Set the Visual Length to 20.
   •   Set the Data Maximum Length to 50.




                                                                                                53
Oracle Application Framework Developer's Guide




If you want to, you can run your page at this point.

Step 7. Create a Container Region for the Go Button
To add a non-message*-type bean such as a submitButton to a messageComponentLayout
region, you must first add the bean to a messageLayout region.

Select the messageComponentLayout region and select New > messageLayout.




54
Oracle Application Framework Developer's Guide, Release 12.1.3




Name this region ButtonLayout.




Step 8. Create the Second Item (Go Button)
                                                                                      55
Oracle Application Framework Developer's Guide


Create your Go button item by selecting the messageLayout region, ButtonLayout, in the
Structure window and choosing New > Item from the context menu.

Set the following properties for your button item:

     •   Set the value of the ID property to Go.
     •   Set the Item Style property to submitButton.
     •   Set the Attribute Set property to
         /oracle/apps/fnd/attributesets/Buttons/Go.

Note: You can search for this attribute set, even though the attribute set file is not part of
your project, by choosing the Search in: Entire MDS XML path option but not selecting the
Show Components in Same Scope Only check box. You can use
/oracle/apps/fnd/attributesets/ and Go% as criteria for your search.

Verify that the Prompt property is now set to Go (this is your button label, inherited from the
attribute set).




56
Oracle Application Framework Developer's Guide, Release 12.1.3


If you want to, you can run your page at this point.

Step 9. Save Your Work
Save your work. Using the menu choice File > Save All will save your metadata changes to an
XML file as well as save all your other file changes (such as to a .jsp or .java file).

Tip: Though it usually will not be written out as a separate step in the exercises, you should
save your work frequently.




Step 10. Run Your Page Using the Run Option
You can try out your page using the Run option on the context menu.

If you are using a database other than what you already have in your project settings, you will
need to modify the Runtime Connection project settings by selection your project file and
choosing Project Properties... from the main menu. Specifically, you must use a combination of
Username, Password, (Responsibility) Application Short Name and Responsibility Key that is
valid for your database to enable your session to log in.




                                                                                                 57
Oracle Application Framework Developer's Guide




You can use the Run option in the context menu to test your page in a standard browser. This
option allows you to test your layout as well as functionality such as handling button presses.
Select your page or page layout region in the Structure window, and choose Run from the
context menu.




58
Oracle Application Framework Developer's Guide, Release 12.1.3




Alternatively, you can select your page in the Navigator window, and choose Run <page name>
from the context menu.




You may have to wait a few minutes or more before you see your page in a separate browser
window (it often takes longer the first time).



                                                                                            59
Oracle Application Framework Developer's Guide


If your page does not appear after a few minutes, or gives errors, check the messages in the
Log window. See the Hello, World! Troubleshooting Guide or the Oracle JDeveloper OA
Extension FAQ.

Your page should look like the following picture (with your own name in the page header and
window title). You should see your page header, your Name field, and your Go button, along
with global links and buttons (some global buttons may not appear depending on profile option
settings). You may or may not see a Personalize Region link below your page header,
depending on profile option settings. Do not personalize this page, as personalizations are data
driven and you will affect anyone else building the Hello World page on the same database.

Each time you make changes to your layout (by adding regions or items, modifying properties,
or changing code), you must run your page again to see your changes. If the Run process
seems to hang for several minutes after you have already run your page previously, you may
need to terminate the OC4J server using the Run > Terminate > Embedded OC4J Server main
menu option, and then run again.

Step 11. Add a Controller
Add a controller to display a message when the user clicks on the Go button. Select your
second region (MainRN) and choose Set New Controller... from the context menu.




Give your controller the package name oracle.apps.ak.hello.webui and an appropriate class
name, such as HelloWorldMainCO.

Be sure you review the window before you click OK.

60
Oracle Application Framework Developer's Guide, Release 12.1.3




Step 12. Edit Your Controller
When you created a new controller, JDeveloper added files to your project in the package you
created ( oracle.apps.ak.hello.webui). The controller file is called HelloWorldMainCO.java

If you double click on HelloworldMainCO.java, the file will be editable in an adjacent screen.

Edit your controller code as follows:

Add the following line as the last line of the import section to make the OA Framework
OAException routines available:



import oracle.apps.fnd.framework.OAException;

Within the comments section at the top of the controller source code, you can also fill out what
this controller is used for. Doing so makes it easier to understand what a specific controller is
used for since there will be potentially many controllers in the same package. In our case, we
are going to create a single controller in this exercise.




                                                                                                 61
Oracle Application Framework Developer's Guide




Note: You can sort your imports using the context menu in the code editor (Organize
Imports > Sort Imports) as shown in the following picture. However, DO NOT organize the
imports now because our import is unused (greyed out) and will be removed if we run
the organize imports now.




62
Oracle Application Framework Developer's Guide, Release 12.1.3




Code the processFormRequest() method to match the following (making sure to match the
item IDs you chose):



public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)


                                                                                      63
Oracle Application Framework Developer's Guide


{

     super.processFormRequest(pageContext, webBean);

     if (pageContext.getParameter("Go") != null)

     {

         String userContent = pageContext.getParameter("HelloName");

            String message = "Hello, " + userContent + "!";

         throw new OAException(message, OAException.INFORMATION);

     }

}

Note: Hardcoding a message text string is not translatable and would not be acceptable in
a real Oracle E-Business Suite product. Normally you would define your message in
Message Dictionary and call it from your code using its message name using the
OAException routine.




Step 13. Build Your Controller
Build your controller by selecting Rebuild from the context menu within the code editor window.


64
Oracle Application Framework Developer's Guide, Release 12.1.3




Step 14. Test Your Work Using the Run Option
Save your work, and then test it using the Run option. Type something into your field and then
click the Go button. You should see the your page with an informational message that contains
what you typed into the field, as shown:




                                                                                             65
Oracle Application Framework Developer's Guide




Step 15. Test Your Work Using the Debugger
First, go back to your controller window to set up a breakpoint. Click on the line number next to
the code line where you want the breakpoint to occur. You may have to toggle on the line
numbers in JDeveloper.

The number changes to an icon indicating that it is a breakpoint in the source code. Set a
breakpoint at the following line within your processFormRequest code:



if (pageContext.getParameter("Go") != null)




66
Oracle Application Framework Developer's Guide, Release 12.1.3




Now test your page by selecting your page name in the Navigator and choosing Debug
HelloWorldPG.xml from the context menu (you can also do this in the Structure window).

Tip: When you are trying to debug an OA Extension page avoid launching the debugger
from the project file. Instead, launch from a specific JSP or XML file (which may itself be a
launch page).

When the debugger starts up, your JDeveloper layout changes to a debugging layout that
includes additional windows, including a debugging toolbar, a Breakpoints window, Data and
Smart Data windows, and a Stack window (these may appear as tab controls); this is only a
partial list.

In debug mode, your code executes as it normally would until you hit a breakpoint. So, in this
example, the page renders as usual because the breakpoints are in the code that handles the
Go button press. For the breakpoints above, you will need to enter a value in your page's Name
field and select the Go button before you reach your breakpoint.

Type something into the Name field on your page and then click the Go button. If you go back to
the JDeveloper window, you should find your first breakpoint line highlighted; processing has
stopped just before that line is executed. This first breakpoint occurs just before your code
checks to see if the Go button has been selected.




                                                                                             67
Oracle Application Framework Developer's Guide


Now select Debug > Step Over from the main menu, or select the Step Over button, to continue
to the next line of code.




The debugger then highlights the following line of code:



String userContent = pageContext.getParameter("HelloName");

If you hold your mouse hovering above userContent on that line, you will see userContent
= (out of scope) because the line has not yet executed.




Now select Debug > Step Over from the main menu, or select the Step Over button again, to
continue to the next line of code.


68
Oracle Application Framework Developer's Guide, Release 12.1.3




String message = "Hello, " + userContent + "!";

Now if you hold your mouse hovering above userContent on the new line, you will see its
value as whatever you typed in (this only works for strings).




In the screen captures above, you can see the value of userContent in the Data or Smart
Data window.

Note: If you hold your mouse over the word message on the same breakpoint code line, you
will see message = (out of scope) because the line has not yet executed (and you will not
see message at all in the data windows).




                                                                                          69
Oracle Application Framework Developer's Guide




Step over again. You then get to the following line of code:



throw new OAException(message, OAException.INFORMATION);

At this point, if you examine the message string (either in the code window or in the Data or
Smart Data windows), you will see your entire message text.

Select Debug > Resume from the main menu, or select the Resume button, to resume
processing so your code runs to completion. You should see your page with an informational
message that contains what you typed into the field, just as it looked when you ran your page
using the Run option.




Congratulations! You have finished your first page with Oracle JDeveloper
and the OA Framework!




70
Oracle Application Framework Developer's Guide, Release 12.1.3



OA Framework Development Runtime
Configuration
Overview
This document briefly introduces some of ways that you configure your OA Framework runtime
for pages in development, and some simple utilities that you might find useful.

Contents

   •     Page Test Modes
   •     Profile Options
   •     Technology Stack Information

Page Test Modes
As briefly mentioned in Building and Running "Hello, World!" there are several test modes that
you can leverage at different points in the development/test cycle. See the associated links for
each option for additional information about its use.

Option                          Description                  Recommended Use
OADeveloperMode                 Performs various code        This should always be enabled
                                standards checks as          during development.
                                outlined in Chapter 7.
OADiagnostic                    Enables the global         This should always be enabled
                                Diagnostics button at the  during development.
                                top of the page (you would
                                select this to view log
                                messages for the page).
                                Note that this overrides
                                any corresponding profile
                                option value set for the
                                application.

                                See Logging.
OABackButtonTestMode            Tests the page's browser     This should be used only when
                                Back button support.         performing Back button support
                                                             tests.
                                See Testing OA
                                Framework Applications.
OAPassivationTestMode           Tests the page's support     This should be used only when
                                for passivation.             performing passivation tests.

                                See Testing OA
                                Framework Applications.

                                                                                               71
Oracle Application Framework Developer's Guide


OADumpUIXTree                   Writes out the component     This should be used only when you
                                tree for a page.             need to diagnose a problem.

                                See Debugging OA
                                Framework Applications.

Note: You can set page test modes two different ways, however, the back button and
passivation test modes currently must be set as cookies in a test JSP.

Project Settings

     1. Select your project in the JDeveloper System Navigator and select Project > Project
        Settings... from the main menu.
     2. In the Project Settings dialog, select the Common > Oracle Applications > Run Options
        page.
     3. In the Run Options page, select the test modes that you want to enable in the Off
        Options List and shuttle them to the On Options List.
     4. Select OK to save your changes.

Test JSP Cookies

The test_fwktutorial.jsp that you ran as described in Setting Up Your Development
Environment includes the following cookie definitions. If you save this test JSP to create your
own (the easiest way to create a test JSP), simply modify the following section as appropriate to
enable or disable test modes.

Note: Test JSP cookie values override any values that you set for the project.



<SCRIPT LANGUAGE="JavaScript">

     document.cookie = "OADiagnostic=1";

     document.cookie = "OADeveloperMode=1";

     document.cookie = "OABackButtonTestMode=0";

     document.cookie = "OAPassivationTestMode=0";

     document.cookie = "OADumpUIXTree=0";

</SCRIPT>

Profile Options



72
Oracle Application Framework Developer's Guide, Release 12.1.3


There are several profile options that you might want to set during development. See Appendix
B: OA Framework Profile Options for a list of all the Oracle E-Business Suite profile options that
affect the OA Framework.

Warning: Be conservative when you change profile option values! You should be setting them
at the responsibility, user, or application level as appropriate in order to avoid impacting other
developers working on the same environment.

Accessibility

   •   The Self Service Accessibility Features profile options controls whether pages can be
       used with assistive technologies. If enabled, the OA Framework Partial Page Rendering
       (PPR) features are disabled -- which can be surprising if you're not expecting this
       behavior.

Personalization

   •   There are series of related profile options that control whether Personalization is enabled
       and accessible in a page. See the Personalization section in the profile options
       document (this also points you to additional information about the feature).

Logging

   •   There are a series of related profile options that control if and how logging is
       implemented. See the Logging section in the Profile Options document (this also points
       you to additional information about the feature).

Passivation

   •   There are a series of related profile options that control whether passivation is enabled.
       See the Passivation section in the Profile Options docment (this also points you to
       additional information about this feature).

Technology Stack Information
If you need to know what version of the OA Framework and Java you're running (among other
things), see the instructions in Discovering Page, Technology Stack and Session Information.




                                                                                                 73
Oracle Application Framework Developer's Guide




74
Oracle Application Framework Developer's Guide, Release 12.1.3



Chapter 2: OA Framework Essentials
JSP Application Primer
Overview
If you do not have web application development experience, this document is intended to help
you visualize -- in very simple terms -- how a generic JSP application is constructed, and what
happens at runtime. It also identifies some key vocabulary/concepts used throughout the OA
Framework Developer's Guide and ToolBox Tutorials.

Contents

   •   Key JSP Application Components
   •   What Happens at Runtime?
   •   Event Handling: Web UI vs. Classic Client UI
   •   Page Navigation
   •   What is a Cookie?
   •   More About Servlet Sessions

Suggested Reading

For additional information about JSP applications and servlets (none of which is required
reading for working with the OA Framework), you might want to review the following for tutorials,
documentation and book suggestions:

   •   Oracle Technology Network
   •   JavaSoft Java Developer Connection

Key JSP Application Components
A typical JSP application involves the following components: a browser for client access, a
database for enterprise data and a web application server ("middle tier") where the application
objects live.

   •   The browser communicates with the middle-tier using HTTP (Hyper Text Transfer
       Protocol), which involves sending a request message to which the middle-tier replies
       with a response message.
   •   A JSP is a file with some HTML and Java code that executes top to bottom. At runtime,
       it is compiled into a Java class, which is actually a servlet.
   •   A servlet is a Java-based web application server extension program that implements a
       standard API.
   •   A servlet session is a mechanism for maintaining state between HTTP requests during
       a period of continuous interaction between a browser and a web application. A session
       may be initiated at any time by the application and terminated by the application, by the



                                                                                              75
Oracle Application Framework Developer's Guide


         user closing the browser, or by a period of user inactivity. A session usually corresponds
         to an application login/logout cycle
     •   A JavaBean (or "bean" for short) is simply a reusable component that implements
         specific design patterns to make it easy for programmers and development tools to
         discover the object's properties and behavior.
     •   Any objects in the middle-tier that communicate with the database use a JDBC (Java
         Database Connectivity) driver.

Figure 1: Key web application components and browser/server communication




What Happens at Runtime?

Step 1

When the user selects a link, a button or an active image, the browser sends an HTTP request
to the web application server for processing. For the purposes of this introduction, we will focus
on the two primary HTTP request methods (POST and GET) that are relevant for an OA
Framework application.

HTTP GET



76
Oracle Application Framework Developer's Guide, Release 12.1.3


Whenever the user clicks a link or an image with an associated URL (like
http://www.yahoo.com) the browser submits a GET request.

You can think of a GET as a postcard: both the address (URL) and any information the sender
wants to convey (URL parameters) are written on the card itself (which is inherently space-
constrained; how much can you write on a postcard?). This means that all the information for
the communication is visible externally (and in an HTTP GET, all the data sent to the server is
visible as parameters on the URL).

HTTP POST

Whenever the user clicks a button, image or link that performs a form submit in an OA
Framework application (see What is a Form? below), the browser submits a POST request to the
server (technically, a form can be submitted with a GET, but for the purposes of working with the
OA Framework, you can assume a form submit is a POST).

You can think of a POST as an envelope: the address (URL) is written on the outside, but the
content within has the information the sender wants to convey. There's no limit to the amount of
information that can be stored inside the envelope. Furthermore, the submitted data is not
visible on the URL -- just as the contents of an envelope are not externally visible (although the
metaphor isn't absolutely accurate: a developer could also add some parameters to the URL
when doing a form submit).

What is a "Form?"

In simple terms, a "form" lets you collect data entered by users into "form fields," and send that
data to the server for processing.

A form is an HTML construct that groups data entry controls such as fields (both hidden and
visible), poplists, and so on with action controls (like buttons) that are capable of "submitting the
form." When the user selects a submit button, for example, the browser issues a POST request,
which sends the form's data to the server.

Tip: People often use the terms POST and "submit form" interchangeably when talking about the
OA Framework.

Step 2

The HTTP listener in the web application server routes the incoming request to the JSP. The
developer's code does not know or care whether the browser issued a POST or a GET. All it
does is read request values to determine what to do. So, for example, one of the request values
might tell the JSP that a Go button had been pressed, which means it must execute a query.

Step 3

As shown in Figure 1 above, the JSP delegates to one or more JavaBeans, which implement
various behaviors including database interaction. Once they have completed their work, the JSP
prepares the appropriate HTML content to send back to the browser in the response.

                                                                                                   77
Oracle Application Framework Developer's Guide


Note: We included the JavaBeans in this example just to make the point that in an application of
any complexity -- and modularity -- the JSP does not do the application work on its own since
you should not combine model, view and controller code in the same file. However, there is no
absolute technical requirement for the JSP to work with any other Java classes, and if it does,
there is no requirement that these classes be JavaBeans.

Step 4

The browser displays the HTML it received in the response.

Event Handling: Web UI vs. Classic Client UI
In traditional client/server applications, you have the option of handling events ranging in
granularity from very low-level mouse movements to field, region and finally, window-level
scope. Furthermore, when you communicate from the client to the server, you can send a single
value to be validated back to the server while expecting a single validation result back. You can
then modify the user interface accordingly, which allows for a highly interactive experience for
the user.

In a web application, you essentially handle "page-level" events (unless you are using
Javascript extensively to create a more interactive experience, and since the OA Framework
Coding Standards and Oracle Browser Look and Feel (BLAF) UI Guidelines prohibit this, we will
not consider it here). In this case, as users navigate from field to field and enter data, there are
no events for you as a developer to handle.

Tip: OA Framework provides partial page rendering (PPR ) support for some actions, which
allows for a more interactive user experience. This is fully described in Chapter 4.

When the browser finally sends a request as described above, all the page data is sent in that
single communication -- including any user-entered values and information about what actions
the user wants to perform. The developer reads request values to determine what happened (if
the user pressed a button, which one was it?), does whatever work is required by the selected
action, and then transmits a new HTML page back to the browser.

Page Navigation
So far, we've reviewed what happens (in general terms) when the browser communicates to the
web server and vice versa, but we have not discussed the primary mechanisms for navigating
from one page to another.

Note: In the following generic descriptions, it does not matter whether the request sent by the
browser is a POST or a GET.

Standard Request

Scenario



78
Oracle Application Framework Developer's Guide, Release 12.1.3


A user selects a link on Page X to navigate to Page A. While on Page A, they select a link to
navigate to Page B.

Implementation

The browser sends a request to Page A, which does its work and sends a response to the
browser including the HTML to display. When the user indicates that they want to see Page B,
the browser sends a new request to Page B, which does its work and sends a response so
Page B can display.

Figure 2: Standard request illustration




                                                                                                     79
Oracle Application Framework Developer's Guide




JSP Forward

Tip: You will code many JSP Forwards in your OA Framework application. You must
understand this concept.

Scenario

While on Page A, a user selects an action from a dynamically defined list. The code in JSP A
needs to handle that action to determine what page to display in response.

80
Oracle Application Framework Developer's Guide, Release 12.1.3


Implementation

In this case, while handling an incoming request as a result of the user's action selection, JSP A
"forwards" to JSP B which does its work and sends a response including the HTML to display
itself. Since the "forward" action happens on the server, the browser knows nothing about it and
the two pages share the same request.

Figure 3: JSP forward from one page to the next within a single request




In another variation, which is very common in OA Framework pages for reasons, which will be
described later in this chapter and the next, Page A could perform a JSP Forward back to itself
as shown below.

Figure 4: JSP forward from one page back to itself within a single request




                                                                                                    81
Oracle Application Framework Developer's Guide




Client Redirect

Scenario

A user selects a link on Page X to navigate to Page A, but the link is old so the developer wants
to automatically send the user to the new replacement, Page A2.

Implementation

In this case, while handling an incoming request, JSP A sends a special "redirect" message to
the browser telling it to immediately access JSP A2. The browser sends a second request to
JSP A2, which does its work and sends a response including the HTML to display.

Figure 4: A client redirect from one location (page) to the next (the same page in a different location)




82
Oracle Application Framework Developer's Guide, Release 12.1.3




What is a Cookie?
To fully understand how the OA Framework maintains application context after a user logs in,
you need to understand what a browser "cookie" is.

A "cookie" is a nugget of information that a web application can give to a browser with the
understanding that the browser will send it back to the server with each request. In other words,
it is a mechanism for holding on to some small amount of state between requests.

Cookies can be persistent or session-based:

   •   The browser saves a persistent cookie to a file on the user's computer, and the
       information endures across browser sessions. Have you ever navigated to a web site
       that greeted you by name before you logged in? If so, this was accomplished with a
       persistent cookie.
   •   Session-based cookies are held in the browser's memory, and when the browser is
       closed, the cookie is destroyed.

More About Servlet Sessions
In the same way that AOL/J pools JDBC connections because they are a precious resource
(you will learn more about connection pooling later in this chapter), the servlet engine pools

                                                                                                 83
Oracle Application Framework Developer's Guide


request-processing threads. As illustrated in Figure 5 below, the servlet engine allocates a
thread to process each request it receives. When the request completes, the servlet engine
returns the thread to its pool.

Note: The following diagram assumes a user performs two actions resulting in two separate
HTTP requests while working in the same browser window (the same browser session). It
should not be interpreted to mean that two browser windows are open.

Figure 5: Conceptual illustration of servlet engine request processing




Since a single browser session can be served by numerous threads, (a different one for each
request), the servlet session provides a resource for maintaining state across requests.



84
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   If a web application wants to establish a servlet session, it calls a method on the request
       object asking for a session to be created.
   •   The servlet engine creates the session (specifically, a
       javax.servlet.http.HttpSession object), along with a special cookie that it
       returns to the browser with the response. This session cookie holds the servlet session
       ID.
   •   When a new request is received with the session ID cookie, the servlet engine uses this
       ID to locate that particular browser's servlet session object.
   •   Web application code can then access any data stored on the servlet session during
       previous requests within the same browser session.

Note: You can track sessions two ways. The most common way, which is what the OA
Framework does, is to use a session cookie. Alternatively, you can encode the cookie into
request URLs. If you want to learn more about this, or any other concepts presented in this
document, see the suggested reading section above.




                                                                                                85
Oracle Application Framework Developer's Guide



Anatomy of an OA Framework Page
This document describes the basic elements of a typical OA Framework page.

Contents

     •   Page Basics
     •   The Model
     •   The View
     •   The Controller
     •   Web Bean Architecture
     •   Guide to OA Framework Javadoc

Prerequisite Reading

If you are new to web application development, please read the short JSP Application Primer
before proceeding. The OA Framework Developer's Guide assumes you are familiar with the
concepts and vocabulary presented in the JSP Primer.

Page Basics
At the browser level, an OA Framework page, like any other web page, renders as standard
HTML.

In the middle tier, however, this page is implemented in memory as a hierarchy of Java beans --
very much like a classical Java client UI. Each UI widget, such as buttons, a table, the tabs, the
application branding image and so on, that renders in the page corresponds to one or more web
beans in the hierarchy.

When the browser issues a request for a new page, OA Framework reads the page's
declarative metadata definition to create the web bean hierarchy. For each bean with an
associated UI controller, OA Framework calls code that you write to initialize the page. When
page processing completes, OA Framework hands the web bean hierarchy to the UIX
framework so it can generate and send HTML to the browser.

When the browser issues a form submit (if, for example, the user selects a search region's Go
button), OA Framework recreates the web bean hierarchy if necessary (the hierarchy is cached
between requests, and typically needs to be recreated only in exceptional cases that we'll
discuss in detail later), and then calls any event handling code that you've written for the page
beans. When page processing completes, the page HTML is generated again and sent to the
browser.

The rest of this document introduces the specific model, view and controller code and
declarative definitions that you create to implement a page.

Figure 1: A conceptual illustration of the OA Framework model-view-controller architecture




86
Oracle Application Framework Developer's Guide, Release 12.1.3




The Model
The model encapsulates the underlying data and business logic of the application. It also
provides an abstraction of the real-world business object(s) and application service(s) that it
provides.

The Implementing the Model document in Chapter 3 discusses all of the following in detail.

Application Modules


                                                                                                  87
Oracle Application Framework Developer's Guide


A BC4J application module is essentially a container that manages and provides access to
"related" BC4J model objects. In this context, objects are "related" by virtue of participating in
the same task. For example, all the BC4J objects that comprise a single transaction participate
in the same task -- even if the corresponding user interface requires that the user visit multiple
pages.

Figure 2: Basic model architecture - Application Module associations




All application modules that you create subclass the
oracle.apps.fnd.framework.server.OAApplicationModuleImpl class.

Each OA Framework page has a "root" application module, which is associated with the top-
level page region (the pageLayout region). The root application module provides transaction
context and establishes a database connection.

     •   If multiple pages participate in the same physical or virtual transaction, they should share
         the same root application module.
     •   If a page functions independently of any other, it should have its own application module.

The OA Framework State Management document in this chapter discusses the relationship
between root application modules and different kinds of pages in detail.

Note: It is also possible for a root application module to contain one or more "nested"
application modules, which can themselves nest children to any arbitrary level. In this
scenario, the root application module has access to all the data/objects held by its children,
and all children participate in the same transaction established by the root. You will use this
feature whenever you want to create a reusable UI region that interacts with the database.

88
Oracle Application Framework Developer's Guide, Release 12.1.3


Entity Objects (and Association Objects)

BC4J entity objects encapsulate the business rules (validations, actions and so on) associated
with a row in a database table. For example, the OA Framework ToolBox Sample Library
includes a FWK_TBX_SUPPLIERS table for storing supplier definitions. We also defined an entity
object for this table (SupplierEO) that implements all the business rules for inserting, updating
and deleting a supplier.

Note: Entity objects can also be based on views, synonyms or snapshots.

OA Framework supports both Java and PL/SQL entity objects (Chapter 5 discusses business
logic design and implementation in detail, including advice on choosing Java versus PL/SQL
entity objects).

Figure 3: Basic model architecture - Entity Objects associations




Most entity objects that you create subclass the
oracle.apps.fnd.framework.server.OAEntityImpl class (you will see a bit later that
the PL/SQL entity objects extend specialized versions of OAEntityImpl).

There is a one-to-one mapping between a table and an entity object, and all Oracle E-Business
Suite entity objects should include all columns in their associated tables. Entity objects use a
declarative mapping between their attributes and underlying database columns to automatically
implement queries, inserts, updates and deletes. In most cases, all you need to do is add the
validation logic.



                                                                                                    89
Oracle Application Framework Developer's Guide


An entity object is intended to be used by any program (not just an OA Framework client) that
needs to interact with a given table. As such, it should consolidate all the validation logic for the
entity object so business rules are consistently implemented regardless of which client
exercises them.

Association Objects

If you have complex objects (like a 3-level purchase order with a 1:many relationship between
headers, lines and shipments) you can also define relationships between the corresponding
entity objects by creating association objects. You can create weak associations (a purchase
order header "references" a supplier which exists independently of any given purchase order)
and strong composition associations (a purchase order header "owns" its lines, which cannot
exist outside the context of their header).

View Objects (and View Links)

In the simplest terms, a BC4J view object encapsulates a database query. After a query is
executed, a view object provides iteration over and access to its result set. The result set
contains one or more view rows, where a view row comprised of individual attributes
corresponds to a row returned by a database query.

Figure 4: Basic model architecture - View Objects associations




All view objects that you create subclass the
oracle.apps.fnd.framework.server.OAViewObjectImpl class.

Each view object can be configured to query data using one of the following strategies:

90
Oracle Application Framework Developer's Guide, Release 12.1.3


    •    Its attributes map to columns in a simple SQL statement (commonly used for small,
         read-only view objects)
    •    Its attributes map to entity object attributes (used to insert, update and delete entity
         objects)
    •    Some attributes map to entity objects, and some are populated directly using SQL (used
         to augment the entity object data with transient columns that cannot be queried via an
         entity object -- a calculated value used exclusively for UI display purposes is a common
         example)

In an OA Framework application, you will use view objects in each of the following scenarios (all
of which are fully described in later topics):

    •    Present data that is optimized for a particular user interface. If the user interface
         supports entity object inserts, updates and deletes, you will interact with the view object
         to perform these tasks.
    •    Create simple queries for poplists, lists of values and other supporting UI components
    •    Create efficient "validation queries" that can be used in your business logic. For
         example, in a purchase order header entity object you might use a validation view object
         to get the current maximum purchase order line number from the database so it can
         cache and increment this value as new lines are created.

Finally, you will not only define view objects declaratively, but you will write code for them. In a
typical case, the code will implement data bindings for complex queries and execute the query
(so a view object knows how to "query" itself).

View Links

Just as you can relate entity objects, you can also create view object associations called view
links. For example, you can create a view link between a purchase order header view object
and a purchase order lines view object. This can be used at runtime to automatically query the
lines when a header is accessed.

OADBTransaction
Figure 5: Basic architecture model - OADBTransaction




                                                                                                   91
Oracle Application Framework Developer's Guide




* Note: To be completely accurate and consistent, this diagram should include the
implementation oracle.apps.fnd.framework.server.OADBTransactionImpl instead
of the oracle.apps.fnd.framework.OADBTransaction interface, however, we have
chosen to include latter since you will exclusively use the interface in your code.

As shown in the diagram above, the OADBTransaction plays a central role in your model
code since it encapsulates the JDBC connection/database session associated with a root
application module, and directly owns any entity objects that you create (your view objects,
owned by the root application module, hold references to their entity objects in their view rows).
You will also make regular use of the OADBTransaction in your model code for the following
common actions:

     •   Creating a callable statement for executing PL/SQL functions and procedures
     •   Accessing session-level Applications context information like the user's name, id, current
         responsibility and so on
     •   Accessing an oracle.apps.fnd.framework.OANLSServices object if you need to
         perform NLS operations like converting server date/time into user date/time and so on

Access to the OADBTransaction is provided by the root application module.

The View
The view formats and presents model data to the user.

The Implementing the View document in Chapter 3 discusses all of the following in detail.


92
Oracle Application Framework Developer's Guide, Release 12.1.3


Defining the Page

At development time, you specify the bean hierarchy for every page using the declarative
JDeveloper tool that we introduced in Building "Hello, World!". In Oracle E-Business Suite
development, you will work with (and source control) XML file page definitions. When your
product is deployed at a customer's site, the OA Framework runs the page definitions out of a
database repository.

To quickly recap, you use JDeveloper to define pages comprised of regions and items.

    •    Items are simple widgets like buttons, fields, images and so on which contain no
         children.
    •    Regions are container objects that can hold items and other regions. Examples of
         regions include headers, tables, and special layout components.
    •    Each region and item that you define has a style property that tells the OA Framework
         what web bean object to instantiate for it at runtime (and this in turn dictates what HTML
         is generated for the bean). For example, if you define a region whose style property is
         "table," the OA Framework will instantiate an
         oracle.apps.fnd.framework.webui.beans.table.OATableBean.
    •    All pages must have a single top-level region (often called the "root region") whose style
         is pageLayout. This is instantiated as an
         oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.
    •    The sequence in which regions and items appear in JDeveloper page tree (and the
         corresponding XML file) tells the Framework where to add these objects to the runtime
         bean hierarchy.

Figure 3 below gives a behind-the-scenes look at the kinds of web beans that are instantiated
for a simple page. The labels that you see name the underlying web beans. For example, a
poplist is instantiated as an
oracle.apps.fnd.framework.webui.beans.message.OAMessageChoiceBean, and a
submit button is instantiated as an
oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean. Figure 4
shows the corresponding page definition.

Figure 3: Page with UI components showing names of corresponding web beans




                                                                                                 93
Oracle Application Framework Developer's Guide




Note: The region and item names shown below do NOT comply with the Oracle E-Business
Suite naming standards; instead, they are intended to help you translate from the structure
to the corresponding web beans.

Figure 4: page structure in JDeveloper




94
Oracle Application Framework Developer's Guide, Release 12.1.3




Attribute Sets

Each region or item can inherit groups of property settings by using attribute sets. An attribute
set is a named, reusable collection of properties that can be used by any type of UI object,
including regions, items, and other attribute sets. Whenever you create a UI that uses attribute
sets, you can override the inherited properties (although this is discouraged in the OA
Framework coding standards).

To illustrate this concept, in Applications development, each table must have associated
attribute sets for each displayable column. These attribute sets include properties like prompt,
display width, and so on.

   •   In the OA Framework ToolBox Sample Library/Tutorial, we have a purchase orders table
       (FWK_TBX_PO_HEADERS) with a primary key column HEADER_ID of type NUMBER that is
       also displayed to users as the purchase order number.




                                                                                                   95
Oracle Application Framework Developer's Guide


     •    This table has an associated attribute sets XML package file called FwkTbxPoHeaders
          that includes all the attribute sets for the table's displayable columns (one attribute set
          per column). One of the attribute sets is called HeaderId.
     •    The HeaderId attribute set has the Prompt property set to Order Number and the
          Display Length set to something reasonable like 15.
     •    When we create a page that includes the purchase order number item, we would specify
          the Attribute Set property to the fully qualified attribute set name
          /oracle/apps/fnd/framework/toolbox/attributesets/FwkTbxPoheaders/
          Headerid

Figure 5: Using an attribute set in JDeveloper




Component Reuse

If you want to incorporate shared objects into your page, you can simply extend them.

For example, in the OA Framework ToolBox Sample Library/Tutorial we created a common
region (named PoSummaryRN) so the same content could be included in multiple pages
without recoding. To add this shared region to a page, we simply created a new region, and



96
Oracle Application Framework Developer's Guide, Release 12.1.3


then set its Extends property to the fully qualified name of the shared region:
/oracle/apps/fnd/framework/toolbox/tutorial/webui/PoSummaryRN

Note: The shared region is not editable in the referencing page, so its items are grayed out
in the JDeveloper Structure pane.

Figure 6: Extending a region JDeveloper




Data Source Binding

For beans with any database interaction (query, insert, update and/or delete), you also specify a
data source binding to a View Instance Name and associated View Attribute Name.
This binding is crucial because the OA Framework uses it to get queried data from, and write
user-entered data to, the underlying view object.

    •    The View Instance Name references the underlying view object within the context of
         its containing application module (all view objects "live" within an application module and
         are identified by an instance name within its container). For example, if a SuppliersVO
         view object is identified by the instance name "MySupVO" within your page's root
         application module, "MySupVO" is the name you would specify here.



                                                                                                     97
Oracle Application Framework Developer's Guide


     •   The View Attribute Name references the underlying view object attribute that maps
         to a column. For example, if your SuppliersVO has an attribute "SupplierId" (which
         maps to the underlying column SUPPLIER_ID), "SupplierId" is the name you would
         specify here.

Defining the Menu

All OA Framework applications include menus as described in the Oracle Browser Look and
Feel (BLAF) UI Guideline: Tabs/Navigation [ OTN Version ]. You define these menu structures
declaratively using Oracle E-Business Suite menu and function definition forms. We'll discuss
this in detail later in the Developer's Guide.

Just as the OA Framework translates your declarative UI layout into the runtime bean hierarchy,
it also includes web beans for the declarative menu definition.

Defining Page Flow

When dealing with multipage transaction flows, the OA Framework provides a declarative
(thereby customizable) alternative to complex, hard-coded controller logic. See Chapter 4:
Declarative Pageflow Using Workflow for additional information about this feature.

Personalizing Pages

The OA Framework also includes a declarative customization infrastructure called the OA
Personalization Framework. This is intended to support the customization needs of end users
and the product delivery chain (changes for localization, verticalization and so on).

Note: As you'll see throughout the Developer's Guide, creating regions and items
declaratively is always preferable to creating them programmatically. In fact, you should
create components programmatically ONLY if you cannot create them declaratively so
customers can personalize your work.

The Controller
The controller responds to user actions and directs application flow.

The Implementing the Controller document in Chapter 3 discusses all of the following in detail.

Controllers can be associated with the view at the region level (in more general terms, any OA
Framework web beans that implement the
oracle.apps.fnd.framework.webui.beans.OAWebBeanContainer interface can have
associated controllers).

All controllers that you create subclass
oracle.apps.fnd.framework.webui.OAControllerImpl as shown in Figure 7 below.

The controller class is where you define how the web beans behave. Specifically, you write
controller code to:

98
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   Manipulate/initialize the UI at runtime (including any programmatic layout that you are
       unable to do declaratively) and
   •   Intercept and handle user events like button presses

Request Handling

When the browser issues an OA.jsp request for one of your pages:

   1. The oracle.apps.fnd.framework.webui.OAPageBean (the main OA Framework
      page processing class) uses the page name to determine which root application module
      it needs so it can check it out from the application module pool. This application module
      also checks out a JDBC connection from the connection pool, and the transaction
      context for the page is established.
   2. The user session is validated; if invalid, a login page is displayed (note that this is a
      simplification; additional details are provided later in the Developer's Guide).
   3. Assuming the user is valid, the OAPageBean evaluates request parameters to figure out
      if it is dealing with an HTTP POST or a GET.

Handling a GET Request

When the browser issues a GET request to the server for a page (or you manually forward to it),
the OA Framework uses the declarative UI definition to build the web bean hierarchy:

   1. The OAPageBean calls processRequest() on the page's top-level pageLayout bean,
      and the entire web bean hierarchy is processed recursively as follows to initialize the
      web beans (including any associated model components):
          1. Each web bean instantiates its controller -- if it has one -- and calls
             processRequest(OAPageContext pageContext, OAWebBean
             webBean) on the controller. This is the method you use to construct/modify your
             page layout, set web bean properties and do any manual data initialization (if, for
             example, you need to perform an autoquery when you navigate to the page).
          2. Some complicated web beans (like the
             oracle.apps.fnd.framework.webui.beans.table.OATableBean and
             oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBe
             an) perform post-controller processing by calling their
             prepareForRendering() methods (this method is described in the
             corresponding bean Javadoc).
          3. Each web bean calls processRequest() on its children.
   2. The oracle.apps.fnd.framework.webui.OAPageBean gives the web bean
      hierarchy to UIX to render and send to the browser.

Handling a POST Request

When the browser issues a POST request to the server for a page:

   1. The OAPageBean checks to see if the web bean hierarchy is in memory. If not (because
      resources were reclaimed, the user navigated with the browser Back button, or a POST



                                                                                                 99
Oracle Application Framework Developer's Guide


       is issued to the main page from a dialog message page), it recreates the hierarchy as
       described in the GET processing above.
    2. The OAPageBean calls processFormData(OAPageContext pageContext,
       OAWebBean webBean)on all the beans in the hierarchy to write the form data to the
       model (specifically, it calls processFormData() on the pageLayout region, and then
       each web bean recursively calls processFormData() on its children). Writing the form
       data to the underlying model automatically invokes attribute and entity-level validations,
       and if you throw any validation exceptions, processing stops and error messages are
       displayed to the user.
    3. If no exceptions are thrown during the processFormData() phase, OAPageBean calls
       processFormRequest(OAPageContext pageContext, OAWebBean webBean)
       on all the beans in the hierarchy using the same approach described above. This pass
       gives your controller code the opportunity to respond to user actions.
    4. If no JSP forwards or page redirects were issued -- or exceptions were thrown in
       processFormRequest() -- then the page is refreshed.

OAPageContext

When the OA Framework receives an OA.jsp request, the OAPageBean creates an
oracle.apps.fnd.framework.webui.OAPageContext, a class that exists only for the
duration of page processing. Each of the three key methods described above
(processRequest(), processFormData() and processFormRequest()) takes an
OAPageContext as a parameter, and any controller code that you write will invariably make
use of this crucial class.

Figure 7: Relationship between the OAPageContext and other key classes




As illustrated in the diagram above, the OAPageContext has a reference to both the request
and the root application module. Given these relationships, and the fact that an
OAPageContext is passed to each of your controller response-processing methods, you can
see how you would use the OAPageContext for the following list of common tasks:

100
Oracle Application Framework Developer's Guide, Release 12.1.3


Accessing Request Parameters

Perhaps most importantly, this is the class that you use to read request values by calling a
simple getParameter(String name) method (remember that the request includes any URL
parameters plus -- if it is a POST -- any form field values plus the names and events associated
with any action/control widgets selected by the user).

Tip: For individual web beans on your page (buttons, fields, and so on) the name value
passed to getParameter() is the corresponding unique ID that you assign when defining
your page. So, for example, you can tell if the user pressed a button that you named
"GoButton" in JDeveloper by writing the following code in a controller:



processFormRequest(OAPageContext pageContext, OAWebBean webBean)

{

    if (pageContext.getParameter("GoButton") != null)

    {

        // The user pressed the "Go" button, do something...

    }

}

Accessing the Root Application Module

The OAPageContext caches a reference to the root application module, which in turn provides
access to its view objects and the transaction. If you need access to an application module, ask
the OAPageContext:



processFormRequest(OAPageContext pageContext, OAWebBean webBean)

{

    OAApplicationModule am =

        (OAApplicationModule)pageContext.getRootApplicationModule();

}

Issuing Navigation Instructions



                                                                                            101
Oracle Application Framework Developer's Guide


You use methods on this class to tell the OA Framework to perform a JSP forward or a client
redirect. For example (we'll review this method in greater detail later in the Developer's Guide):



processFormRequest(OAPageContext pageContext, OAWebBean webBean)

{

    if (pageContext.getParameter("CreateButton") != null)

    {

    // The user pressed the "Create Supplier" button, now perform a
JSP forward to

        // the "Create Supplier" page.




pageContext.setForwardURL("OA.jsp?page=/oracle/apps/dem/employee/webui
/EmpDetailsPG",

                                                 null,


OAWebBeanConstants.KEEP_MENU_CONTEXT,

                                                                                   null,

                                                                                   null,

                                                                                   true, //
Retain AM


OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // Show breadcrumbs


OAWebBeanConstants.IGNORE_MESSAGES);

    }

}

Accessing Application Context Information



102
Oracle Application Framework Developer's Guide, Release 12.1.3


Like the OADBTransaction in your model code, the OAPageContext provides access to
servlet session-level Oracle E-Business Suite context information like the user's name, id,
current responsibility and so on. For example, the following code snippet shows how to get the
user's name:



processRequest(OAPageContext pageContext, OAWebBean webBean)

{

    String userName = pageContext.getUserName();

}

Web Bean Architecture
First and foremost, all OA Framework web beans subclass corresponding beans in the UIX
framework. For example, an OATableBean extends an
oracle.cabo.ui.beans.table.TableBean ("cabo" was an earlier name for the UIX
framework, and the package definitions still use this old name).

Each OA Framework web bean also implements a group of interfaces whose implementations
collectively define the behaviors that the OA Framework adds to the base UIX beans.

    •   oracle.appps.fnd.framework.webui.beans.OAWebBean - defines core behavior
        common to all web beans (for example, among other key behaviors, this defines the
        processRequest, processFormData, and processFormRequest methods that
        individual beans implement for themselves).
    •   oracle.apps.fnd.framework.webui.OAWebBeanConstants - a collection of
        constants used in the view/controller modules
    •   oracle.apps.fnd.framework.webui.beans.OAWebBeanData - defines common
        personalization definition and data source management behavior
    •   oracle.apps.fnd.framework.webui.beans.OAWebBeanContainer - defines
        the characteristics of all web beans that can act as containers for other web beans. For
        instance, all the layout web beans implement this interface. Only beans which implement
        this interface can have associated controllers.
    •   OAWebBean<Type> - defines a bean's inherent behaviors within the context of the OA
        Framework. For example, the OATableBean implements the
        oracle.apps.fnd.framework.webui.beans.OAWebBeanTable interface.

Figure 8: Example of a container web bean (OATableBean)




                                                                                              103
Oracle Application Framework Developer's Guide




Internal Bean Structure

Each web bean maintains the following information about itself:

     •    _indexedChildren - child web beans
     •    _namedChildren - child web beans that UIX tags for special behavior
     •    _attributes - web bean characteristics (descriptive properties) as illustrated in Figure
          9 below

Figure 9: Illustration of web bean use of a Dictionary to track key/value pairs of its attributes




104
Oracle Application Framework Developer's Guide, Release 12.1.3


Data Bound Values

Instead of literal values as illustrated in Figure 9 above, OA Framework web bean attributes are
actually implemented as data bound values, meaning that the value is provided by an
underlying data source that is resolved to the component at rendering time. You will see a bit
later how to define and use custom bound values in your code.

Rendering

At page rendering time, the UIX framework processes the web bean hierarchy to generate the
page HTML.

For each web bean attribute, UIX calls its getAttributeValue() method while passing it a
rendering context (a rendering context is basically all the information that UIX needs to resolve
bound values). For a given attribute, for example, the rendering context knows what the
underlying view object instance, view attribute and current row are. The data bound value uses
the information supplied by the rendering context to interrogate its data source, and returns the
actual value to UIX so it can generate the corresponding HTML.

Guide to OA Framework Javadoc
You've probably already noticed that the Developer's Guide links directly to the OA Framework
Javadoc for individual classes. Given that you now have a high-level understanding of the
components that you'll be using when you build a page, this section briefly summarizes the
purpose of each OA Framework package and describes when you're likely to use the Javadoc
for the corresponding classes/interfaces.

oracle.apps.fnd.framework

Contains classes and interfaces which can be safely accessed from model (server) and user
interface controller or view (client) code. For example, if you need to access a root application
module in your page, you will use the
oracle.apps.fnd.framework.OAApplicationModule interface (you will never access
an implementation on the client).

Among other things, this package also includes:

   •   All OA Framework exceptions that you might have occasion to throw
   •   The OANLSServices class that you will use to perform internationalization operations

oracle.apps.fnd.framework.server

Contains classes and interfaces for implementing the model in an OA Framework Model-View-
Controller application.

These classes are intended to be used with any client user interface (not just OA Framework
HTML pages), and as such should have no direct references to any classes and interfaces


                                                                                               105
Oracle Application Framework Developer's Guide


published in the oracle.apps.fnd.framework.webui package and subpackages, or in any
application-specific webui packages and subpackages.

When building an OA Framework application model, you should always work with the classes in
this package instead of the BC4J classes they extend.

Warning: Never call any classes in this package from controller or view code.

oracle.apps.fnd.framwork.webui

Contains core classes for building and manipulating OA Framework HTML user interfaces.

Some of the most commonly used classes/interfaces in this package include:

   •   OAController
   •   OAPageContext
   •   Any class in the beans subpackages described below

Warning: Never call any classes in this package from model code.

oracle.apps.fnd.framework.webui.beans

Contains web bean classes for user interface components that don't fit neatly into the various
bean subpackages (for example: image, switcher, static instruction text, key flexfield, descriptive
flexfield and more). You should use these classes when writing a user interface controller that
needs to programmatically manipulate the web beans.

This package also contains core OA Framework interfaces implemented by all web beans.

The classes in this package and its subpackages correspond to the UIX components they
extend as shown below. When building OA Framework application pages, you should always
work with the OA Framework classes unless a new feature that you want to use has been
introduced in UIX, and is not yet supported by the framework.

Note: OA Framework classes are always instantiated for MDS pages that you build
declaratively in JDeveloper.

UIX Package                           OA Package
oracle.cabo.ui.beans                  oracle.apps.fnd.framework.webui.beans
oracle.cabo.ui.beans.form             oracle.apps.fnd.framework.webui.beans.form
oracle.cabo.ui.beans.include          oracle.apps.fnd.framework.webui.beans.include
oracle.cabo.ui.beans.layout           oracle.apps.fnd.framework.webui.beans.layout
oracle.cabo.ui.beans.message          oracle.apps.fnd.framework.webui.beans.message
oracle.cabo.ui.beans.nav              oracle.apps.fnd.framework.webui.beans.nav
oracle.cabo.ui.beans.table            oracle.apps.fnd.framework.webui.beans.table


106
Oracle Application Framework Developer's Guide, Release 12.1.3


Warning: Never call any classes in this package from model code.

oracle.apps.fnd.framework.webui.beans.form

Contains web bean classes for HTML form components including a submit button and various
data entry/specification controls (checkbox, radio group, shuttle, text input field and more). You
should use these classes when writing a user interface controller that needs to programmatically
manipulate the web beans.

For many of the web beans in this package there are variants in the
oracle.apps.fnd.framework.webui.beans.message package (the message web beans
have the ability to display error, information, and warning icons with an explanatory message
whereas corresponding data entry/specification web beans in this package do not). When you
create your pages declaratively in JDeveloper, the OA Framework automatically instantiates
message beans for any of those components that exist in both packages. You should use the
classes in this package only in the following cases:

   •   The class doesn't have a message bean alternative (for example, the
       OASubmitButtonBean exists only in this package)
   •   You cannot use the message bean alternative

Warning: Never call any classes in this package from model code.

oracle.apps.fnd.framework.webui.beans.include

Contains web bean classes for including user interface fragments from external sources
(servlets, JSP pages, and plain HTML) in OA Framework application pages. You should use
these classes when writing a user interface controller that needs to programmatically
manipulate the web beans.

Warning: Never call any classes in this package from model code.

oracle.apps.fnd.framework.webui.beans.layout

Contains web bean classes for laying out content in an OA Framework application page,
including special layout components like hide/show, content containers, bulleted lists, headers,
standardized templates for single/double column layouts and more. You should use these
classes when writing a user interface controller that needs to programmatically manipulate the
web beans.

Warning: Never call any classes in this package from model code.

oracle.apps.fnd.framework.webui.beans.message

Contains web bean classes for HTML form data entry/specification components that are
capable of displaying associated error, warning or information icon(s) with an explanatory
message (for example, if a user enters the wrong value in a text input field an error icon renders



                                                                                              107
Oracle Application Framework Developer's Guide


next to its prompt). You should use these classes when writing a user interface controller that
needs to programmatically manipulate the web beans.

Many of the web beans in this package are also included in the
oracle.apps.fnd.framework.webui.beans.form package without the ability to display
the supplemental message icons and text. When you create your pages declaratively in
JDeveloper, the OA Framework automatically instantiates message beans for any of those
components that exist in both packages. You should use the classes without the message
capability only if you cannot include message beans in your page.

Warning: Never call any classes in this package from model code.

oracle.apps.fnd.framework.webui.beans.nav

Contains web bean classes for HTML user interface navigation components (links, trees, menu
elements, quick links, breadcrumbs and more). You should use these classes when writing a
user interface controller that needs to programmatically manipulate the web beans.

Warning: Never call any classes in this package from model code.

oracle.apps.fnd.framework.webui.beans.table

Contains web bean classes for tables (which present data to the user in a tabular format) and
HGrid components (a hybrid of tabular data display with treelike hierarchical structure). You
should use these classes when writing a user interface controller that needs to programmatically
manipulate the web beans.

Warning: Never call any classes in this package from model code.

oracle.apps.fnd.framework.webui.laf

Contains utilities that can be used for controlling HTML rendering characteristics including the
page's look-and-feel and context-specific behavior (for example, content can be optimized for
printing versus display in a regular browser or in an e-mail).

Warning: Never call any classes in this package from model code.




108
Oracle Application Framework Developer's Guide, Release 12.1.3



OA Framework State Management
Overview
This document describes the OA Framework state management architecture, including the
mechanisms used for caching application custom data and communicating values from one
page to the next.

Contents

    •   Architectural Overview
    •   Root Application Modules (Database Session and Transaction State)
    •   Servlet Session
    •   Oracle E-Business Suite User Session
    •   Page Context
    •   Request
    •   State Persistence Model ("Passivation")
    •   Application Module Pooling

Architectural Overview
Figure 1 provides a conceptual application developer's view of the OA Framework state
management components. Each component shown in the illustration is discussed below.

Note: It is not intended to reflect all internal OA Framework details.

Figure 1: OA Framework primary state management components




                                                                                              109
Oracle Application Framework Developer's Guide




Root Application Modules (Database Session and Transaction
State)


110
Oracle Application Framework Developer's Guide, Release 12.1.3


As described in the OA Framework Page Anatomy document, each OA Framework page is
associated with a root application module that provides its transaction context and JDBC
database connection.

Note: In terms of OA Framework, a database session is associated with a JDBC
connection.

The root application module is the backbone of any OA Framework module because the core
application data (as stored in BC4J view objects, entity objects, and so on) and the page's web
bean hierarchy are automatically cached on the root application module's
oracle.apps.fnd.framework.OADBTransaction object.

Warning: The use of the browser Back button can cause the loss of application module
state. Be sure to review the advanced topic Supporting the Browser Back Button before you
start coding. The OA Framework coding standards published in Chapter 8 also include
specific recommendations for dealing with this.

Any data stored on the transaction is accessible to all pages that share the same root
application module instance (assuming that navigation between them involves retaining this
application module as described below). OA Framework provides methods that you can use to
store, retrieve and remove custom application values to/from a transaction. Since a single
transaction can be accessed from both controller (client) and model (server) code, these utilities
are provided in both the oracle.apps.fnd.framework.webui.OAPageContext (for the
controller) and OADBTransaction (for the model) classes.

Root Application Module Retention

By default , when the user navigates from one page to the next (such as with a GET request or
a JSP forward), and OA Framework renders the new page, the application module instance
associated with the previous page is "released," and a new instance is requested from an
application module pool. (See Application Module Pooling below).

Figure 2: Conceptual illustration of default root application module release when navigating to a new page




                                                                                                             111
Oracle Application Framework Developer's Guide




Note: OA Framework never releases application modules during form submit (POST)
requests unless you explicitly release the application module in a controller. For example, if
a user sorts a table or navigates the result set within a table -- two actions that implicitly
submit the page form -- the page's root application module instance is automatically
retained.

Retaining the Application Module Across Pages

The default behavior as described above is desirable for individual pages that comprise an
isolated, complete task. However, it is not appropriate for a multi-page flow that implements a
single task, or a series of related pages participating in a virtual transaction. In these cases, the
different pages should be associated with the same root application module instance.

Figure 3: Conceptual illustration of related pages sharing a root application module (and transaction)




112
Oracle Application Framework Developer's Guide, Release 12.1.3




To achieve this, you must do the following:

   •   Declaratively associate the same root application module type with each page in the
       multi-page flow. (See Implementing the View for additional details on specifying this
       page property in JDeveloper)
   •   Set the application module retention flag for a page by specifying the URL parameter
       retainAM=Y. For GET requests. This flag is evaluated when a new page is rendered
       (as mentioned above, OA Framework always retains the application module for POST
       requests regardless of the retainAM parameter value). If set to "Y," the previous page's
       application module instance will be retained. If set to "N" (or not specified, which implies
       "N"), OA Framework releases all application modules -- including any that might have
       been explicitly retained before reaching this point.

       You also set this parameter when calling JSP forward OAPageContext methods. See
       Implementing the Controller for additional details on controlling this programmatically.

Warning: It is not enough to simply associate the same root application module with each
page. If you forget to set the retainAM flag, each page will have a different application
module instance -- and transaction -- even though they are associated with the same
application module type.

Note: Technically, depending on the state of the application module pool, Page B could get
a reference to the same physical application module instance that Page A used. However,
the object's state will be completely reset as if created anew. For the purposes of this
discussion, consider it a "new instance."



                                                                                               113
Oracle Application Framework Developer's Guide


Figure 4: Conceptual illustration of two pages referencing the same root application module type, but the Retain AM flag is not
properly set




Similarly, setting the retainAM flag to "Y" -- but associating a different root application module
type with each of the page -- accumulates several different application module instances (one
for each page), each with its own transaction.

Conditionally Retaining/Releasing an Application Module

In some situations, you need to make a conditional determination about whether an application
module should be released or not. In these cases, you can implement the
oracle.apps.fnd.framework.webui.OAReleaseListener interface for individual
application modules as described in the Javadoc.

Warning: Oracle E-Business Suite developers should not use this interface without first
alerting the OA Framework development team. The incorrect use of this interface can lead
to inadvertent memory leaks, and the OA Framework team is currently tracking all
implementations.

Explicitly Releasing an Application Module

There are also times when you will want to explicitly release a root application module before
OA Framework would normally do this. Specifically, when you call the
OAPageContext.releaseRootApplicationModule() method in one of your page's
controllers, OA Framework releases the page's root application module as soon as it finishes
rendering the page, instead of waiting until the next application module request.


114
Oracle Application Framework Developer's Guide, Release 12.1.3


Root Application Module Retention Use Case Scenarios

The following use cases illustrate recommended approaches to application module
retention/release.

Use Case                  Recommendation
Unrelated, Discrete       When navigating between unrelated pages that present complete,
Tasks                     discrete tasks do not retain the application module. For example, a
                          series of unrelated administration tasks that are typically performed in
                          isolation (even if they are associated with the same menu item) are
                          unlikely to benefit from application module retention.
Multi-page Flow           When navigating between related pages that cooperatively comprise a
                          complete task within a single transaction, retain the application module.
Related Pages (Virtual When navigating between related pages that perform different tasks
Transaction)           associated with the same business object (even if the pages present
                       different commit points to the user), retain the application module if the
                       pages are closely associated in the UI. For example, a module that lets
                       you query, view, update, delete and print purchase orders benefits from
                       application module retention.
Multi-page Flow with      Having a multi-page flow with a branch transaction such as, creating a
Branch Transaction        supplier while creating a purchase order, retain the application modules
                          in the main purchase order flow and use the
                          OAPageContext.releaseRootApplicationModule method in the
                          Create Supplier page.

Note: Before passivation and JDBC connection pooling/harvesting was introduced in OA
Framework, developers were urged to release the application module with greater
frequency because it was expensive to hold on to the JDBC connections. This is no longer
a consideration if you are leveraging the passivation feature.

Servlet Session
As mentioned in the JSP Application Primer, a servlet session is a mechanism for maintaining
state between HTTP requests during a period of continuous interaction between a browser and
a web application. A session may be initiated at any time by the application, and terminated by
the application by the user closing the browser or by a period of user inactivity. A session
usually corresponds to an application login/logout cycle, but that is not strictly true in the case of
OA Framework applications. (See the Oracle E-Business Suite User Session below).

You have the option of caching small, serializable objects (the OA Framework restricts this to
Strings, Numbers and Dates) on the servlet session; any data that you cache is accessible to all
pages rendered within the session. For example, use this approach if you want to use
information that is too expensive to retrieve from the database each time it is required.

Note: Use the session cache only when you need to set and access simple values in many
pages, which have different root application modules. (The transaction cache discussed
above isn't an option). Be aware that servlet session values are not cleared automatically

                                                                                                  115
Oracle Application Framework Developer's Guide


unless the user logs out, returns to the global Home page to start a new transaction flow, or
the servlet session times out. Therefore, you must explicitly remove the session values that
are no longer needed. For this reason, consider the session a last choice for caching since
there is no good event point for freeing memory if the user simply abandons the session
without logging out.

Tip: Experienced JSP developers may wonder why hidden form fields aren't recommended
instead. Due to the way that OA Framework currently implements menus (some menu
selections issue a GET instead of a POST), it is not always possible to add values to the
corresponding request when a user navigates by making a menu selection, and root
application module boundaries are crossed.

If you want to store, retrieve and remove values from the servlet session, see the
OAPageContext put*(), get*() and remove*() methods for session values.

Oracle E-Business Suite User Session
When the user logs in to an OA Framework application, the OA Framework creates an AOL/J
oracle.apps.fnd.common.WebAppsContext object and a browser session-based cookie
that together keep track of key Oracle E-Business Suite context information like the current
responsibility, organization id and various user attributes such as user name, user id, employee
id and so on.

   •   The cookie contains an encrypted key identifier for a session row stored in the
       Applications database. Specifically, this is the servlet session ID which, in its decrypted
       form, serves as the primary key in the ICX_SESSIONS table.
   •   The WebAppsContext retrieves this key value after each request and uses it to query
       the current session state.
   •   The Oracle E-Business Suite user session is associated with a servlet session, however,
       it has its own life cycle and time-out characteristics. (See Appendix B: Profile Options for
       additional information about configuring the user session characteristics):
            o Generally, the Oracle E-Business Suite user session has a longer life span than
                the servlet session. The servlet session should time-out sooner.
            o An Oracle E-Business Suite user session might be associated with multiple
                servlet sessions. For example, the servlet session times out while the user takes
                a phone call in the middle of creating an OA Framework expense report, then
                resumes work before the Oracle E-Business Suite user session times out.
   •   If the Oracle E-Business Suite user session times out, as long as the user does not
       close the browser window (so the browser session-based cookie isn't lost) and no one
       deletes the corresponding session row in the ICX_SESSIONS table, the user can
       resume her transaction at the point where she stopped working after being prompted to
       log back in.

If you need access to any of the information stored with the Oracle E-Business Suite user
session, obtain it from OAPageContext (in your controller code) or OADBTransaction (in
your model code).

Applications Context State

116
Oracle Application Framework Developer's Guide, Release 12.1.3


You can also use the Applications context to store some state when you don't have access to
an OAPageContext (this is the case for Java server tier code or PL/SQL). To do this, use the
WebAppsContext.setSessionAttribute(java.lang.String pName,
java.lang.String pValue) method. For additional information, see the WebAppsContext
Javadoc.

Page Context
Each time a request is received for a page, OA Framework creates an OAPageContext that
persists until a new page finishes processing. Specifically, the OAPageBean -- which is the
primary force behind page processing -- creates the OAPageContext.

Request and Page Boundaries

As described in the JSP Application Primer document, a web application's unit of work is a
request/response pair: the browser submits a request, the servlet processes the request and
returns a response. The transmission of a response signifies the end of a single request, or the
"boundary" between the completed request and a new one.

Similarly, when the OAPageBean finishes processing a page, this is the "boundary" between the
current page and a new one.

So, in the following simple scenario where a user navigates from Page X to Page A and then to
Page B, there are two request boundaries: the first is between Page X and Page A, the second
is between Page A and Page B. There are also two page boundaries in the same conceptual
location between Page X and Page A, and Page A and Page B.

Figure 5: Conceptual illustration of request and page boundaries being the same




                                                                                                  117
Oracle Application Framework Developer's Guide




In some situations, however, the request and page boundaries are not the same. Consider the
following JSP Forward case:

   •   The user navigates from Page X to Page A as illustrated in Figure 5 above.
   •   While on Page A, the user selects a control that the Page A code must evaluate before
       deciding which page to display in response. The browser issues a request to Page A,
       which OA Framework processes, including creating an OAPageContext for the page.


118
Oracle Application Framework Developer's Guide, Release 12.1.3


         Once Page A finishes processing, the first page boundary is reached as illustrated in
         Figure 6 below.
    •    Within the Page A code, the developer evaluates which control the user selected and
         issues a JSP Forward to Page B. Instead of providing an HTTP response at this point
         since we don't want to redisplay Page A, OA Framework begins processing for Page B,
         including creating a new OAPageContext for this page. Once Page B finishes
         processing, the second page boundary is reached.
    •    Since Page B must now be displayed to the user, an HTTP response it sent to the
         browser. The request boundary is now reached.

Figure 6: Conceptual illustration of request and page boundaries differing in the JSP Forward case




It is important to understand this distinction for several reasons:

    •    Request parameters exist throughout the life span of the request -- which can span
         multiple page boundaries. This can be somewhat surprising for new OA Framework
         developers who simply assume that a request and a page are the same thing, and
         therefore do not account for request parameters "hanging around" after performing a
         JSP Forward. Consider the following example:
             o A user selects a link in Page X that navigates to Page A. The Page A URL
                 includes the parameter foo=bar.



                                                                                                     119
Oracle Application Framework Developer's Guide


           o   Page A issues a JSP Forward to Page B. Now, even though we are in a new
               page, the request still includes the value foo=bar.
           o   If you don't want a parameter value on the request after doing a JSP Forward,
               you must explicitly replace it. For example, in this case, simply reset the value to
               something like foo=X when you call the OAPageContext's setForward*()
               method.

               Note: You cannot actually remove parameters from a request.

               Tip: It is preferable to replace the unwanted parameter value with a new one that
               your code can use as an "ignore" value. Do not simply set the value to "".

   •   Since there isn't a one-to-one mapping between the page context and the request, some
       people find it a bit confusing that you access request parameters from the
       OAPageContext. Just remember that each page is a distinct entity, and from its "point
       of view," the OAPageContext represents the request.
   •   When you get into the details of passivation in Chapter 6, you'll see that page and
       request boundaries are distinct event points with different passivation implications.

Request
Although short-lived, an object is created for each HTTP request. This object contains the
following application state:

   •   Any URL parameters, regardless of whether the browser issued a POST or a GET
       request
   •   Assuming the browser issues a POST request: any form field data values such as, the
       data a user enters into a text field or the data a developer stores in a hidden field.
   •   Assuming the browser issues a POST request: the web bean and event names
       associated with a user's selection of action/control components. For example, if the user
       selects a "Go" button to execute a query, the request includes the web bean name of
       this button so you can ascertain that it was pressed and respond accordingly.

To access any of these request values, use OAPageContext getParameter*() methods.
You will not interact directly with the request itself.

To put values on the request (the preferred way of communicating between pages) you can do
any of the following. See Implementing the View and Implementing the Controller for additional
information about working with request parameters.

Note: The following is a general description of the request-passing mechanisms; there are
browser Back button considerations related to each of these techniques that you should
fully understand before building your pages. See Supporting the Browser Back Button in
Advanced OA Framework Development Topics.

Use Hidden Fields



120
Oracle Application Framework Developer's Guide, Release 12.1.3


A "hidden" field is a tool for developers to get/set values on a form that can't be accessed by the
user. Just as the user's field values are added to the request during a form submit, so are the
developer's field values -- assuming your page issues a POST.

You can create hidden fields declaratively in JDeveloper by selecting the formValue item style.
At runtime, these are instantiated as an
oracle.apps.fnd.framework.webui.beans.form.OAFormValueBean.

Specify Values During JSP Forward/Client Redirect

When you explicitly forward to a new page using the OAPageContext setForward*()
methods or issue a client redirect by calling OAPageContext.sendRedirect(), you can
optionally set request parameter values.

For example, Page A includes a submit button. When this button is selected, the user navigates
to Page B using a JSP Forward. Page A needs to pass a "mode" value to Page B, which can be
accessed several different ways so it knows how to behave.

   1. The user selects the submit button.
   2. In the Page A controller that handles this button press, we call
      OAPageContext.setForwardURL() in the processFormRequest() method. As
      part of this method call, we pass a request parameter named queryMode with a value of
      automatic.
   3. In a Page B controller we check for the queryMode parameter value in the
      processRequest() method by calling getParameter("queryMode").
   4. Page B's controller then responds to the fact that the queryMode value is automatic
      by immediately querying the data the page should display.

Specify Values by Calling OAPageContext.putParameter()

OAPageContext includes a putParameter() method that is used for passing values down
the web bean hierarchy during page processing. Values specified with a call to
putParameter() are not technically added to the request, but are stored in a special page
cache.

Tip: For those familiar with the HttpServletRequest.setAttribute() method in the
Java servlet 2.1 API, which is simply a way of stashing some information on the HTTP
request, consider this its equivalent.

Set URL Parameters Declaratively

Specify request parameter values when defining URLs declaratively in JDeveloper or by setting
the URL programmatically on web beans that have associated URLs.

Warning: The URL is space-constrained; be cautious about adding numerous URL
parameters, particularly if they are lengthy. Since the URL is visible to users, encrypt any
sensitive values as described later in Chapter 3.


                                                                                               121
Oracle Application Framework Developer's Guide


State Persistence Model ('Passivation')
OA Framework applications are largely transaction-oriented. Many transactions span multiple
pages, and these multi-page transactions require a certain amount of state to be preserved until
the user completes the associated task. For example, consider a multi-page purchase order
creation flow where the user describes the order in the first page, enters one or more line items
in the second page, and reviews the order before submitting it in the third page. The purchase
order data (its state) must remain intact between each of the browser requests for the
transaction to be completed successfully.

The HTTP protocol is inherently stateless; it does not retain any application-specific state
information or guarantee any support for state persistence. Furthermore, if the JVM instance
that provides the servlet session fails (in a stateful web application server deployment mode) --
or the servlet session times out -- application state is permanently lost, and pending
transactions cannot be recovered.

OA Framework incorporates the ability to transparently save and restore client state while the
user works -- even if the servlet session times out (a future release will provide JVM failover
support):

   •   The process of saving application state to a secondary medium (in the case of OA
       Framework, database tables) is called passivation.
   •   The process of restoring this state from the secondary medium is called activation.

Specifically, OA Framework currently provides the following state management features.

   •   Scalable Applications - when resource consumption is high, rather than creating a new
       dedicated resource instance for each new server thread, OA Framework saves
       application state for idle threads and reclaims their resources for use by others. When
       the idle user thread wakes up, the saved application state is restored. In short, memory
       is reclaimed for idle JDBC connections, application modules, and user sessions without
       adversely affecting the user experience.
   •   Servlet Session Time-Out Recovery - servlet sessions can time out without forcing the
       user to restart an incomplete transaction. (In the future, this feature will be extended to
       provide middle-tier failover support.

For information about enabling/configuring passivation in your system, including a detailed
explanation of what data is -- and is not -- passivated, see Chapter 6 - OA Framework State
Persistence Model (Passivation).

Application Module Pooling
To improve performance and scalability, OA Framework pools (caches and reuses) application
modules. Reuse is much more efficient than recreation. In simple terms:

   •   Each Java Virtual Machine (JVM) has an application module pool manager that contains
       and manages individual application module pools.
   •   Each application module pool contains multiple instances of the same application
       module. For example, if an application uses two root application modules

122
Oracle Application Framework Developer's Guide, Release 12.1.3


         (oracle.apps.fnd.framework.toolbox.tutorial.server.Lesson3AM and
         oracle.apps.fnd.framework.toolbox.tutorial.server.Lesson4AM), there
         would be two application module pools as shown in Figure 7 below. In other words, a
         pool is created for each root application module type in your product.
    •    Application module instances within the pool are designated as being available for use,
         or unavailable (currently "checked out").
    •    Only root application modules are pooled; nested application modules are pooled as
         children of the root application module.

To learn more about how this works for both application modules and connections, including
how to configure, monitor and optimize pool performance in an OA Framework application
deployment, see the Chapter 6 advanced topic Application Module and Connection Pooling. In
particular, focus on the sections titled Architectural Overview and Application Module Pooling in
this topic.

Figure 7: Conceptual illustration of application module pool




                                                                                                  123
Oracle Application Framework Developer's Guide




124
Oracle Application Framework Developer's Guide, Release 12.1.3



Chapter 3: Building an OA Framework
Application (the Basics)
Implementing the Model
Overview
This document describes how to implement your model objects in generic terms.

Contents

   •   Designing Model Objects
   •   Recommended Build Approach
   •   Business Components Packages
   •   Entity Objects
   •   Entity Associations (Association Objects)
   •   View Objects and View Rows
   •   View Links
   •   Application Modules
   •   Entity Objects, Entity Experts, 'Validation' Application Modules and 'Validation' View
       Objects
           o Validation View Objects (VVOs)
           o Validation Application Modules (VAMs)
           o Entity Experts
   •   Reusing Business Objects

Prerequisite Reading

This document assumes that you have read the following in the OA Framework Developer
Guide:

   •   Building 'Hello, World!'
   •   JSP Application Primer
   •   Anatomy of an OA Framework Page
   •   OA Framework State Management

Designing Model Objects

'Client' / 'Server' Code Separation

Within the Model-View-Controller architecture, OA Framework draws a clear distinction between
"client" and "server" classes, a distinction that on the surface may seem to conflict with JSP
application architecture as described in the JSP Application Primer. In Chapter 2, we say that a
typical JSP application has 3 physical tiers:


                                                                                                125
Oracle Application Framework Developer's Guide


    •    The browser (the client where our HTML renders and users interact with the UI)
    •    The web application server (the middle tier where our UI web bean hierarchy is
         constructed and our application business logic executes)
    •    The database server

Within the middle tier, OA Framework draws a further distinction between "client" and "server"
classes as follows:

    •    Client classes (View and Controller code) drive the HTML user interface
    •    Server classes (Model code) supports any client (not just OA Framework) user
         interfaces

This distinction is important because it preserves the ability to use server code with different
clients. Consider the following image which illustrates the relationships between a page's UI
controllers, application modules, UI-specific view objects, and the underlying entity objects:

Figure 1: OA Framework "onion" showing code layers and boundaries




In general, to enable reuse at the layer boundaries, objects reference down the dataflow stack,
but not up.

    •    Model code should never reference controller code directly. For example, view objects
         and application modules should not call methods in your UI controllers, and entity
         objects should not reference UI application modules and view objects, as discussed
         later. However, entity objects can and do make use of server-side validation application
         modules and view objects.
    •    Never reference/import any server-side implementation classes or interfaces on the
         client-side (classes/interfaces that are in the oracle.apps.fnd.framework.server



126
Oracle Application Framework Developer's Guide, Release 12.1.3


       package). For example, do not call methods on an
       oracle.apps.fnd.framework.OADBTransaction in your UI controller.
   •   If you need the server code to do some work for you, always route your calls through the
       root application module using the generic "remoteable" invokeMethod() method on
       the oracle.apps.fnd.framework.OAApplicationModule interface, or create an
       interface for your application modules so you can call typed methods, whose invocation
       can be checked at compile time. The application module can delegate or implement the
       logic as required.
   •   Note: The OAApplicationModule interface is in the oracle.apps.fnd.framework
       package and therefore, does not violate the rule stated in the first sentence of this bullet-
       point. All classes, interfaces, and exceptions in the oracle.apps.fnd.framework
       package can safely be used in both client and server code.

       If you opt to create an interface for your application module instead of using
       invokeMethod(), create this interface in the package directory immediately above your
       implementation. For example, the EmployeeAM interface for the
       oracle.apps.fnd.framework.toolbox.labsolutions.server.EmployeeAMI
       mpl application module should be created in the
       oracle.apps.fnd.framework.toolbox.labsolutions package.

   •   Never include JDBC or other server-side processing directly in your client code. Again, if
       the UI client needs information from this server it should ask the application module,
       which can then delegate or implement the request appropriately.

Coding Standards Compliance

Before defining any model objects or writing supporting code, read the following documents
carefully. While this topic mentions several key model standards, it is not intended to be a
comprehensive checklist. For any OA Framework code that you write, the documents in Chapter
8 should be considered the single source of truth for coding standards.

   •   Chapter 8: Oracle E-Business Suite Java Coding Standards
   •   Chapter 8: OA Framework Naming / File / Package / Directory Structure Standards
   •   Chapter 8: OA Framework Model Coding Standards

Recommended Build Approach
If you are preparing to build your first OA Framework application , you might find it easiest to
proceed as follows for a small module (a single page, or a few simple, related pages that
participate in the same transaction).

Note: This assumes you have completed your design work, and are ready for
implementation. It also assumes that you are building a complete module, not just the UI, or
just the business logic.

   1. Create any business components packages that you need for your BC4J model objects.
   2. Implement declarative BC4J application module, entity object, entity association, view
      object and view link definitions needed for your page(s). Add view objects to your root
      application module(s) as appropriate. Don't worry about writing code at this stage.

                                                                                                   127
Oracle Application Framework Developer's Guide


   3. Create the menu definition for your application (discussed in Implementing the View).
   4. Create the OA user interface components for your page(s) (discussed in Implementing
      the View).
   5. Create and implement controller code (discussed in Implementing the Controller).
   6. Implement UI application module code supporting your pages.
   7. Implement entity object business logic.

Business Components Packages
All BC4J model components must belong to a Business Components (BC4J) package.

Note: This section assumes that you have set up your development environment, created
an OA Workspace, and defined a working datasource as described in Building and Running
"Hello, World!".

   1. In the JDeveloper Navigator, select the OA Project where you want to create your
      package.
   2. From the main menu, choose File > New to open the New Object Gallery.
   3. In the Categories tree, expand the Business Tier node, and select Business
      Components (BC4J).
   4. In the Items list, select Business Components Package to open the Business
      Components Package Wizard. You can also right-click on the OA Project and select
      New Business Components Package to navigate directly to the Business Components
      Package Wizard.
   5. In Step 1 of 3, enter a Package Name that complies with the OA Framework File /
      Directory / Package Structure standards. Also select Entity Objects mapped to
      database schema objects in the business entity modeling section. Select the Next
      button.
   6. In Step 2 of 3, verify your Connection Name (it should point to the database where you
      want to work; JDeveloper uses this information in all of the BC4J component wizards).
      Set the SQL Type and the Type Map to "Oracle."
   7. Select the Finish button to save your changes.

To change the database connection associated with an existing BC4J package, which you need
to do if you change your development environment:

   1.   Select the OA Project with the business components package you want to edit.
   2.   Right-click and select Edit Business Components Project.
   3.   In the Business Components Project Wizard, select Connection.
   4.   Specify your new database.
   5.   Select OK to save your changes.

Entity Objects
This introduces the basics of entity object creation/usage. See Java Entity Objects and PL/SQL
Entity Objects in Chapter 5 for additional information about working with these objects.

As described in Anatomy of an OA Framework Page, an entity object implements the business
rules for a given table, view, or snapshot. Entity objects are intended to be used in many clients

128
Oracle Application Framework Developer's Guide, Release 12.1.3


(not just an OA Framework UI), and as such, should consolidate all of the relevant
validation/behavior for the table.

   •   Each table should have at most one entity object.
   •   Entity objects should include attributes for all columns in its table.
   •   You can subclass your own common entity objects (for example, see the Advanced
       Model Development Topics in Chapter 6 to learn how to create polymorphic entity
       objects that extend a common base class).
   •   You will commonly add object initialization, attribute validation, entity-level validation,
       and other functional behaviors to your entity objects.
   •   You can also create "entity expert" singletons to perform work shared by multiple related
       entity objects in a composite business object, such as a purchase order which has a
       header, lines and shipments. Other referencing entity objects can also use the entity
       expert to perform lightweight validations (for example, a purchase order might ask a
       supplier's entity expert if a supplier id that it wants to reference is valid). Entity experts
       are discussed later.
   •   Finally, you can create server "helper" objects and interfaces as needed to create
       modular code. For example, as illustrated in the OA Framework ToolBox Tutorial, you
       can create one or more helper objects to perform processing on multiple entity object
       types.

Declarative Implementation

For additional information about Entity Object Wizard properties not specifically described here,
see the JDeveloper documentation.

Note: You can access context-sensitive Help while in any of the BC4J wizards by selecting
the F1 key on your keyboard.

To create a new entity object in a Business Components (BC4J) package:

   1. In the JDeveloper Navigator, select the BC4J package where you want to create your
      entity object.
   2. From the main menu, choose File > New to open the New Object Gallery.
   3. In the Categories tree, expand the Business Tier node, and select Business
      Components (BC4J).
   4. In the Items list, select Entity Object to open the Entity Object Wizard. You can also
      right-click on the BC4J package and select New Entity Object to navigate directly to the
      Entity Object Wizard.
   5. In the Name page (Step 1 of 5):

       Figure 2: Entity Object Wizard Name Page (Step 1 of 5)




                                                                                                 129
Oracle Application Framework Developer's Guide




          o   Specify the entity object's Name in accordance with the OA Framework File /
              Directory / Package Structure standards.
          o Verify that you have selected the right BC4J Package.
          o Do not enter a value in the Extends Entity Object field unless you are
              deliberately subclassing one of your own entity objects.
          o Specify a Schema Object (the exact name of the table for the entity object) as
              shown in Figure 2, to improve the wizard's performance. You do not need to
              check the Synonyms or Tables checkboxes.
          o Select Next to proceed.
   6. In the Attributes page (Step 2 of 5), you should see all the columns in the table that you
      specified in the Name page.

      Figure 3: Entity Object Wizard Attributes Page (Step 2 of 5)




130
Oracle Application Framework Developer's Guide, Release 12.1.3




       o    Do not remove any entity attributes so as to include all of the table's columns,
       o    Select New... to create a transient attribute that is used in the business logic,
            such as a calculated OrderTotal in a purchase order that is used for approval
            checking.

            Note: To display a calculated value for an entity object that isn't really relevant to the
            business logic itself (it is very UI-specific), you can always create an attribute for it in
            the view object as described below.

       o Select Next to proceed.
7. In the Attribute Settings page (Step 3 of 5), verify or set the following information for
   each of the entity object's attributes:

   Figure 4: Entity Object Wizard Attribute Settings Page (Step 3 of 5)




                                                                                                    131
Oracle Application Framework Developer's Guide




          o   The Attribute and Database Column Name and Type properties default correctly
              from the table definition.
          o   All database column attributes have the Persistent and Queriable checkboxes
              selected as shown.
          o   For primary key columns, ensure that the Primary Key and Mandatory
              checkboxes are selected.

              Warning: If you fail to define your primary keys, BC4J will generate a ROWID key for
              you. You should explicitly define your primary key instead of relying on ROWID as
              your primary key because this can lead to problems. For example, in a Real
              Application Cluster with database partitions, the same database row can have a
              different ROWID in different partitions. Similarly, if a table is partitioned, the ROWID
              can change inside a transaction if the row is migrated.

          o   For columns that are never updateable, or updateable only when new, select the
              appropriate Updateable radio button.
          o   For columns whose values change after database triggers execute, select the
              Refresh After update or insert as appropriate.
          o   Never select the Unique checkbox; uniqueness checking should always be
              performed programmatically (the state of this checkbox has no impact on runtime
              behavior; BC4J uses it to create a database constraint if you generate a table
              from the EO wizard).
          o   Note: The Unique property has no effect if the EO is created on an already existing
              database table.
          o   The Discriminator column is used for polymorphic entity objects as described in
              Chapter 6 Advanced Model Development Topics.


132
Oracle Application Framework Developer's Guide, Release 12.1.3


              o If you are using an Object Version Number column, select the Change Indicator
                checkbox for it. See Chapter 5 for information about this.
            o Select Next to proceed.
    8. In the Java page (Step 4 of 5) page:
            o Check the option for generating an Entity Object Class. In the Generate Methods
                box, opt to generate Accessors, a Create Method and a Delete Method.
            o Select the Extends... button to verify that you will be subclassing
                oracle.apps.fnd.framework.server.OAEntityImpl for the Row (the
                entity object).
    9. Select Finish to save your entity object definition and implementation. BC4J will create
        an XML definition file and a Java implementation file for your entity object as shown in
        Figure 5. Note that you can quickly view the underlying table and attributes included in
        the entity object by simply selecting it in the System Navigator.
    10. Select your entity object, right-click and select Edit<EntityName>... Navigate to the
        Tuning page and check the Use Update Batching property. Set the Threshold value to
        100. See the OA Framework Model Coding Standard M68 for additional information
        about batch DML updates, including a list of situations in which this feature cannot be
        used.

Figure 5: JDeveloper System Navigator and Structure pane showing a selected entity object




                                                                                                 133
Oracle Application Framework Developer's Guide




134
Oracle Application Framework Developer's Guide, Release 12.1.3


Multilanguage "_TL" Entity Objects

To create a multilanguage "_TL" entity object, follow the special instructions published in Java
Entity Objects for Translatable Tables.

PL/SQL Entity Objects

To create a PL/SQL entity object, follow the special instructions published in PL/SQL Entity
Objects.

Programmatic Control

For detailed information about coding entity object business logic, see Java Entity Objects and
PL/SQL Entity Objects.

Entity Associations (Association Objects)
Associations let you create declarative relationships between entity objects. At runtime, BC4J
uses these relationships to coordinate the related objects. There are two basic types of
associations:

   •   Composition - A strong association where the source entity object owns the destination
       entity object. In other words, the destination cannot exist independent of its source. For
       example, a purchase order header is comprised of purchase order lines, which have no
       meaning or life span outside the context of their header.
   •   Reference - A weak association where the source entity object only references the
       destination entity object. For example, a purchase order header references a supplier,
       but the supplier can still exist regardless of whether a purchase order references it or
       not.

Create composition associations as appropriate for all your entity objects and ensure that they
are properly created, initialized and managed at runtime. BC4J automatically treats
compositions as a logical unit, so for example, a purchase order header is automatically locked
even if you make changes only to its lines).

Create reference associations for any entity objects that you're likely to update or instantiate at
runtime. For example, create associations between a purchase order header and its supplier if
you can update a supplier while editing a purchase order, but don't create associations between
purchase orders and a freight terms lookup code entity object.

Declarative Implementation

For additional information about Association Wizard properties not specifically described here,
see the JDeveloper documentation.

Note: You can access context-specific Help while in any of the BC4J wizards by selecting
the F1 key on your keyboard.


                                                                                               135
Oracle Application Framework Developer's Guide


     1. In the JDeveloper Navigator, select the BC4J package where you want to create your
        association object.
     2. From the main menu, choose File > New to open the New Object Gallery.
     3. In the Categories tree, expand the Business Tier node, and select Business
        Components (BC4J).
     4. In the Items list, select Association to open the Association Wizard. You can also right-
        click on the BC4J package and select New Association Object to navigate directly to the
        Association Wizard.
     5. In the Name page (Step 1 of 3):
             o Specify the association's Name in accordance with the OA Framework File /
                 Directory / Package Structure standards.
             o Verify that you have selected the right BC4J Package.
             o Do NOT enter a value in the Extends Association field unless you are
                 deliberately subclassing one of your own associations.
             o Select Next to proceed.
     6. In the Entity Objects page (Step 2 of 3), specify the association's cardinality (for
        example, is it a one-to-many relationship?) and select the source and destination join
        attributes as shown in Figure 5. Select the Add button to create the join (repeat as
        necessary for a multi-key relationship). Select Next to proceed.

Figure 5: Selecting source and destination entity objects and attributes in the Entity Object (Step 1 of 3) page




136
Oracle Application Framework Developer's Guide, Release 12.1.3




    7. In the Association Properties page (Step 3 of 3):
           o Check the Expose Accessor options as appropriate for the source and
               destination objects (an accessor lets the object get a reference to the other end
               of the association).
           o Select the Composition Association checkbox if the destination object cannot
               exist outside the context of the source object.

                   Note: For compositions, always check the Expose Accessor option on the
                   destination object. Optionally, enable this for the source object as required in your
                   code.

          o Do not select any of the other page options.
    8. Select Finish to save your association. BC4J creates an XML definition file as shown in
       Figure 6.

         Note: You can quickly view the underlying relationship by simply selecting the association in
         the System Navigator.

Figure 6: JDeveloper System Navigator and Structure pane showing a selected association object



                                                                                                       137
Oracle Application Framework Developer's Guide




Programmatic Control

Association objects have no implementation, so you will not write any code for them. In Chapter
5, we discuss how to access an entity object using an association.

View Objects and View Rows
This introduces the basics of view object and view row creation/usage. See View Objects in
Detail in Chapter 5 for additional information about working with these objects.

Design Considerations

As described in Anatomy of an OA Framework Page, view objects encapsulate database
queries and provide access to associated entity objects. One of the most important view object
design decisions is whether it should be based on plain SQL, or on entity objects.

   •   All trivial UI view objects for things like Lists of Values (LOV) and poplists are based on
       plain SQL.
   •   Any validation view objects, created to implement simple business rules for an entity
       object, are based on plain SQL. See the Entity Objects, Entity Experts, "Validation"
       Application Modules and "Validation" View Objects topic below for additional information.
   •   All other view objects created for the UI, regardless of whether they are updateable, are
       based on entity objects.

138
Oracle Application Framework Developer's Guide, Release 12.1.3


For performance reasons, view objects need to be optimized for a given use case. Creating
several small, task-specific view objects is preferable to sharing a single, large view object in a
range of UIs. View objects should be considered UI-specific.

Avoid using dynamic WHERE clauses wherever possible (view objects support the ability to
modify their declarative definitions programmatically). If possible, statically define 3 different
view objects for the same SELECT -- each with a declarative WHERE clause to which you can
simply bind at runtime. However, It is appropriate to modify the WHERE clause in view objects
used with complex query criteria because it is impractical to create individual definitions for
every possible query criteria combination.

View objects, like any BC4J objects, can be created declaratively and programmatically. For
performance reasons it is preferable, if you can, to declaratively define the view object.

Declarative Implementation

For additional information about View Object Wizard properties not specifically described here,
see the JDeveloper documentation.

Note: You can access context-specific Help while in any of the BC4J wizards by selecting
the F1 key on your keyboard.

Important: Whenever you create a view object, always generate a view row
implementation class. You should generate a view object implementation class
only if you intend to write any code for the view object.

You can create a shared view object, which subclasses
oracle.apps.fnd.framework.server.OAViewObjectImpl, that you can then subclass
to create more specific behaviors.

SQL View Objects

To create a new view object in a Business Components (BC4J) package that is based entirely
on a SQL query:

   1. In the JDeveloper Navigator, select the BC4J package where you want to create your
      view object.
   2. From the main menu, choose File > New to open the New Object Gallery.
   3. In the Categories tree, expand the Business Tier node, and select Business
      Components (BC4J).
   4. In the Items list, select View Object to open the View Object Wizard. Note that you can
      also right-click on the BC4J package and select New View Object to navigate directly to
      the View Object Wizard.
   5. In the Name page (Step 1 of 7):
          o Specify the view object's Name in accordance with the OA Framework File /
               Directory / Package Structure standards.
          o Verify that you have selected the right BC4J package.
          o Do NOT enter a value in the Extends View Object field unless you are
               deliberately subclassing one of your own view objects.

                                                                                                 139
Oracle Application Framework Developer's Guide


           o Select Next until you get to Step 5.
    6. In the Query page (Step 5 of 7):
           o Enter your query in the Select Statement field (do not include a semicolon). Note
               that you must always use Oracle-style bindings (select emp_name from emp
               where emp_id = :1) if you expect to bind variables at runtime.
           o Select the Test... button to verify that your query is correct.
           o Select Next to proceed.
    7. In the Attribute Mappings page (Step 6 of 7):
           o Verify that Query Columns you defined in your SELECT match the View
               Attributes. If they don't match, click the View Attribute value that is in error to
               activate a poplist. Select the correct attribute.
           o Select Next to proceed.
    8. In the Java page (Step 7 of 7):
           o Always check the option to generate a View Row Class (including accessors).
           o Check the option to generate a View Object Class only if you anticipate writing
               any code for your view object (you can always generate this class later if you
               need to, or delete it if you generate it now and find later that you don't have a
               need for it).
           o Select the Extends... button to ensure that you are subclassing the OA
               Framework classes
               oracle.apps.fnd.framework.server.OAViewObjectImpl and
               oracle.apps.fnd.framework.server.OAViewRowImpl as appropriate. If
               you need to correct the default values, select Browse... to open the Find
               Superclass window.
    9. Select Finish to save your new view object. BC4J will create an XML definition file and
       Java implementations as shown in Figure 7.

         Note: You can quickly view the underlying attributes and view links by selecting the view
         object in the System Navigator.

Figure 7: JDeveloper System Navigator and Structure pane showing a selected view object




140
Oracle Application Framework Developer's Guide, Release 12.1.3




At this point, you are not quite finished with the creation process. To proceed, you need to edit
the view object as follows:

   1. In the JDeveloper Navigator, select the view object that you just created, right-click and
      select Edit <viewobject_name>....
   2. In the View Object Wizard, select Tuning.

                                                                                               141
Oracle Application Framework Developer's Guide


   3. In the Tuning page, deselect the Enable Passivation checkbox. Select OK to save your
      changes.

Entity Object View Objects

To create a new view object in a Business Components (BC4J) package that is based entirely
on entity objects:

   1. In the JDeveloper Navigator, select the BC4J package where you want to create your
      view object.
   2. From the main menu, choose File > New to open the New Object Gallery.
   3. In the Categories tree, expand the Business Tier node, and select Business
      Components (BC4J).
   4. In the Items list, select View Object to open the View Object Wizard. Note that you can
      also right-click on the BC4J package and select New View Object to navigate directly to
      the View Object Wizard.
   5. In the Name page (Step 1 of 6):
          o Specify the view object's Name in accordance with the OA Framework File /
               Directory / Package Structure standards.
          o Verify that you have selected the right BC4J package.
          o Do NOT enter a value in the Extends View Object field unless you are
               deliberately subclassing one of your own view objects.
          o Select Next to proceed.
   6. In the Entity Objects page (Step 2 of 6):
          o In the Available list, select the entity objects that you want to include in the view
               object and shuttle them to the Selected list.
          o Indicate whether the entity objects are Read Only, and if they should be treated
               as a Reference (see the JDeveloper documentation for additional information
               about this page).
          o Select Next to proceed.
   7. In the Attributes page (Step 3 of 6) select the attributes that you want to include from the
      Available list and shuttle them to the Selected list. Select Next to proceed.
   8. In the Attribute Settings page (Step 4 of 6), verify that the default information is correct.
      Select Next to proceed.
   9. In the Query page (Step 5 of 6):
          o Verify that the query BC4J generated for you is correct. If not, select the Expert
               Mode checkbox to make the query editable.

              Note: For expert mode view objects, do NOT try to set a value in your SELECT
              statement for an EO attribute. For example, do not assume the flag column is based
              on an EO attribute as this results in a locking failure because BC4J tries to compare
              this value with the original database value and complains that they are different. See
              Java Entity Objects for valid approaches to setting attribute default values.

              SELECT x pk1, y pk2, z status, 'Y' flag, ....

          o    Select the Test... button to verify that your query is correct.
          o    Select Next to proceed.
   10. In the Java page (Step 6 of 6):
           o Check the option to generate a View Row Class (including accessors).


142
Oracle Application Framework Developer's Guide, Release 12.1.3


           o  Check the option to generate a View Object Class only if you anticipate writing
              any code for your view object (you can always generate this class later if you
              need to, or delete it if you generate it now and find later that you don't have a
              need for it).
          o Select the Extends... button to ensure that you are subclassing the OA
              Framework classes
              oracle.apps.fnd.framework.server.OAViewObjectImpl and
              oracle.apps.fnd.framework.server.OAViewRowImpl as appropriate. If
              you need to correct the default values, select Browse... to open the Find
              Superclass window.
   11. Select Finish to save your new view object.

Once you have created an entity object-based view object, you must edit it to tune its
passivation properties as described above. For example, for a view object used to update entity
objects, the Passivation option should be checked in the Tuning page. See Chapter 6 OA
Framework State Persistence Model (Passivation) for additional information.

Hybrid View Objects (Expert-Mode View Objects)

You can also create view objects that are based on entity objects, and include SQL attributes. In
this case, create the view object as described in the entity object case above, with a few small
modifications:

   •   In the Attributes page, select the New button to create attributes for the non-entity object
       values that you want to query directly.
   •   In the Query page, select Expert Mode to edit the generated SQL as needed to retrieve
       these "calculated" values.
   •   In the Attribute Mappings page (displayed only if you have SQL-based attributes),
       ensure that the Query Columns and View Attributes match.

Primary Keys

Per the OA Framework Model Coding Standard M39, almost all view objects require primary
keys. You can specify primary keys declaratively when defining attributes, or you can set them
programmatically by calling setKeyAttributeDefs() on OAViewObjectImpl.

Programmatic Control

Query Handling

Each view object implements its own search, and if necessary, should be capable of translating
incoming parameters to bind variables and WHERE clause phrases. As a general coding
practice, all methods that perform this work should be named initQuery() or some
descriptive variant like initNewEmployeesQuery() if you need multiple "init" methods.

Note: You must also use "Oracle-style" binding ( FOO >= :1 ) instead of ANSI-style binding
( FOO >= ? ). Although the code is a little more complex, the OA Framework team plans to
desupport the ANSI-style bindings in the Fusion release.


                                                                                               143
Oracle Application Framework Developer's Guide


The following example illustrates how to modify a WHERE clause and bind search criteria based
on the values passed to the initQuery method.



// Initialize and execute the query
public void initQuery(String name, String onHold, String number)
{

      StringBuffer whereClause = new StringBuffer(100);
      Vector parameters = new Vector(3);
      int clauseCount = 0;
      int bindCount = 0;

      setWhereClauseParams(null); // Always reset



      if ((name != null) && (!("".equals(name.trim()))))

      {

          whereClause.append(" NAME like :");

          whereClause.append(++bindCount);

          parameters.addElement(name + "%");

          clauseCount++;

      }



      if ((number != null) && (!(""Equals(number.trim()))))

      {



          Number supplierId = null;



          // SUPPLIER_ID is a NUMBER; datatypes should always

          // match, and the parameter passed to this method is a

          // String.

144
Oracle Application Framework Developer's Guide, Release 12.1.3


    try

    {

        supplierId = new Number(number);

    }

    catch(Exception e) {}



    if (clauseCount > 0)

    {

        whereClause.append(" AND ");

    }



    whereClause.append(" SUPPLIER_ID = :");

    whereClause.append(++bindCount);

    parameters.addElement(supplierId);

    clauseCount++;

}



if ((onHold != null) && (!(""Equals(onHold.trim()))))

{

    if (clauseCount > 0)

    {

        whereClause.append(" AND ");

    }



    whereClause.append(" ON_HOLD_FLAG = :");

                                                                                 145
Oracle Application Framework Developer's Guide


          whereClause.append(++bindCount);

          parameters.addElement("Y");

          clauseCount++;

      }



      setWhereClause(whereClause.toString());



      if (bindCount > 0)

      {

          Object[] params = new Object[bindCount];



     // the copyInto() is 1.1.8 compliant which, as of 4/02/03, is
required by ARU



          parameters.copyInto(params);

          setWhereClauseParams(params);

  }



  executeQuery();



 } // end initQuery( )

Business Logic

View objects are not an appropriate home for business logic; you should not be writing
validation rules in your view objects or view rows.

View Rows



146
Oracle Application Framework Developer's Guide, Release 12.1.3


Although you should always create a view row as mentioned above, for the most part, you won't
need to write view row code. View row code is useful in cases where you want to calculate a
transient attribute value, for example, but you can't or don't want to include the logic in your
query (perhaps the performance cost is too high). You can also use view row code to perform
simple validations of transient attributes used in the UI, or call custom entity object methods
(see the "Approve" example in the Application Module section below for additional information).

Custom view row methods may not be accessed directly on the client. The client must first
invoke a method on the application module, which delegates to the view object. The view object
provides access to the view row. Furthermore, to realize the performance benefit of having the
view row class, always call the generated setters/getters (for example, setSupplier()) on the
row if you need to programmatically access or set values. This is because it is much faster than
calling the generic setAttribute("<AttributeName>") and
getAttribute("<AttributeName>"). For example, the Entity Object Delete Example in
the Application Module section below shows how to properly retrieve a view row attribute value.

View Links
As described above, an association defines a relationship between two entity objects. Similarly,
a view link defines a relationship between two view objects that BC4J uses to automatically
query and coordinate the destination view object based on the current source view object.

View links can be based on an association or a declarative join relationship between two view
objects. For example, suppose two tables have a master-detail relationship based on a foreign
key. The corresponding entity objects are related via an association, and view objects based on
those entity objects can be related by a view link based on the association.

Although view links can be very convenient, use them sparingly in the web applications pages
because they cache both the master and detail records as the user navigates from one master
row to the next -- and this can be expensive. Use view links only in the following cases:

   •   When specific beans (like the HGrid) require them.
   •   When you have updateable master/detail view objects (on the same or different pages)
       whose underlying entity objects are related using composition, you must define a view
       link between them (we discuss this further in Chapter 5).
   •   When you have a read-only master and detail view object on the same page, and
       navigating to a master row should cause the children to query automatically.

Declarative Implementation

For additional information about View Link Wizard properties not specifically described here,
see the JDeveloper documentation.

Note: You can access context-specific Help while in any of the BC4J wizards by selecting
the F1 key on your keyboard.

To create a new view link in a Business Components (BC4J) package:



                                                                                                147
Oracle Application Framework Developer's Guide


    1. In the JDeveloper Navigator, select the BC4J package where you want to create your
       view link.
    2. From the main menu, choose File > New to open the New Object Gallery.
    3. In the Categories tree, expand the Business Tier node, and select Business
       Components (BC4J).
    4. In the Items list, select View Link to open the View Link Wizard. Note that you can also
       right-click on the BC4J package and select New View Link to navigate directly to the
       View Link Wizard.
    5. In the Name page (Step 1 of 6):
           o Specify the view link's Name in accordance with the OA Framework File /
                Directory / Package Structure standards.
           o Verify that you have selected the right BC4J package.
           o Do NOT enter a value in the Extends View Link field unless you are deliberately
                subclassing one of your own view objects.
           o Select Next to proceed.
    6. In the View Objects page (Step 2 of 6), select the Source and Destination view objects.
       Select Next to proceed.
    7. In the Source Attributes page (Step 3 of 6), specify the join attribute or association
       object of the source object (if available) as shown in Figure 8. Select Next to proceed.

Figure 8: View Link Wizard showing use of an association to obtain the source view object join attribute




    8. In the Destination Attributes page (Step 4 of 6), specify the join attribute or association
       of the destination object. Select Next to proceed.
    9. In the View Link SQL page (Step 5 of 6), review the WHERE clause that BC4J is going to
       create for you to ensure that it is correct.

148
Oracle Application Framework Developer's Guide, Release 12.1.3


Tip: If there are no primary keys specified in the source and destination view objects, BC4J
cannot properly create a WHERE clause. If these fields are disabled, check your view object
definitions.

Figure 8: View Link Wizard showing a generated WHERE clause




    10. In the View Link Properties page (Step 6 of 6,) specify the cardinality between the view
        objects and indicate whether you want to generate accessors from the source to the
        destination and vice versa.
    11. Select Finish to create your view link. BC4J will create an XML definition file as shown in
        Figure 9. Note that you can quickly view the underlying relationship by selecting the view
        link in the System Navigator.

Figure 9: JDeveloper System Navigator and Structure pane view of a selected view link




                                                                                                 149
Oracle Application Framework Developer's Guide




Programmatic Control

Since view links have no implementation, you do not write any code for them. In Chapter 5, we
discuss how to access a view object using a view link.

You can however, create view links dynamically by using the
oracle.jbo.ApplicationModule createViewLinkBetweenViewObjects API. Refer to
the corresponding JavaDoc for an example of how to use this method.

Note: Both the Master and Detail view objects participating in a programmatically created
view link should belong to the same application module instance.

Application Modules
This introduces the basics of application module creation/usage. See Application Modules in
Detail in Chapter 5 for additional information about working with these objects.

Application Module Uses

The following is a list the distinct roles that application modules can play in your application:



150
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   UI Root Application Module - Establishes the transaction context for one or several
       related UI pages. Every page has a root application module which includes any view
       objects and nested application modules used by the page.
   •   UI Shared Region Application Module - Any UI region with created for use in multiple
       pages should have its own containing application module. When this region is used in a
       page, OA Framework automatically nests its application module beneath the page's root
       application module. See Implementing the View for additional information on creating
       shared regions.
   •   UI List of Values Application Module - This is a special case of the previous role. When
       you create List of Values (LOV) view objects, you add these components to an
       application module dedicated to the job of aggregating LOVs for a given package.
   •   Validation Application Module - A validation application module aggregates related view
       objects created for the purpose of performing lightweight SQL validations. Entity objects
       and experts make use of validation application modules, which have nothing to do with
       the user interface. See the Entity Objects, Entity Experts, 'Validation' Application
       Modules and 'Validation' View Objects topic below for additional information.

Declarative Implementation

For additional information about Application Module Wizard properties not specifically described
here, see the JDeveloper documentation.

Note: You can access context-specific Help while in any of the BC4J wizards by selecting
the F1 key on your keyboard.

Creating New Application Modules

Note: Create a shared application module that subclasses
oracle.apps.fnd.framework.server.OAApplicationModuleImpl, which you then
subclass to create more specific behaviors.

To create a new application module in a Business Components (BC4J) package:

   1. In the JDeveloper Navigator, select the BC4J package where you want to create your
      application module.
   2. From the main menu, choose File > New to open the New Object Gallery.
   3. In the Categories tree, expand the Business Tier node, and select Business
      Components (BC4J).
   4. In the Items list, select Application Module to open the Application Module Wizard.
      Note that you can also right-click on the BC4J package and select New Application
      Module to navigate directly to the Application Module Wizard.
   5. In the Name page (Step 1 of 5):
          o Specify the application module's Name in accordance with the OA Framework
               File / Directory / Package Structure standards.
          o Verify that you have selected the right BC4J package.
          o Do NOT enter a value in the Extends Application Module field unless you are
               deliberately subclassing one of your own application modules.
          o Select Next until you get to Step 4.
   6. In the Java page (Step 4 of 5), deselect the Generate Java File(s) checkbox ONLY if you
      are certain that you won't be writing any code for your application module (you can
                                                                                            151
Oracle Application Framework Developer's Guide


       always delete the class later if you find that you don't need it, so it's probably best to
       simply generate it at this point unless you are creating a simple container for LOV view
       objects). If you do want to generate an implementation class for your application module,
       select the Extends... button to verify that you will be subclassing
       oracle.apps.fnd.framework.server.OAApplicationModuleImpl.
    7. Select Finish to create your application module. BC4J will create an XML definition and
       implementation file as shown in Figure 10.

         Note: You can quickly view the underlying contents by selecting the application module in
         the System Navigator.

Figure 10: JDeveloper System Navigator and Structure pane view of a selected application module




At this point, you are not quite finished with the creation process. To proceed, edit the
application module as follows:

Important: Do not set the application module's Retention Level to MANAGE_STATE
(steps 2 and 3 below) if you are not yet ready to fully implement and certify your page for
passivation support. See Model Coding Standard M8 for more details .




152
Oracle Application Framework Developer's Guide, Release 12.1.3


   1. In the JDeveloper Navigator, select the application module that you just created, right-
      click and select Edit <appmodule_name>....
   2. In the Application Module Wizard, select Properties.
   3. In the Properties page, create a passivation property as described in OA Framework
      State Persistence Model (Passivation). For example, the most common application
      module passivation configuration involves setting the application module's Retention
      Level to MANAGE_STATE. To do this:
          1. Type RETENTION_LEVEL in the property Name field.
          2. Type MANAGE_STATE in the property Value field.
          3. Select Add to create the property.
   4. Finally, while you are still in the application module wizard, navigate to the Tuning page.
      Verify that the Customize Runtime Instantiation Behavior checkbox is checked, and the
      Lazy Loading radio button is selected (note that you should also review Application
      Modules in Detail for a detailed description of the Lazy Loading feature and several use
      case considerations).
   5. Select OK to save your changes.

Generating Application Module Interfaces

To generate an application module interface so you can invoke typed methods directly (with
compile-time checking) instead of calling invokeMethod(), you must first create the methods
that you want to expose to the client. Then:

   1. In the JDeveloper Navigator, select the application module that you just created, right-
      click and select Edit <appmodule_name>....
   2. In the Application Module Wizard, select Client Methods.
   3. Select the methods you want to be able to invoke remotely in the Available list and
      shuttle them to the Selected list.
   4. Select OK to create your interface.

JDeveloper automatically creates an interface in the correct package and with the correct name
per the OA Framework File Standards.

Adding View Objects

Tip: When you create a view object for a particular purpose, immediately add it to the
appropriate application module so you don't forget to do it later.

All view objects are used in the context of a given application module.

View objects are instantiated on an "as needed" basis (in previous releases, BC4J instantiated
all the view objects associated with a given application module when the application module
was created). For example, if you write code to find a specific view object so you can query it, or
a UI page renders with items bound to view object attributes, BC4J automatically instantiates
the necessary view objects. If a view object that is associated with an application module is not
required at runtime, it is not instantiated.

To create this relationship declaratively for a given view object and application module:



                                                                                               153
Oracle Application Framework Developer's Guide


    1. In the JDeveloper Navigator, select the application module that you just created, right-
       click and select Edit <appmodule_name>....
    2. In the Application Module Wizard, select Data Model .
    3. In the Data Model page, select the view objects that you want to include from the
       Available View Objects list and shuttle them to the Data Model list.
    4. Optionally change the default view Instance Name. A single view object can be added to
       the same application module multiple times (for example, you could perform the same
       query in multiple regions within the same UI task/module). Each view object instance
       has a unique identifier; this unique identifier is the Instance Name. When you add a view
       object to an application module, BC4J creates the default instance name by appending
       an integer to the view object's name as shown in the Figure 11. To edit this value, simply
       select the view object in the Data Model list and make your changes in the updateable
       field below the list.

Figure 11: Application Module Wizard Data Model page showing a default view Instance Name




Note: To add a detail view object (accessed via a view link) to the application module,
follow these steps in the Edit Application Module dialog. You must adhere to these
instructions to properly access the detail view object; it's not sufficient to simply add the
detail view object as a peer to the master view object.


154
Oracle Application Framework Developer's Guide, Release 12.1.3


    1. Select the master view object in the Data Model view
    2. Select the detail view object in the Available View Objects view and shuttle it to the Data
       Model view

If you added the detail view object correctly, it will appear as shown in Figure 12.

Figure 12: Application Module Wizard Data Model page showing a detail view object added to its master via a view link




Adding Nested Application Modules

You can nest application modules to any arbitrary level.

Nested application modules are instantiated on an "as needed" basis (in previous releases,
BC4J instantiated all the nested application modules when the containing application module
was created). For example, if you do a findApplicationModule , BC4J will instantiate the object.
If a nested application module is never accessed, it is not created.

To add a nested application module to your application module:

    1. In the JDeveloper Navigator, select the application module that you just created, right-
       click and select Edit <appmodule_name>....
    2. In the Application Module Wizard, select Application Modules .
    3. In the Application Modules page, select the application module(s) that you want to
       include from the Available list and shuttle them to the Data Selected list.
    4. Optionally change the default application module Instance Name as described for view
       objects above.

                                                                                                                        155
Oracle Application Framework Developer's Guide


Programmatic Control

Do NOT code business logic, such as validations, in application modules; this should be coded
in underlying entity objects instead. The application module is an appropriate place for logic
that:

    •   Provides access to any associated BC4J objects. For example, in Implementing the
        Controller, you will see that controllers should never access view objects directly when
        they need to execute a query. Instead, they must invoke methods on the page's
        application module asking for a particular query to be executed.
    •   Performs multiple server-side actions, or spans multiple view objects as the result of a
        single event or method invocation. For example, code that copies all the rows from View
        Object A to View Object B belongs in this class.
    •   Returns server side values to the client that cannot be accessed from an
        OAPageContext. If, for example, your page needs a specific server value to determine if
        a region should be rendered or an item should be read-only, the application module
        should provide this information.
    •   Calls special PL/SQL routines.

        Tip: If the PL/SQL routines are used for validation and processing of individual rows (or a set
        of rows), then you should use PL/SQL-based entity objects instead. See Chapter 5 for
        additional information about using PL/SQL entity objects.

Method Naming

Any application module methods that directly supports the UI should be named for the
corresponding UI "events." For example, if the user presses a Create button, the application
module method should be named "create" and shown in the following examples.

Note: Corresponding controller invocations of all the following examples are included in
Implementing the Controller.

Entity Object Create Example

The following example illustrates an application module method that creates and inserts a row
into the SuppliersVO view object. This particular view object is based on the
SupplierEOImpl entity object, so BC4J instantiates this behind the scenes when the row is
created.



public void createSupplier()

{

    OAViewObject vo = getSuppliersVO();

    Row row = vo.createRow();


156
Oracle Application Framework Developer's Guide, Release 12.1.3


    vo.insertRow();



    // As specified in OA Framework Model Coding Standards,
    // set the new row state to STATUS_INITIALIZED.



    row.setNewRowState(Row.STATUS_INITIALIZED);

}

View Object Query Examples

This shows an application module method that queries the SuppliersVO view object using
search criteria passed from the client.



public void query(String supplierName, String onHoldFlag, String
supplierNumber)

{



 SuppliersExpVOImpl vo = getSuppliersExpVO();



    if (vo == null)

    {

    MessageToken[] tokens = { new MessageToken("OBJECT_NAME",
"SuppliersExpVO")};

        throw new OAException("ICX", "FWK_TBX_OBJECT_NOT_FOUND", tokens);

    }



    vo.initQuery(supplierName, onHoldFlag, supplierNumber);



} // end query()

                                                                                         157
Oracle Application Framework Developer's Guide


This example illustrates a query that initializes a page when the user navigates to it. Note the
browser Back button check to ensure that a query isn't executed needlessly. See Chapter 6
Supporting the Browser Back Button for additional information).



public void init(String status)

{

    PoSimpleSummaryVOImpl vo = getPoSimpleSummaryVO();

    if (vo == null)

    {

    MessageToken[] tokens = { new MessageToken("OBJECT_NAME",
"PoSimpleSummaryVO")};

        throw new OAException("ICX", "FWK_TBX_OBJECT_NOT_FOUND",tokens);

    }

  // Follows Back Button standard of never performing a blind query
without

    // checking to see if this is necessary.



    if (!vo.isPreparedForExecution())

    {

        vo.initQuery(status);

    }

} // end init()

Entity Object Delete Example

This illustrates how to search a view object row set for a single selected object so that the entity
object can be deleted.



/**


158
Oracle Application Framework Developer's Guide, Release 12.1.3


 * Deletes a purchase order from the PoSimpleSummaryVO using the

 * poHeaderId parameter.

 */

public void delete(String poHeaderId)

{

    // First, we need to find the selected purchase order in our VO.

    // When we find it, we call remove( ) on the row which in turn

    // calls remove on the associated PurchaseOrderHeaderEOImpl object.



    int poToDelete = Integer.parseInt(poHeaderId);



    OAViewObject vo = getPoSimpleSummaryVO();

    PoSimpleSummaryVORowImpl row = null;



    // This tells us the number of rows that have been fetched in the

    // row set, and will not pull additional rows in like some of the

    // other "get count" methods.



    int fetchedRowCount = vo.getFetchedRowCount();



  // We use a separate iterator -- even though we could step through
the

    // rows without it -- because we don't want to affect row currency.

  // Note that there are also convenience methods for finding matching
rows

    // in a view object (see javadoc).

                                                                                  159
Oracle Application Framework Developer's Guide




  RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");



  if (fetchedRowCount > 0)

  {

      deleteIter.setRangeStart(0);

      deleteIter.setRangeSize(fetchedRowCount);



              for (int i = 0; i < fetchedRowCount; i++)

      {

      row =
(PoSimpleSummaryVORowImpl)deleteIter.getRowAtRangeIndex(i);



               // For performance reasons, we generate ViewRowImpls for all

          // View Objects. When we need to obtain an attribute value,

      // we use the named accessors instead of a generic String
lookup.



          // Number primaryKey = (Number)row.getAttribute("HeaderId");

          Number primaryKey = row.getHeaderId();



               if (primaryKey.compareTo(poToDelete) == 0)

          {

              row.remove();

              getTransaction().commit();

              break; // only one possible selected row in this case

160
Oracle Application Framework Developer's Guide, Release 12.1.3


            }

        }

    }



    deleteIter.closeRowSetIterator();



} // end deletePurchaseOrder()

Custom Action Example ("Approve")

This illustrates how to search a view object row set for one or more selected objects to call a
custom entity object event.



/**

 * Steps through the POSimpleSummaryVO to look for selected rows. For

 * each selected row, this calls the approve( ) method on the

 * PurchaseOrderHeaderEOImpl class.

 */

public void approvePurchaseOrders( )

{

  // To call a custom method on an Entity Object you should add a
wrapper

    // in the VO's *RowImpl class (see

  //
oracle.apps.fnd.framework.toolbox.schema.server.PoSimpleSumaryVORowImp
l).



    OAViewObject vo = getPoSimpleSummaryVO();

    PoSimpleSummaryVORowImpl row = null;

                                                                                                  161
Oracle Application Framework Developer's Guide




  int matches = 0;



  // This tells us the number of rows that have been fetched in the

  // row set, and will not pull additional rows in like some of the

  // other "get count" methods.

  // Note that there are also convenience methods for finding matching
rows

  // in a view object (see javadoc).



  int fetchedRowCount = vo.getFetchedRowCount();



  // We use a separate iterator -- even though we could step through
the

  // rows without it -- because we don't want to affect row currency.



  RowSetIterator approveIter = vo.createRowSetIterator("approveIter");



  if (fetchedRowCount > 0)

  {

      approveIter.setRangeStart(0);

      approveIter.setRangeSize(fetchedRowCount);



           for (int i = 0; i < fetchedRowCount; i++)

      {

          // For every row with a selected checkbox, we want call

162
Oracle Application Framework Developer's Guide, Release 12.1.3


         // the approve( ) wrapper on the POSimpleSummaryVORowImpl which

      // in turn calls the approve ) method on the
PurchaseOrderHeaderEOImpl.



      row =
(PoSimpleSummaryVORowImpl)approveIter.getRowAtRangeIndex(i);



              // For performance reasons, we generate ViewRowImpls for all

         // View Objects. When we need to obtain an attribute value,

      // we use the named accessors instead of a generic String
lookup.



         // String selectFlag = (String)row.getAttribute("SelectFlag");

         String selectFlag = row.getSelectFlag();



         if ("Y"Equals(selectFlag))

         {

             row.approve( );

             matches++;

         }

     }

 }



 approveIter.closeRowSetIterator();



  // If the user didn't actually select any rows, display an error
message.

                                                                                     163
Oracle Application Framework Developer's Guide




    if (matches > 0)

    {

        getTransaction().commit();

    }

    else

    {

        throw new OAException("ICX", "FWK_TBX_T_SELECT_FOR_APPROVE");

    }



} // end approve()

Commit Example



/**

 * Provides a "commit" wrapper so UI controller code doesn't need to

 * get a handle to the transaction itself which is a violation of the



 * client/sever tier separation rules.

 */

public void apply()

{

    getTransaction().commit();



} // end apply()



164
Oracle Application Framework Developer's Guide, Release 12.1.3


Testing Your Application Modules

Once you finish adding your view objects to your application modules, you can use the Business
Component Browser ( BC4J Tester) to run your view objects before you build an OA Framework
UI for them, or write any code to support your BC4J objects. For example, you can query view
objects (including the ability to navigate through master rows to query children linked with a view
link).

See Testing OA Framework Applications for instructions on how to enable this utility.

Entity Objects, Entity Experts, 'Validation' Application Modules
and 'Validation' View Objects
For detailed information about using entity objects, entity experts, validation application modules
and validation view objects together, see Chapter 5. This section simply introduces the objects
and the roles they play in an application.

Validation View Objects

When you implement business logic in your entity objects, you will frequently find that you need
to execute some simple SQL statements, and not just for pure validation purposes. For
example, a purchase order header has many lines. Each line is assigned a unique line number.
This number is defined as the current maximum line number for the entire purchase order + 1.
At runtime, we need to query the database to find out what the maximum line number is for a
given purchase order header:

SELECT MAX(LINE_NUMBER) FROM FWK_TBX_PO_LINES WHERE HEADER_ID = :1;

Whenever you need to execute SQL like this, you can create a view object dynamically from a
SQL statement, or you can predefine a declarative view object for it. That being said, OA
Framework Model Coding Standards require that you use the declarative strategy in this case
since it is more performant: a view object is cached in its respective application module, which
allows entity object code to reuse it (and the underlying JDBC prepared statement) by simply
rebinding and re-execute the query. This is an important performance benefit since validation
routines are called repeatedly.

Implementation

From an implementation standpoint, validation view objects are no different from regular view
objects; they are differentiated only by the use case. However, always disable passivation for
these view objects, which should never have associated state and should always be
recreatable. See OA Framework Model Coding Standards.

Validation Application Modules (VAMs)

Predefined view objects must be assigned to an application module so that they can be
accessed at runtime. In other words, view objects do not exist outside the context of an
application module.

                                                                                               165
Oracle Application Framework Developer's Guide


Since entity objects (and their associated validation view objects) can be shared by multiple UI
clients (and the root application modules should be considered UI-specific), it is not appropriate
to use the root application module for a particular page to hold your validation view objects.
Instead, to group these utility view objects into meaningful, reusable units, create a validation
application module per business object to hold them. A business object is defined the top-level
entity object in a composition, or a single entity object if it stands alone. For example, the OA
Framework ToolBox Tutorial purchase order is comprised of 3 entity objects, but the
PurchaseOrderHeaderEOImpl class represents the purchase order business object.

For example, in the OA Framework ToolBox Tutorial, we created a business object-level
validation application module called PurchaseOrderVAM and added all of the purchase order's
validation view objects to it.

Implementation

From an implementation standpoint, validation application objects are no different from regular
application objects; they are differentiated only by the use case. Create your validation
application module declaratively and associate the appropriate validation view objects with it.

Entity Experts

The entity expert is a singleton defined to be a special affiliate of a business object (either the
top entity object in a composition, or a standalone entity object). It includes common code called
by the owning business object, or simple validation routines called by other entity objects that
don't want the cost of instantiating the entity object itself. For example, a
PurchaseOrderHeaderEOImpl class doesn't want to instantiate a whole SupplierEOImpl
class just to find out if the supplierId foreign key it's about to set is valid. Instead, it calls an
isSupplierIdValue(Number supplierId) method on the supplier's entity expert
singleton -- a much lighter weight operation.

Implementation

To create an entity expert, first create a class that extends
oracle.apps.fnd.framework.server.OAEntityExpert. The class should be named
and packaged according to the standards published in the OA Framework File / Package /
Directory Structure standards. Second, you need to associate this class with an entity object:

Note: For composition business objects, associate the expert with the top-level object.
Otherwise, simply associate it with the standalone entity object.

   1. In the JDeveloper System Navigator, select the entity object to which you want to attach
      the expert. Right-click and select Edit <EntityOjectName>...
   2. Navigate to the Properties page to create a new property with the following
      characteristics:
          o Set the Name to ExpertClass.
          o Set the Value to the fully qualified name of your expert class. For example:
              oracle.apps.fnd.framework.toolbox.schema.server.PurchaseOrd
              erEntityExpert.
   3. Select Add to create your property.

166
Oracle Application Framework Developer's Guide, Release 12.1.3


   4. Select OK to save your changes.

Reusing Business Objects

Entity Objects, Associations, Validation AMs, Validation VOs, Entity
Experts

If you wish to create Entity Object, Association, Validation AM, Validation VO, or Entity Expert
business objects for reuse, you should be aware of the following standards:

   •   The owner of the underlying data schema solely owns the corresponding Entity Objects,
       Associations, Validation Application Modules, Validation View Objects, and Entity
       Experts.
   •   The owner product team of these business objects must document and publish them for
       other product teams to reuse.
   •   When you create a composite association that involves your EO (YourEO) and another
       product team's EO (OtherBaseEO), you must first extend the OtherBaseEO into your
       product space (OtherExtendedEO) before creating the association between YourEO and
       OtherExtendedEO.
   •   Another product team who is consuming the business objects that you own may want to
       extend the validations that you provide. In such a case, the consumer product team
       should extend the Entity Object, Validation Application Module, Validation View Object
       and Entity Expert and include custom definitions and code in the extensions. When
       extending validation methods, make sure that you invoke super() at the top of the
       extended validation methods. Please see the Extending Business Objects subsection
       below for more details.

Extending Business Objects

The following diagram depicts objects that you deal with when creating business objects and the
associated extensions that you want to make to extend validations.




The first row of the above diagram represents an exhaustive list of all possible objects you might
create when defining an entity object. The first box illustrates that when creating an entity object,
two files get generated: the metadata definition XML file and the actual implementation Java
class file. Entity Objects handle attribute level and record level validations. These validations
often need to use Validation View Objects (VVO). Validation Objects are grouped under
Validation Application Module (VAM). Like Entity Objects, creating VVO's and VAM's, generates
a metadata definition XML file and an implementation java class file for each object. Finally,
Entity Objects sometimes rely on a helping class to offer among other services, a validation

                                                                                                 167
Oracle Application Framework Developer's Guide


service optimized for usage by other Entity Objects. This helping class is the Entity Expert and
linked to the Entity Object through an entity object property.

The above diagram illustrates a case where all business objects are extended. That is not
necessarily always the case. In most cases, you may be satisfied with extending just some of
these objects. Note that you should never edit the base definition of an object or make a copy of
a base object. You should always extend the relevant object and use substitution/factory
mechanisms to reference the extended objects.

For example you may be satisfied with extending the Entity Expert to override a validation
method such as isSupplierValid. In this case, note that it is not wise to reference the
extended Entity Expert (MyEntityExpert) directly from the base entity object (EntityEO.XML) as
such an approach does not survive upgrades. A better approach requires extending the base
entity object using the JDeveloper entity object creation wizard and updating the entity expert
property on the extended entity object to point to the extended Entity Expert.

Another approach is to simply extend the entity object through the JDeveloper entity object
creation wizard to add an extra validation to the OtherExtendedEOImpl class (make sure you
invoke super() first) that doesn't require any additional validation view objects.

Note that business object extensions are placed under the consumer product teams' package
hierarchy.

View Objects, View Links

If you wish to create View Object or View Link business objects for reuse, you should be aware
of the following standards:

   •   View Objects and View Links are created for a particular user interface or business logic.
       Having said that, a product team that owns these objects may choose to publish certain
       View Objects and View Links for public consumption.
   •   The owning product team of a public view object must provide the necessary
       documentation and must guarantee the objects' contract (WHERE clause, attributes, and
       so on).
   •   Other product teams may extend a public base view object's capabilities by using the
       JDeveloper view object creation wizard.
   •   You can also extend a public view object definition to include extra attributes, if desired.

For more information on Extensibility, refer to Chapter 9: Extending and Deploying OA
Framework Applications.




168
Oracle Application Framework Developer's Guide, Release 12.1.3



Implementing the View
Overview
This document describes how to implement an application's view components in generic terms.
It does not describe how to implement specific UI features. For this information, see individual
topics in Chapter 4: Implementing Specific UI Features.

Contents

   •   Designing the User Interface
   •   Pages
   •   Reusable Components
   •   Attribute Sets
   •   URL Parameters: Tokens, Encryption, Encoding
   •   Style Sheets
   •   Accessibility
   •   Internationalization
   •   Model Interaction
   •   Menus and Page Security

Prerequisite Reading

This document assumes that you have read the following in the OA Framework Developer
Guide:

   •   Building "Hello, World!"
   •   JSP Application Primer
   •   Anatomy of an OA Framework Page
   •   OA Framework State Management
   •   Implementing the Model

Designing the User Interface
All OA Framework applications must be designed in accordance with the Oracle Browser Look-
and-Feel (BLAF) UI Guidelines [ OTN Version ] (note that you can find information about how
to do the UI design, including instructions on using UIX as a prototyping tool, at this site).
Compliance with these guidelines yields several benefits:

   •   Users interact with a consistent, predictable, attractive interface as they navigate from
       one application to the next.
   •   If properly designed for your target audience, your applications are likely to be intuitive
       and usable since the UI guidelines themselves have been usability tested. Furthermore,
       the results of product team usability testing are considered and addressed on an
       ongoing basis.



                                                                                               169
Oracle Application Framework Developer's Guide


   •   The underlying UIX beans that the OA Framework extends implement the UI guidelines.
       If your application complies with the UI guidelines, you can typically use the OA web
       beans "out of the box" without extensive programmatic effort.

For Oracle E-Business Suite applications, any deviations from these guidelines must be
approved by the corporate UI Design and Usability team. Generally, valid deviations are driven
by unique product requirements (which often introduce designs that are eventually rolled into
the general standards to the benefit of all product teams). It is not acceptable to ignore
individual standards simply because you disagree with them.

Designing Mobile Applications

The OA Framework supports deployment of specially designed applications on wireless
platforms (initially, PDA handheld devices like a Palm Pilot). For information on designing,
building, testing and deploying mobile applications, see the Mobile Applications document in
Chapter 4. Note that you should continue reading about OA Framework development basics as
this information applies to mobile development as well.

Pages
The basic steps for creating pages, regions and items are outlined in Chapter 2: Building "Hello,
World!", and in the JDeveloper OA Extension Help. For information about implementing
feature-specific regions and items, see Chapter 4.

Coding Standards Compliance

Before creating any OA components, you should read the following documents carefully:

   •   Chapter 8: OA Framework Naming / File / Package / Directory Structure Standards
   •   Chapter 8: OA Framework View Coding Standards (this includes standards for
       components that you create declaratively)

Key Page Layout Region Properties

Whenever you create a pageLayout region , pay special attention to the following properties:

   •   AutoFooter - always set this to true so the Applications-standard privacy and
       copyright links render in your page.
   •   Help Target - if you want to display help text for this page when the user selects the
       Help global button in your page, you must specify the help target (often the name of the
       help file) to display here. See Global Buttons for additional information about this.
   •   AM Definition - this is where you specify the root application module for your page.
       Note that you must specify the fully qualified name, such as:
       oracle.apps.fnd.framework.toolbox.tutorial.server.SearchAM
   •   Function Name - always specify the securing function for the page (see the Menus
       section below for additional information).
   •   Window Title - this text value is displayed in the browser's window title.


170
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   Title - this text value renders as the page header. It's also used as the page's name if
       breadcrumbs are displayed (see Chapter 4: Breadcrumbs for detailed information about
       this feature).
   •   Form - always set this to true for a pageLayout region (this is the default setting), and
       never add additional child form beans to your page. The OA Framework supports only 1
       form per page.
   •   pageLayout Components - as mentioned in Anatomy of an OA Framework Page,
       pages include special "named" components (also called named children), one of which
       is the branding image . To associate a branding image with your page, select the
       pageLayout region or the pageLayout Components node in the Structure pane and use
       the right mouse button to select New > productBranding from the context menu.
       JDeveloper automatically creates an image item whose Image URI property should be
       set to <imageName>.gif.

Key Item Properties

Since each item type has a distinct set of properties (often including properties that are unique
to the item), it's impossible to introduce each and every relevant property. Instead, this section
introduces some of the common properties that you should understand since you will set them
frequently.

   •   Extends - For items (and regions as well), this indicates that the new item extends an
       existing item. This is discussed in more detail below.
   •   Attribute Set - A named set of properties applied to quickly configure an item. This
       is discussed in more detail below.
   •   Destination URI - For items that support navigation, this is the navigation target. For
       example:
       OA.jsp?page=/oracle/apps/fnd/framework/toolbox/tutorial/webui/PoD
       etailsPG&retainAM=Y.
   •   (Client Action) Action Type - Indicates whether the item is capable of submitting the
       form, or causing a partial page rendering (PPR) event. See Chapter 4's Dynamic User
       Interface and Declarative Submit Form for additional information about these features.
   •   CSS Class - Indicates which cascading style sheet class to apply to the item (for many
       items, UIX sets this value for you automatically to comply with the BLAF UI Guidelines).
       This is discussed in more detail below.
   •   Rendered - Indicates whether the corresponding object is included in the web bean
       hierarchy, and the HTML that UIX sends to the browser for rendering. For most items,
       this indicates whether an item displays or not, but for some items that never actually
       display (like a hidden developer field), this indicates whether the object exists on the
       page.
   •   View Instance - For items that bind to an underlying view object for reading and
       writing (if needed) data, this identifies the view object instance (within the context of a
       containing application module) to which the item binds.
   •   View Attribute - This is the view instance's attribute to which the item binds.
   •   Admin Personalization - Indicates whether the property is system administrator
       personalizable. See the OA Framework Personalization Guide for additional information
       about personalization.



                                                                                                171
Oracle Application Framework Developer's Guide


   •   User Personalization - Indicates whether the property is user personalizable. See
       the OA Framework Personalization Guide for additional information about
       personalization.
   •   Initial Value - Default value for the item (note that this can be personalized by
       customers). See the Defaulting topic below for additional information.

Simplest Possible Expression Language (SPEL)

For selected properties, the OA Framework supports the use of SPEL expressions to quickly
bind the property to an underlying data source that provides the property's value. For example,
you could bind the Rendered property of a button to a view object attribute to ascertain whether
it should be hidden or shown when the page renders. The SPEL syntax for this property looks
like:

${oa.<ViewInstanceName>.<ViewAttributeName>}

Tip: SPEL is an industry-standard expression language included in the JSP Standard Tag
Library (JSTL). If you're interested in learning more about this (although this isn't necessary for
the limited use in the OA Framework), searching for "simplest possible expression language
(SPEL)" on the web returns numerous resources.

The use of SPEL expressions is fully described in Chapter 4's Dynamic User Interface.

Reusable Components

One of the key advantages of the declarative OA Component development environment is the
ease with which you can reuse common page, region and item definitions.

See the Shared Regions section in this chapter to see how a common module with its own logic
and application module is created and used.

Shared Regions

Comply with Reuse Standards

If you want to create a shared region, you must comply with the following standards.

Note: A shared region can include one or more subregions.

   •   The top-level (shared) region must be saved in its own XML file.
   •   You can design your shared region to accept values from a using region. Values may be
       passed on the request using any of the approaches described in OA Framework State
       Management, or as a cached value on the page's transaction (also described in the
       State Management document).
   •   The shared region must be implemented to fail gracefully. For example, if appropriate
       parameters are not passed from a using region, the shared region should set acceptable
       defaults or raise a meaningful (and documented) exception.



172
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   If the region scope is set to Public (see Create a Shared Region below for additional
       information about this):
            o The top-level region must have its own application module. The application
                module should include only those view objects that are relevant for the shared
                region.
            o The top-level region must have its own controller. You may associate additional
                controllers with subregions as necessary.
   •   The shared region must be fully documented as described below.

Create a Shared Region

To create a shared region :

   1. In the JDeveloper Navigator, select the OA Project where you want to create your
      region.
   2. From the main menu, choose File > New to open the New Object Gallery.
   3. In the Categories tree, expand the Web Tier node, and select OA Components.
   4. In the Items list, select Region to open the New Region window.
   5. Enter a Name and a Package in accordance with the OA Framework File Standards, and
      specify the Style of region that you want to create (select your style carefully since you
      cannot change it once you create the region). Select OK to save create
      your <Package>.<Name>.xml OA Component document.
   6. Select the new region in the JDeveloper Structure pane and set the Documentation
      Comment property with the content described below.
   7. Set the Scope property as appropriate for your planned use of the shared region. For
      example, for a private region to be used exclusively within the current package, select
      the Current Package option (note that you can limit access to just your product if you
      wish). Alternatively, set this to Public to let anyone use it in any page.
   8. Set the other properties in your region.
   9. When it is time to package and ship your shared region, you must generate the region's
      Javadoc-like HTML documentation using the Developer Documentation Generator Tool
      in JDeveloper (see Getting Started with the OA Extension > Command Line Tools for
      the OA Extension > About the Developer Documentation Generator Tool in the Oracle
      JDeveloper online Help for additional information).

Warning: Pay strict attention to the naming standards in the OA Framework File Standards
document when naming your shared region and any of its items and subregions. Since all OA
components in a page must have a unique name, adherence to the naming standards will help
ensure that your reusable region truly can be reused.

Note: Due to naming restrictions, a single region cannot be used more than once in a page.
This restriction will be removed at some point in the future.

Documentation Comment Content

You must add the following content t in the region's Documentation Comment property:




                                                                                             173
Oracle Application Framework Developer's Guide


/**

 * Controller for: <shared page/region name including package>

 *

 * Scope: < private (for owning product team use only -- this is the
default scope),

 * public (for use by anyone) or oracle (for Oracle E-Business Suite
development use only)>

 *

 * Usage: < describe the component's purpose and use, including any
error messages that

 * might be raised>

 *

 * @param <object parameter 1> <object parameter 1 description and
acceptable values>

 * @param <object parameter 2> <object parameter 2 description and
acceptable values>

 * @param <object parameter N> <object parameter N description and
acceptable values>

 * @see <optionally include references to other objects such as other
shared children controllers, if any>

 */

Note: When describing a parameter, clearly indicate whether the parameter should be passed to
the region on the request, or on the application module transaction.

The following example illustrates appropriate content for a shared component controller:



Controller for: ford.oracle.apps.xyz.webui.FordDistributorAddressRN



Scope: Public



174
Oracle Application Framework Developer's Guide, Release 12.1.3


Usage: Implements a localized address region for distributors.



@param: distID disitributor ID which is passed on the request;
               required to initialize the region

@param: locale locale which is passed on the request; required to
               correctly localize the address

@param: submit passed on the request; if specified, this region will

commit its changes.

Extend a Reusable Region

As mentioned in Anatomy of an OA Framework page, to use a shared region in your page, you
simply extend it:

   1. In the JDeveloper Structure pane, select the region to which you want to add the shared
      region.
   2. Use your right mouse button to select New > Region from the context menu.
   3. Place your cursor in the new region's Extends field in the Property Inspector and select
      the ... button to open the component browser. Search or browse as you prefer, select the
      region you want to extend from the results list and select OK to make your choice.
   4. JDeveloper enters the fully qualified name of the shared region in the Extends field (for
      example, /oracle/apps/fnd/framework/toolbox/tutorial/webui/PoSummar
      yRN). Note that you can edit most of the properties of the base region that you created
      (you can't change its Style), but the extended region cannot be modified. In fact, its
      contents render with a gray font in the Structure pane and in the Property Inspector.
   5. Save your work.

Tip: When you add a shared region with its own application module to your page, the OA
Framework automatically nests the component application module beneath your root application
module. You don't need to create any explicit design-time relationships between these
application modules.

To clear an extension, place your cursor in the Extends field and select the Property
Inspector's Set to Default toolbar button.

Special Case: List of Values (LOV)

Although the implementation steps are described elsewhere (see the List of Values topic in
Chapter 4), it's worth noting that the LOV can be implemented as a special kind of shared region
(you can also create a single-use LOV):

   •   You create a reusable List of Values using the same procedure as you would for any
       other other shared region, although it does not require an associated controller.

                                                                                             175
Oracle Application Framework Developer's Guide


   •   When you want to use the shared LOV in a page, you do not extend it as described
       above. Instead, you set the base page field's External LOV property and configure the
       data exchange between the base page and the LOV.

Shared Pages

A page is really just a shared region whose top-level region happens to be designated as
a pageLayout component. As such, a shared page should follow all the region creation standards
and instructions described above.

   •   If you want to reuse a standalone page or page flow, simply create a new menu function
       and point it to the main page (menu functions are discussed below).
   •   If you want to insert a shared page into another page flow with a different root
       application module, you must create a new page, and then extend the shared page's
       contents below the pageLayout region. Remember to set the correct root application
       module on your new page.

Shared Items

You can also extend individual items from any region, although we recommend that you place
items that you intend to share in a reusable region. Sharing the containing region will help ensure
that someone doesn't change properties in any arbitrary item without realizing that the change
could adversely impact pages using the item.

   •   In the JDeveloper Structure pane, select the item that will extend another item.
   •   Place your cursor in the item's Extends field in the Property Inspector and select the ...
       button to open the component browser. Search or browse as you prefer, select the item
       you want to extend from the results list, and select OK to make your choice.
   •   JDeveloper enters the fully qualified name of the item in the Extends field (for
       example, /oracle/apps/fnd/framework/toolbox/tutorial/webui/PoSummar
       yRN.OrderTotal). Note that you can edit most of the extended item's properties, but
       you can't change its Item Style.
   •   Save your work.

Sharing Logistics

Oracle E-Business Suite product teams should produce internal ARUs to share reusable objects.
For teams with a large number of sharable objects that are still changing rapidly, please contact
the OA Framework team to investigate the possibility of leveraging the OA Framework daily
freeze process.

Attribute Sets
Attribute sets are named, reusable collections of properties (prompt, maximum display length,
data type and so on as appropriate for the attribute set type) that can be used by any type of OA
component, including regions, items, and other attribute sets. They are designed to facilitate the


176
Oracle Application Framework Developer's Guide, Release 12.1.3


reuse of these components throughout Oracle E-Business Suite, which yields a significant cost
savings to both Oracle and its customers:

    •    Oracle saves in translation and maintenance costs.
    •    Customers can make quick, global personalizations to their applications. Additionally,
         fewer UI elements translates to less middle-tier memory consumption, and ultimately,
         this means better performance and scalability.

In general terms, attribute sets are organized into OA component packages (individual XML
package files), where you have one package file per database table in your application:

    •    The package name matches the underlying database table name without underscores.
         For example, in the OA Framework ToolBox, we have a table
         called FWK_TBX_PO_HEADERS. The corresponding attribute set package is
         named FwkTbxPoHeaders.
    •    Individual attribute sets are created for each displayable column in the table. TL
         translation column attribute sets are included with the base table, as are the displayable
         values for lookup codes (for example, if a table includes a lookup code for freight terms,
         the package would include an attribute set for the FreightTerms displayed value).
    •    Column-based attribute sets are named for the corresponding column. For example, in
         the FWK_TBX_PO_HEADERS table we have a HEADER_ID column. The corresponding
         attribute set is named HeaderId (this is always used in the context of the fully qualified
         package name as shown below, so you don't have to worry about multiple tables having
         HeaderId attribute sets). If there are multiple attribute sets for the same column (so the
         value is commonly used in several different contexts with different prompts, for example)
         they are differentiated with prompt suffixes as illustrated for the HeaderId case in
         the FwkTbxPoHeaders example below. The most common use case for the header id
         uses the prompt "Purchase Order." The HeaderId_Order attribute set's prompt is
         "Order" and the HeaderId_Num prompt is "Number."
    •    The table attribute set package may also include attribute sets for common region
         headers and buttons, which are named for their associated labels.

Figure 1: Attribute sets in the FwkTbxPoHeaders.xml package.




                                                                                                177
Oracle Application Framework Developer's Guide




See Creating Attribute Sets for detailed instructions if you need to create or maintain your own
attribute sets.

Using Attribute Sets

Oracle E-Business Suite developers should use attribute sets in all of the following cases:

   •   All items associated with table.column data values (including any transient items that
       relate to table values). For example, both a Supplier name search field and a Supplier
       name data entry field should use the same attribute set.
   •   All common buttons (Go, Apply, Cancel and so on). This also ensures that you correctly
       inherit the standard accelerator keys for these buttons.

       Tip: The OA Framework common buttons attribute set package is
       /oracle/apps/fnd/attributesets/Buttons/<AttributeSetName>.


178
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   All common table action columns (like Delete, Update and so on) should use the
       corresponding OA Framework button attribute set.
   •   Any shared buttons in your product for which attribute sets have been created; you
       should not be creating or using attribute sets for single-use buttons
   •   Any shared header regions in your product for which attribute sets have been created;
       you should not be creating or using attribute sets for single-use headers

To use an attribute set for an item:

   •   In the JDeveloper Structure pane, select the item for which you want to specify an
       attribute set.
   •   Place your cursor in the item's Attribute Set field in the Property Inspector and
       select the ... button to open the component browser. Search or browse as you prefer,
       select the attribute set you want to extend from the results list and select OK to make
       your choice.
   •   JDeveloper enters the fully qualified name of the attribute set in the Attribute
       Set field (for example, /oracle/apps/fnd/attributesets/Buttons/Apply).

Although you can override attribute set properties when you associate them with your items, you
should avoid doing this for translated values. If you find, for example, that you need a variant of
a preexisting attribute set to display a new prompt, you should create an additional attribute set
as described in the Creating Attribute Sets document. Overriding something like a display width
is fine.

To clear an attribute set, place your cursor in the Attribute Set field and select the Property
Inspector's Set to Default toolbar button.

Programmatic Access to Attribute Sets

You can also access attribute sets in your controller . For example, the following code shows
how to obtain a translated prompt from the common Create button attribute set:



import oracle.apps.fnd.framework.webui.AttributeSet;



...



public void processRequest(OAPageContext pageContext, OAWebBean
webBean)
{

 super.processRequest(pageContext, webBean);



                                                                                                 179
Oracle Application Framework Developer's Guide


 AttributeSet attrSet =

    new AttributeSet(pageContext,
"/oracle/apps/fnd/attributesets/Buttons/Create");

 String createPrompt = (String)attrSet.getAttributeValue(pageContext,
PROMPT_ATTR);



}

URL Parameters: Tokens, Encryption, Encoding

Tokens

When you specify URL parameters in your declarative page definitions, you can specify both
literal and token-substituted values that obtain their data from associated view object attributes
at rendering time (in this case, the item must be bound to a view object). This is commonly
used, for example, in a table column to pass a primary key value to a detail page for querying.

Token Substitution Example (using the view object attribute name "OrderNum"):
OA.jsp?OAFunc=FWK_TBX_T_PO_PAGE&order={@OrderNum}

Literal Example: OA.jsp?OAFunc=FWK_TBX_T_PO_PAGE&order=123

Token Types

Tokens use a special character prefix to tell the OA Framework how to resolve the value at
runtime (note that the concepts of "encoding " and "encryption " are described below):

    •   {!Attr} - encrypts the attribute value while leaving the {!} in the URL (for
        example, OA.jsp?...&ssn={!SSN}&...).
        Using OAPageContext.getParameter("ssn") will return the decrypted value.
    •   {@Attr} - encodes the attribute value while leaving the {@} in the URL (for
        example, OA.jsp?...&addr={@EmpAdd}&...).
        Using OAPageContext.getParameter("addr") to get the parameter value will
        return the decoded value.
    •   {$Attr} - plain token substitution (no encoding or encryption) so it's your responsibility to
        ensure that a substituted value does not break the URL.
    •   {@@RETURN_TO_MENU} - Can be used exactly as shown to specify the
        Destination URI property of an application component if you want it to return the
        user to the E-Business Suite Personal Home Page. If you need to specify this when
        performing a JSP forward, the corresponding constant for this is
        OAWebBeanValues.RETURN_TO_MENU_URL.
    •   {@@RETURN_TO_PORTAL} -- Can be used exactly as shown to specify the
        Destination URI property of an application component if you want it to return the
        user to a launching Portal page. If you need to specify this when performing a JSP

180
Oracle Application Framework Developer's Guide, Release 12.1.3


       forward, the corresponding constant for this is
       OAWebBeanValues.RETURN_TO_PORTAL_URL.

Encoding

Any value that you specify for a request parameter must conform to HTTP syntax rules. For
example, you can't pass a URL parameter value with a blank space ; the following parameter
value would cause a runtime error when the corresponding URL is accessed:buyerName=John
Doe.

To fix this, we encode these values, meaning that the encoding routine replaces problematic
characters with standard substitutions as shown in this example:buyerName=John%20Doe.

   •   When the OA Framework adds parameters to the request (form field values, for
       example), it automatically encodes them.
   •   When you put parameters on the request during a call to a setForward* method, the
       OA Framework automatically encodes these values.
   •   When you put parameters on a URL that you assemble yourself (if, for example, you set
       a bean's URL by calling its setDestination method), you must encode any part of the
       String that could include invalid characters. To do this, you pass the String to an encode
       method on the oracle.apps.fnd.framework.webui.OAUrl utility class.

       Tip: If you manually set a URL parameter value that can't include invalid characters (for
       example, "value=Y") then you don't need to bother with the encoding step.

   •   When you put values on the request using OAPageContext.putParameter, you
       must encode the String if necessary.

The OA Framework automatically decodes parameter values when you call
the OAPageContext.getParameter* methods, except for the following cases:

   •   When you use the "#" character for Javascript function tokens, the OA Framework
       encodes the token values, but it does NOT automatically decode them when you
       call pageContext.getParameter("<tokenName>"). To do this yourself, you'll need
       to use the OAUrl decode method on the value that getParameter returns.
   •   When you call putParameter with an encoded value, the OA Framework does not
       decode it. You must also use the OAUrl decode method in this case on the value
       the getParameter returns.

Encryption

Encryption is the process of obfuscating data to make it illegible. Since URL request parameter
values may be visible to the user (and hidden form field values if the user opts to view the
HTML page source), you should always encrypt sensitive data if stored in a URL parameter or a
hidden field.



                                                                                              181
Oracle Application Framework Developer's Guide


In addition to the declarative, token-based encryption described above, the OA Framework also
provides methods in oracle.apps.fnd.framework.webui.OAPageContext for manually
encrypting and decrypting any parameter values that you put on the request programmatically.

Style Sheets
One of the reasons why OA Framework applications have a pleasing, uniform user interface is
the look and feel for each and every page is defined by the Oracle corporate Browser Look and
Feel (BLAF) style sheet (blaf.xss). See the BLAF UI Guideline: Text and CSS Standards [
OTN Version ] for a quick reference to the styles.

Using Styles

All of the regions -- and most of the items -- that you add to the page have their styles set
automatically; you don't need to do anything extra (nor should you). As described above, you
should be setting region and item properties ONLY if you must override the default behavior.

That said, there are several cases where you must set the CSS Class property for your items:

   •   If you create a staticStyledText item to be used for instruction text, you must set its CSS
       Class to OraInstructionText.
   •   For any text entry fields, checkboxes, poplists and radio buttons you must set the CSS
       Class to OraFieldText. Do not use OraPromptText for your radio buttons and
       checkboxes.
   •   If you create a messageStyledText item for displaying read-only data, you must set
       the CSS Class to OraDataText for the data to render in bold (note that you don't need
       to set this value for table columns)

Tip: New OA Framework developers often make the mistake of trying to significantly change
"native" component rendering by changing the CSS style. If you find yourself falling into this
trap (and you're frustrated because your style settings don't appear to have any impact on the
bean's runtime appearance):

   •   Make sure you're using the right bean (region or item style) for the job.
   •   If you're certain you're using the right bean, check to see if it publishes a method that
       lets you achieve the desired result. For example, an
       oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean inherits
       a setSize(int size) method that lets you control the size of the header text (which
       is useful when rendering headers in Home page "At a Glance" regions or in side
       navigation "Search" regions, for example). You cannot achieve this effect by trying to set
       the header's CSS Class to OraHeaderSubSub as some are tempted to try after
       reading the BLAF specification that the beans implement.

Creating Styles

Customers


182
Oracle Application Framework Developer's Guide, Release 12.1.3


The OA Framework automatically sets custom.xss to be its main style sheet. Any
customizations that you have should be added to this style sheet.

For detailed information about style sheets (including customization instructions), see Style
Sheets.

E-Business Suite Application Developers

The custom.xss style sheet mentioned above includes oa.xss, which in turn includes blaf.xss.

The oa.xss style sheet is intended to include any extensions that you have to the BLAF style
sheet (contact the OA Framework team if you have additions that have been approved by the UI
Design and Usability team). You should NOT try to create your own style sheet.

Accessibility
OA Framework applications are accessible, meaning they can be used by people with disabilities
such as blindness, low-vision, color blindness and deafness. In simple terms, accessible products
comply with the following guidelines:

   •   the product must be usable without a mouse (keyboard only)
   •   the product must be usable by a blind user (with a screen reader or Braille reader)
   •   there must be no reliance on sound
   •   there must be no reliance on color
   •   there must be no reliance on animation or timing

Note: Keyboard-only users should set their Accessibility mode to "Standard" to ensure that
the keyboard-only accessible version of user interface enhancements introduced in Oracle
E-Business Suite Release 12.1.3 are enabled. This can be done by setting the profile option
Self Service Accessibility Features/ICX_ACCESSIBILITY_FEATURES to Standard
Accessibility.

To create accessible pages:

   •   Oracle Developers must follow the Oracle Global HTML Accessibility Guidelines
       (OGHAG). The Oracle Global HTML Accessibility Guidelines checklist is a combination
       of United States Access Board Section 508 Standards and Web Content Accessibility
       Guidelines (WCAG) that Oracle has adopted to follow. To adhere to specific standards in
       those guidelines, you must comply with the accessibility guidelines described in the OA
       Framework View Coding Standards. You must also test your product for accessibility
       standards compliance before shipping it. See Testing OA Framework Applications for
       additional information.
   •   Customers may follow the Section 508 Standards and the Web Content Accessibility
       Guidelines (WCAG).




Internationalization
                                                                                                183
Oracle Application Framework Developer's Guide


OA Framework applications are designed be fully localized. For the most part, this is transparent
to you as long as you comply with all the internationalization standards outlined in Chapter 8.
Also see the Internationalization document in this chapter for detailed information about
language, time zone, date and number support in the OA Framework.

Model Interaction
Assuming you have specified the appropriate data source bindings, the OA Framework
automatically reads data from the model for display in the view, and writes user-entered data in
the view back to the model. You don't need to write a single line of code (except for any
validation you want to perform in the underlying entity objects, of course).

Reading Model Data

In simple terms, every time the OA Framework renders a page, it calls the current view object
row's get<AttributeName> method for each web bean's associated view object attribute.

Consider an example page with a "Suppliers" table, which binds to a SuppliersVO view
object. The SuppliersVO maps to an underlying SupplierEOImpl, although it also includes
one "calculated" transient attribute ("OnHoldDisplay") that does not have a corresponding entity
object attribute.

Figure 2: Illustration of how the OA Framework reads model data after a query is executed




184
Oracle Application Framework Developer's Guide, Release 12.1.3




1. The user selects the "Search" region's "Go" button to populate search results in the
   "Suppliers" table.
2. The "Search" region's controller handles the button press by invoking a search method
   in the root application module, which in turn delegates to the SuppliersVOImpl class
   so it can query itself.
3. Within the executeQuery method, the SuppliersVOImpl view object performs
   its SQL SELECT in the database.



                                                                                     185
Oracle Application Framework Developer's Guide


    4. For each row returned in our example result set, the view object instantiates
       a SupplierEOImpl entity object and sets its attribute values with the query results.

        Note: Entity object-based attribute values aren't actually stored anywhere in the view
        object. They "live" in the entity object, and are retrieved as needed by the view object.
        "Calculated" (meaning the values are simply selected from a SQL statement and have
        no relationship to an entity object) or "Transient" view object attribute values are stored
        on the SuppliersVORowImpl object. See Chapter 5: Implementing Java Entity Objects
        for additional information about the entity object cache.

    5. During page rendering (after all the query processing), the OA Framework uses the view
       object data bindings defined for each web bean to call the
       corresponding SuppliersVORowImpl
       object's getAttribute("<attributeName">) which in turns calls
       its get<AttributeName> method.
    6. The SuppliersVORowImpl get<AttributeName> method in turn calls the
       corresponding SupplierEOImpl get<AttributeName> method to retrieve the value.
       For the "calculated" OnHoldDisplay attribute, the view object row retrieves the value
       from its own cache.

Writing Model Data

Whenever the browser issues a POST request , the OA Framework automatically writes any
user-entered form values back to the underlying view objects, which in turn update any
corresponding entity objects as shown below.

Figure 3: HTTP POST Data Cycle




186
Oracle Application Framework Developer's Guide, Release 12.1.3




Note: The following steps assume that the entity object for the row has already been
successfully instantiated and initialized (such as in the create method on the underlying view
object for the page when the user originally comes into a Create page. The view object create
method calls the corresponding create method on the entity object behind the scenes).

   1. UIX performs onSubmit Javascript validation (required fields, data types, formats) and
      issues the POST request only if this validation succeeds.
   2. The browser sends a POST request and the OA Framework calls
      the processFormData methods on all the web beans in the hierarchy as described in
      Anatomy of an OA Framework Page.
   3. Within processFormData, the OA Framework automatically
      calls setAttribute(String name, Object value) on the current row of the
      underlying view object for each bean. This executes any attribute-level validation that
      you've written in the view object row.
   4. Within this setAttribute method, the view object row automatically calls the
      corresponding set<AttributeName> method in the underlying entity object. This
      executes any associated attribute-level validation in the entity object.
   5. Once all the attribute values have been set, the OA Framework calls the view
      object validate for each row it modified to execute any associated row-level validation.
   6. Finally, within the validate method, the view object row calls validateEntity for
      the underlying entity object which executes any associated entity-level validation.


                                                                                            187
Oracle Application Framework Developer's Guide


Note: The OA Framework automatically displays error messages for any exceptions thrown by
the model layer during processFormData and does not proceed to the next phase of
calling processFormRequest. See Error Handling for additional information about how the
OA Framework displays error messages.

Bypassing Validation

As described above, the OA Framework writes model data for every form submit -- which means
that all your attribute and entity level validation is executed. There are times when you need to
"short-circuit" this process so errors aren't reported to the user at an inappropriate time.

See Implementing the Controller: Model Interaction for specific instructions on preventing this.

Defaulting

When you create a new row to be used in a "Create" page as shown in Figure 3 above, you can
specify default values in three places:

   •   [ Model ] If your view object is based on one or more entity objects, you can override
       their create() method to programmatically set attribute-level defaults. See the Java
       Entity Objects Create topic for additional information.
   •   [ Model ] You can also declaratively associate defaults with entity object attributes using
       the BC4J entity object wizard. Note that Oracle's internal E-Business Suite developers
       should not use this option.
   •   [ View ] Alternatively, you can set default values for individual items by setting their
       Initial Value property in the Oracle JDeveloper 10g OA Extension. The advantage
       of this approach -- for static values that can be determined at design time -- is customers
       can easily personalize these defaults. This feature can be used with items that do, and
       do not, map to an underlying view object. For example, you could use this for a search
       criteria field even though it does not have an associated view object instance.

Defaulting is turned off. You must set the value of the profile option FND:OA:Enable
Defaults/FND_OA_ENABLE_DEFAULTS to Y to turn on defaulting.

If the profile is enabled and a default value is specified in the view (whether in the OA Extension
or as personalization) on a form element that is not a messageChoice or
messageRadioGroup, then OA Framework sets the value of the item according to the following
rules:

   •   If the item has no associated view object data source, the profile option will have no
       effect and OA Framework automatically sets the default value directly on the item when
       the page is rendered.

       Note: If you are trying to set the "Initial Value" of a form bean with Data Type as "Date",
       then use the canonical format yyyy/MM/dd. Otherwise the default value will not apply.


   •   If the item has an associated view object, OA Framework sets the default value when
       you call createRow() on your view object.

188
Oracle Application Framework Developer's Guide, Release 12.1.3


If the profile is enabled and a default value is specified in the view (whether in the OA Extension
or as personalization) on a form element that is a messageChoice or messageRadioGroup,
then OA Framework sets the value according to the following rules:

   •   If the value from the current row for the view attribute is not null, the default value
       specified is set as the default value of the selection.
   •   If the value from the current row for the view attribute is null, the default value shown in
       the selection will be determined by the default value specified and will be applied to the
       view object.
   •   Note: If the profile option is not enabled, and the value from the current row for the view
       attribute is null, the default value shown in the selection will also be determined by the
       default value specified and will not be applied to the view object.

The following example shows typical code for creating a new row:



       public void createSupplier()

       {

           OAViewObject vo = getSuppliersVO();



         // The OA Framework applies UI defaults during the scope
       of this

           // method call.

           Row row = vo.createRow();

           vo.insertRow();



           // As specified in OA Framework Model Coding Standards,
           // always set the new row state to STATUS_INITIALIZED

           // after you create it.
           row.setNewRowState(Row.STATUS_INITIALIZED);

       }

       Specifically, the createRow() method calls create() on each ViewRowImpl.
       In the scope of the create() call, the OA Framework calls the attribute setter
       for each UI-specified default it needs to apply. This ensures that any view row
       attribute validation -- and associated entity object attribute validation -- is
       executed as described in Figure 3 above. The OA Framework then resets the

                                                                                                189
Oracle Application Framework Developer's Guide


          state of your view row to STATUS_INITIALIZED so it appears untouched to
          BC4J. This ensures that users can navigate to and leave pages having only
          default values without being warned about the potential loss of work. Any
          validation exceptions detected during the defaulting process are displayed as
          normal.

          Tip: Defaults are applied once and only once when the row is created. If you
          have a multipage flow with regions that bind to the same underlying view object --
          and each region specifies a different Initial Value for one of the view
          attributes -- only the default associated with the first region that renders when the
          row is created is applied. The others are ignored. Similarly, if you create a new
          row on Page A, and then navigate to Page B where you have an Initial
          Value set for one of its attributes, the default isn't applied because the row was
          created before Page B renders (note that creating a row before navigating to the
          page where the user actually enters values for the new row is not consistent with
          the recommended Back button implementation for a Create flow).

Assuming defaults are using each of these three approaches, the OA Framework observes the
following precedence priority:

    1. (Highest) Declarative item property defaults as specified in the OA Extension or in the
       Personalizations module
    2. Programmatic entity object attribute defaults (these are applied during the scope of the
       vo.createRow() method call which in turn delegates to your entity object's create()
       method)
    3. (Lowest) Declarative entity object attribute defaults

If you want to ensure that a default value is always set regardless of what values might be
specified declaratively, you can override the insertRow() method in your view object row as
shown below:



public void EmployeesVOImpl extends OAViewObjectImpl

{



    ...



    public void insertRow(Row row)

    {

        // Always call super.insertRow() first.


190
Oracle Application Framework Developer's Guide, Release 12.1.3


        super.insertRow();




        // Now call whatever attribute setters you need to call to ensure

        // that your defaults always take precedence.

        row.setAttribute("<attributeName>", <attributeValue>);

        ...



    }
}

Menus and Page Security
In an OA Framework application, the menu of available pages is presented to the user in a tab-
based model as illustrated in the following example from the OA Framework ToolBox Tutorial
Application:

Figure 4: OA Framework ToolBox Tutorial Application menus.




Within this basic model, you are free to choose from a range of valid design options based on
your application's complexity and expected usage patterns (when you're ready to start designing
menus for your application, consult the Oracle Browser Look-and-Feel (BLAF) UI Guideline:
Tabs/Navigation [ OTN Version ] first for a detailed introduction to the various menu
configurations).

This menu structure serves two distinct purposes in an OA Framework application:

    •    It organizes content into meaningful units.
    •    It lets users navigate easily between these meaningful units.

Menu Implementation


                                                                                               191
Oracle Application Framework Developer's Guide


Behind the scenes, an OA Framework menu is actually comprised of Oracle E-Business Suite
functions and menus.

Navigation Functions

Navigation functions represent the individual pages within your application; each page that a
user accesses at runtime is associated with a predefined function, which is used solely for the
purpose of navigating through your application. Perhaps most importantly, this function includes
the Web HTML Call for the page. For example, in the ToolBox Tutorial Application, when the
user selects the Lesson 3 menu entry, the Purchase Order Search page is displayed. We created
a function for this page, and set its Web HTML Call to point to the XML page we want to
display :
OA.jsp?page=/oracle/apps/fnd/framework/toolbox/webui/PoSearchPG
When the user selects the Lesson 3 menu entry, the request is routed to the OA.jsp which
initializes an oracle.apps.fnd.framework.webui.OAPageBean object to process the
corresponding page XML file as described in Anatomy of an OA Framework page (in case
you're wondering, OA.jsp is the only JSP that is invoked when accessing any OA Framework
application page).

Note: A single page can be called by many functions (each potentially passing different
parameters through the URL), which means it can be used in many different menus.

Navigation Menus

Navigation menus are reusable groupings of functions and submenus that ultimately create the
tab structure that we described above. Each OA Framework menu that you create has an
associated Type that determines how it should be rendered. For example, the Lesson 2 tab in
Figure 1 above is of type "HTML Tab."

Navigation menus include all functions that can display in your application. You can also
selectively grant access to individual functions within this navigation menu. This is described
more fully below in the Application Security section.

For detailed instructions on designing and creating OA Framework navigation menus, see
Chapter 4: Tabs/Navigation.

Application Security

The features of Application security are broad; in this introductory chapter we'll touch on some
key concepts so you have a general idea of what is supported as it relates to menu definitions.
When you're ready to start designing your application, we recommend familiarizing yourself
with these features by reviewing Page Security in Chapter 4.

Users and Responsibilities

An Oracle E-Business Suite reponsibility is a collection of tasks that is granted to one or more
users as a set. For example, you might create a Benefits Manager and a generic Employee

192
Oracle Application Framework Developer's Guide, Release 12.1.3


responsibility, each with the appropriate HR-related applications. You would then assign these
responsibilities to individual users to quickly grant access to these modules.

All responsibilities are associated with the single top-level navigation menu for your application.
As described above, the navigation menu ultimately includes all the tabs supported by your
application.

Previously, a responsibility was the primary mechanism for grouping users into role-based sets.
You would then assign menus to responsibilities, and create security rules by excluding
individual menu functions from your responsibility. At runtime, the current responsibility,
organization and security group together comprised the security context.

With Release 12, the concept of responsibility has been expanded to a more generic role.
Users can belong to one or more roles. All users assigned to a particular responsibility are also
assigned to a correponding role. Security rules are based on permission grants instead of
function exclusion rules. At runtime, these grants are evaluated for the current security context,
which now includes roles (also known as a "grantee") in addition to responsibility, organization
and security group.

The OA Framework recommends using permissions roles and grants for your security setup
instead of responsibilities and exclusion rules.

Grants and Permissions

In addition to creating Navigation Functions, you must also create Authorization Functions
(known as "permissions") for each of your pages. You then group these permissions into a "flat"
menu structure (known as a "permission set") for the purpose of granting user access to the
associated pages.

The simplest way to introduce the use of permission sets is by walking through a small use
case. For example, assume you have a very simple Benefits application including the following
four pages:

Page             Description                                            Benefits     Employee
                                                                        Manager      Access?
                                                                        Access?
Administer       View, update, approve and discontinue benefits.        Yes          No
Benefits
Create Benefit   Create a new benefit.                                  Yes          No
My Benefits      View current benefit selections and make new           Yes          Yes
                 selections as appropriate.
Update           Update designated beneficiaries.                       Yes          Yes
Beneficiaries

As described above, you would create Navigation Functions for each of these pages and
organize them into a comprehensive Navigation menu. To ensure that users have access to the
right pages, you would then proceed as follows:


                                                                                                193
Oracle Application Framework Developer's Guide


Step 1 : Create permissions.

Just like the Navigation functions, permissions are FND form functions, but in this context, they
are used exclusively for application security.

In our example, we can use the Navigation Functions that we created for each page as
permissions. There is no need to create additional permission functions.

Step 2 : Create roles or grantees.

A grantee can either be a user (FND_USER), or a user group(also known as role), or
"global". User identities are created in FND_USERS, and should map one-to-one with
individual humans or systems. Users can belong to groups or roles that are formed by
grouping organizational or position relationships modeled in products such as Human
Resources. Roles are defined in WF_ROLES, and in future can map to user groups in a
customer's LDAP system. Although its membership is not explicitly populated, there is a Global
group which includes "everyone".

You need two user roles for the example above: one that groups all managers into a manager
role, and another that groups all employees. Since all employees includes everyone, you can
use a Global role for this purpose.

Alternately, you can create a responsibility that is assigned to all managers, and use that for
your grants setup.

We will discuss both the above alternatives when we proceed to Step 4 to create the grants.

Step 3: Create permission sets.

Permission Sets are implemented as menus, but they are exist solely to group a flat list of
permissions into sets for easy access granting. Ideally, you should group permissions that are
required by a role into one or more permission sets.

You need two permission sets for the example above:

   •   A Manager Permission Set for all the tasks to which only managers should have access.
       This includes the navigation functions "Administer Benefits", and "Create Benefit".
   •   A Global permission set with permissions that are accessible by everyone. This includes
       the navigation functions "My Benefits" and "Update Beneficiaries".

Step 4: Create Grants

A Grant defines security rules that allows only certain users of your system access to specific
functions or pages within your application. A grant gives a grantee access to the permission
sets described above. In simple terms, grants link your grantees to your permission sets.

You need two grants for the example above:

   •   A Manager Grant to associate the manager permission set with the manager role.

194
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   An Employee Grant that is associated with your Global permission set with a global
       grantee.
   •   Since this grant is associated with a global grantee (in other words, everyone) and has
       no additional security restrictions (in other words it is not restricted to any responsibility,
       organization or security group), it can also be called a global grant.

In addition to specifying a grantee, you could also restict your grant further with additional
security context. This includes the current user's responsibility, organization and security group.
So, for example, to restrict the manager grant to a specific organization, you can associate an
organization context with the grant.

Instead of granting the manager permission set to the manager role, you can grant it to a global
grantee. You can then restrict it to managers alone by associating a security context with the
responsibility to which only managers have access. However note that the OA Framework
recommends the use of role based grants instead of responsibilities.

At runtime, a user is granted access to a page if the permission associated with the page is
granted access to the current user's security context. The user's security context as described
above includes the user's role, responsibility, organization and security group.

Page Security

If you look at the example above, we mention that you can link the permissions with your pages
to restrict access. This is one of the cases where you need to secure the rendering of your page
with a permission.

Other cases where you may want to secure the rendering of your page with a permission
include anonymous login pages, pages that require auto responsibility setting or switching, and
shared/reusable pages.

For detailed instructions please look at Chapter 4: Page Security.




                                                                                                   195
Oracle Application Framework Developer's Guide



Implementing the Controller
Overview
This document describes how to implement an OA Controller in generic terms. It does not
describe how to implement specific UI features. For this information, see individual topics in
Chapter 4: Implementing Specific UI Features.

Contents

   •   Designing an OA Controller
   •   Creating an OA Controller
   •   Handling an HTTP GET
           o Modifying Bean Properties
           o Creating Beans Programmatically
   •   Handling an HTTP POST (Form Submit)
   •   Model Interaction
   •   Disabling Validation
   •   Error Handling
   •   Javascript

Prerequisite Reading

This document assumes that you have read the following in the OA Framework Developer
Guide:

   •   Building "Hello, World!"
   •   JSP Application Primer
   •   Anatomy of an OA Framework Page
   •   OA Framework State Management
   •   Implementing the Model
   •   Implementing the View

Designing an OA Controller
As described in Anatomy of an OA Framework Page, the OA Controller is where you define how
web beans behave. Specifically, you write controller code to:

   •   Manipulate/initialize the UI at runtime (including any programmatic layout that you are
       unable to do declaratively)
   •   Intercept and handle user events like a button press

Controllers should never include any kind of business logic; this belongs in your model classes.

Necessity



196
Oracle Application Framework Developer's Guide, Release 12.1.3


In general, before tackling the question of how to design your controller, it's important to
consider whether you even need to create a controller.

As a rule, you should write controller code only if it is absolutely essential. If you can create your
page declaratively, do not instantiate regions and items programmatically. Programmatically
created web beans cannot be personalized, reused or extended. Furthermore, some hard-
coded layouts may fall out of compliance with the Oracle Browser Look-and-Feel (BLAF) UI
Guidelines [ OTN Version ] as they evolve over time.

As described in Implementing the View, all top-level regions in a shared component must have
an associated controller.

Granularity

OA controllers can be associated with any region (any web bean that implements
oracle.apps.fnd.framework.webui.beans.OAWebBeanContainer); you cannot
associate controllers with items.

Many new OA Framework developers wonder just "how big" a controller should be. Should you
have one per page, one per meaningful region (like a "Search" region), one per complex web
bean (like a table) -- or what? Unfortunately, the answer is it depends.

First and foremost, in a really simple page, you might not have any controllers (there is no
requirement that you create controllers if they have no work to do). If you do need to write code,
you should weigh the following carefully before deciding what controllers to create:

   •   the benefits of encapsulation -- ideally, a web bean implements its own behavior
   •   component reuse -- if a component is designed to be shared, it must be self-sufficient
   •   practical code usability -- although a page comprised of eight regions could easily have
       eight corresponding controllers (each with a few, trivial lines of code), this "pure" object
       oriented approach can make code maintenance more difficult, and it can cause
       unnecessary file bloat in your product

With that in mind, there are a few guidelines that might help the decision-making process:

   •   Never set properties on a parent/grandparent web bean from a child bean.
   •   Always define controllers so they control the regions with which they're associated, or
       set properties on children/grandchildren of this region. If you want a controller to manage
       multiple child/grandchild web beans, it should be associated with an appropriate
       parent/grandparent bean.
   •   For the really complex beans (like an OATableBean) you should associate a controller
       with the bean itself, or perhaps with a simple containing bean if it represents a logical
       unit of functionality.

In general, you should create the fewest number of controllers per page that satisfies the rules
and considerations outlined above. For a very simple page, it is very common to associate a
single controller with the pageLayout region. For a more complicated page, you might create a
few different controllers for meaningful functional components (for example, a searchable



                                                                                                  197
Oracle Application Framework Developer's Guide


summary page typically has a "Search" region controller and a "Results" region controller).
Shared regions should obviously have their own controller(s) as appropriate.

Modularity/Reuse

Within any group of related pages, you will typically find opportunities to reuse code. The
following are all valid approaches to creating more modular controller code:

   •   You can add your own private methods to your controllers.
   •   You can create a common controller that subclasses
       oracle.apps.fnd.framework.webui.OAControllerImpl, and then subclass this
       as needed for individual pages/regions.
   •   You can create helper utility classes to which your controller code can delegate as
       needed. These classes are not required to subclass/implement any OA Framework
       classes/interfaces, and should be included in the same package(s) as the controller(s)
       they help. Note that static methods are a natural fit in these (often procedural) classes,
       and while it is appropriate to include static methods, you should consider the following:
           o You (and more importantly, the customer) can't effectively subclass static
              methods.
           o There are packaging implications related to the use of constants and static
              methods (see the Oracle E-Business Suite Java Coding Standards).

Thread-Safety

The OA Framework is designed to support multithreaded web bean access (although this is not
yet implemented). Most of this is transparent to you, however, there are a few rules that you
must follow in your controller code:

   •   If you use static methods in your controllers or helper classes, never include state.
   •   Always pass the page's OAPageContext to any web bean accessors (if there is a
       signature that takes an OAPageContext). For example, choose
       setText(OAPageContext pageContext, String text) instead of
       setText(String text).

State Management

Never add non-transient member variables to your controllers, or to helper classes if you
instantiate them. The OA Framework does not passivate controller member variables, and will
therefore be unable to recover these values once JVM failover is supported. You may add
static final member variables.

Coding Standards Compliance

Before writing any controller code, you should read the following documents carefully. While this
topic mentions several key controller standards, it is not intended to be a comprehensive
checklist. For any OA Framework code that you write, the documents in Chapter 8 should be
considered the "single source of truth" for coding standards.



198
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   Chapter 8: Oracle E-Business Suite Java Coding Standards
   •   Chapter 8: OA Framework File Standards (Naming, Package Structure and Standard
       Content)
   •   Chapter 8: OA Framework Controller Coding Standards

Creating an OA Controller
To create a controller for a region:

   1. Select the region in the JDeveloper Structure pane
   2. Use the right mouse button to select Set New Controller...
   3. In the New Controller dialog, enter the package and class names in accordance with the
      OA Framework File Standards. Select OK to create the controller and associate it with
      the selected region. Note that the Controller Class value in the property inspector is a
      fully qualified class name:
      oracle.apps.fnd.framework.toolbox.tutorial.webui.HomeSearchCO.

JDeveloper creates a template controller for you with the following content.



/*====================================================================
=======+

 | Copyright (c) 2001, 2003 Oracle Corporation, Redwood Shores, CA,
USA      |

 | All rights reserved.
|


+=====================================================================
======+

 | HISTORY
|


+=====================================================================
======*/

package oracle.apps.fnd.framework.toolbox.tutorial.webui;



import oracle.apps.fnd.common.VersionInfo;

import oracle.apps.fnd.framework.webui.OAControllerImpl;


                                                                                          199
Oracle Application Framework Developer's Guide


import oracle.apps.fnd.framework.webui.OAPageContext;

import oracle.apps.fnd.framework.webui.beans.OAWebBean;



/**

    * Controller for ...

    */

public class OrderSummaryCO extends OAControllerImpl

{

      public static final String RCS_ID="$Header$";

      public static final boolean RCS_ID_RECORDED =

      VersionInfo.recordClassVersion(RCS_ID, "%packagename%");



 /**

      * Layout and page setup logic for a region.

      * @param pageContext the current OA page context

      * @param webBean the web bean corresponding to the region

      */

   public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

      {

          super.processRequest(pageContext, webBean);

      }



 /**

      * Procedure to handle form submissions for form elements in


200
Oracle Application Framework Developer's Guide, Release 12.1.3


    * a region.

    * @param pageContext the current OA page context

    * @param webBean the web bean corresponding to the region

    */

   public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)

    {

        super.processFormRequest(pageContext, webBean);

    }



}

Note: The default template does not include the processFormData(OAPageContext
pageContext, OAWebBean webBean) method that is called during the first phase of POST
processing. If you find that you need to use this method (a fairly uncommon scenario), you can
simply add it to your controller.

To copy a controller:

    1. In JDeveloper, open the controller that you want to copy.
    2. Select File > Save As... from the main menu.
    3. In the Save As dialog, be sure to specify the right Location (Java package) and enter the
       File name (class name).
    4. In the new controller file, remember to edit the package declaration (if necessary) and
       change the class name.

To associate a preexisting controller with a region:

    1. Select the region in the JDeveloper Structure pane.
    2. Place your cursor in the Property Inspector's Controller Class field and select the ...
       button.
    3. In the Controller Class dialog, expand the package hierarchies until you find the
       controller that you want to select. Select OK to make your choice.

To disassociate a controller from a region:

    1. Select the region in the JDeveloper Structure pane.
    2. Place your cursor in the Property Inspector's Controller Class field.
    3. Select the Set to Default button in the Property Inspector's Toolbar (it is not sufficient to
       manually clear the value from the field) as shown in Figure 1 below.

                                                                                                 201
Oracle Application Framework Developer's Guide


Figure 1: Highlighted Set to Default button in the OA Extension Property Inspector toolbar




Note: You can also associate controllers with regions programmatically. See the
setControllerClass(String javaClass) method in OAWebBeanContainer.

Handling an HTTP GET
During GET processing, each controller's processRequest(OAPageContext
pageContext, OAWebBean webBean) method is called as the web bean hierarchy is
instantiated. Processing begins with the pageLayout bean, and proceeds recursively throughout
the entire hierarchy. Code that initializes your page -- or affects the web bean hierarchy in any
way (by setting properties, creating web beans and so on) -- belongs in the
processRequest() method.

Note: The oracle.apps.fnd.framework.webui.OAWebBean parameter passed to the
processRequest() method is the region with which the controller is associated.

The following example is typical of the processRequest() code that you will write. It
illustrates the initialization of a view-only "detail" page based on a request parameter (for a
selected purchase order) passed from a "search" page.



/**
 * Layout and page setup logic for region.
 * @param pageContext the current OA page context
 * @param webBean the web bean corresponding to the region
 */
public void processRequest(OAPageContext pageContext, OAWebBean
webBean)
{

      // Always call this before adding your own code.
      super.processRequest(pageContext, webBean);

202
Oracle Application Framework Developer's Guide, Release 12.1.3




   // Get the purchase order number from the request.
   String orderNumber = pageContext.getParameter("headerId");



   // We need to set the page header text to include the PO order
number for reference.
   MessageToken[] tokens = { new MessageToken("PO_NUMBER",
orderNumber) };



   // Always use a translated value from Message Dictionary when
setting strings in

   // your controllers.
   String pageHeaderText = pageContext.getMessage("ICX",
"FWK_TBX_T_PO_HEADER_TEXT", tokens);



   // Set the po-specific page title (which also appears in the
breadcrumbs. Since this

   // controller is associated with the page layout region, simply
cast the webBean

   // parameter to the right type and set the title.



   ((OAPageLayoutBean)webBean).setTitle(pageHeaderText);



   // Now we want to initialize the query for our single purchase
order with all of its

   // details.
   OAApplicationModule am = pageContext.getApplicationModule(webBean);

   Serializable[] parameters = { orderNumber };

   am.invokeMethod("initDetails", parameters);




                                                                                203
Oracle Application Framework Developer's Guide


} // end processRequest()

After calling super.processRequest(pageContext, webBean), the example code gets
the value for a request parameter named "headerId" (the purchase order number the search
page passed on the request). This value is then displayed in the page title and breadcrumbs as
context for the user, and passed to the model so the purchase order can be queried.

Figure 2: Example of a dynamically defined page title and breadcrumbs using the page title's value




Since all values displayed in the page must be translatable, we created a message named
FWK_TBX_T_PO_HEADER_TEXT in the Oracle E-Business Suite Message Dictionary with the
text "Purchase Order: &PO_NUMBER". The code defines the purchase order number as the
replacement value for the token PO_NUMBER, and then obtains a translated version of this
message from the oracle.apps.fnd.framework.webui.OAPageContext (which
delegates to AOL/J). It then sets the translated String as the page's title.

Warning: Never display a hard-coded text value in the user interface. All text values that you
display programmatically must be sourced from Message Dictionary as shown. You can also
use a value from a web bean that was set declaratively (all displayable bean properties are
translated), or you can display a value queried from a multilanguage product table.

Finally, this read-only "details" page automatically queries the given purchase order whenever it
is rendered. It does this by passing the purchase order number to a method called
initDetails() in the page's root application module. The application module then passes
this parameter to the appropriate view object, which binds the WHERE clause parameter and
executes its query. The Model Interaction section below describes this in greater detail.

Modifying Bean Properties

Note: As a rule, it is preferable to modify web bean properties using partial page rendering
(PPR) and SPEL bindings as described in Dynamic User Interface. The instructions in this
section assume you cannot leverage PPR and SPEL for your requirement, and therefore must
make changes to the web bean hierarchy in processRequest() (this section is included in
the GET handling because you are allowed to modify the web bean hierarchy ONLY in your
processRequest() method).

If you need to programmatically modify the hierarchy in response to a form submit event (for
example, the user presses a button), you must forward back to the same page so your
processRequest() code can be executed (see the example in the POST event handling
section below). Reasons for this restriction (which you should not try to "work around") include:

    •    Ensures that the web bean hierarchy can be correctly recreated if necessary.

204
Oracle Application Framework Developer's Guide, Release 12.1.3


    •   Beans are initialized properly. This is primarily an issue with the Rendered property, or
        complex components affected by the prepareForRendering() method.
    •   Bean hierarchy maintanence is encapsulated in a single method.

To modify a web bean's properties, you simply need to find the correct bean in the hierarchy
using its name (the ID you assigned in JDeveloper), and call the appropriate method as shown
in the following example.

Warning: When you get a handle to a web bean, always check whether the value is null before
calling any of its methods. Even if you expect the bean to be included in the web bean
hierarchy, it's possible that a customer may hide it with a personalization.



processRequest(OAPageContext pageContext, OAWebBean webBean)

{

    // Always call this before adding your own code.
    super.processRequest(pageContext, webBean);



  OATableBean table =
(OATableBean)webBean.findIndexedChildRecursive("OrdersTable");



    if (table == null)

    {

     MessageToken[] tokens = { new MessageToken("OBJECT_NAME",
"OrdersTable")};

        throw new OAException("ICX", "FWK_TBX_OBJECT_NOT_FOUND", tokens);

    }



    // Set the purchase-order specific "control bar" select text:

    // "Select Purchase Order(s) and..."



  String selectPOText = pageContext.getMessage("ICX",
"FWK_TBX_T_SELECT_PO", null);

                                                                                              205
Oracle Application Framework Developer's Guide


    table.setTableSelectionText(selectPOText);



}

Starting with the controller region's children, the findIndexedChildRecursive(String
name)method searches the entire web bean hierarchy looking for the first indexed child with a
matching name. If the web bean that you want to modify is a UIX named child (or, if you're not
sure whether it is "named" or "indexed"), use the findChildRecursive(String name)
method instead.

If you need to modify properties on the controller region, simply cast the processRequest()
OAWebBean parameter to the right type and call whatever method you need (see the GET code
example above for an illustration of this).

Creating Beans Programmatically

Note: This section is included in the GET handling because you are allowed to modify the web
bean hierarchy ONLY in your processRequest() method.

If you need to add beans to the web bean hierarchy in response to a form submit event (for
example, the user presses a submit button), you must forward back to the same page so your
processRequest() code can be executed. See the example in the POST event handling
section below.

As a rule, you should NOT create web beans programmatically if you can create them
declaratively for all the reasons described above. Furthermore, if your page leverages partial
page rendering, your web bean hierarchy cannot be changed at runtime.

For those rare cases when you must instantiate a web bean yourself, use the
createWebBean() factory methods in the OAControllerImpl class. Do not use any of the
web bean constructors directly, and do not worry about creating an
oracle.apps.fnd.framework.webui.OAWebBeanFactory directly since the controller
createWebBean() methods delegate to the OAWebBeanFactory behind the scenes.

Note: For beans created "from scratch" (meaning there is no declarative definition for the bean),
use the factory method that allows you to specify the bean's "name" (the ID property in
JDeveloper). Avoid the deprecated methods that allow you to create a web bean without
specifying its name. The web bean's name uniquely identifies it on a page (each name must be
unique within a page), and it is essential for a variety of reasons described in the OA Framework
Controller Coding Standards. Furthermore, a bean's name may be used by the OA Framework
in a BC4J object instance name (such as an application module instance), and therefore should
not include invalid characters for Java names.

For example, the following code illustrates how to create two web beans from scratch and add
them to a parent region.


206
Oracle Application Framework Developer's Guide, Release 12.1.3




OATableLayoutBean tableLayout =
(OATableLayoutBean)findIndexedChildRecursive("tableLayout");



// Create a row layout and give it the unique ID "topRow"

OARowLayoutBean row = (OARowLayoutBean)createWebBean(pageContext,


OAWebBeanConstants.ROW_LAYOUT_BEAN,

                                                                null, // no need
to specify a data type

                                                                "topRow");



// Create a row layout and give it the unique ID "bottomRow"

OARowLayoutBean anotherRow =
(OARowLayoutBean)createWebBean(pageContext,


OAWebBeanConstants.ROW_LAYOUT_BEAN,

                                                                         null, //
no need to specify a data type


"bottomRow");



// Always check to see if a web bean exists.

if (tableLayout != null)

{



   // Add the two row layout beans to the table so the "topRow"
renders above

    // the "bottomRow"

                                                                                    207
Oracle Application Framework Developer's Guide


      tableLayout.addIndexedChild(row);

      tableLayout.addIndexedChild(anotherRow);

}

You can also instantiate web beans that have been defined declaratively, but require a
programmatic association with the parent. For example, in the following code, a stackLayout
region named "HomeSearchRN" was defined in JDeveloper, but it must be added to the
programmatically created side navigation component.



OASideNavBean sideNav = (OASideNavBean)createWebBean(pageContext,


OAWebBeanConstants.SIDE_NAV_BEAN,

                                                                      null, // no need
to specify a data type

                                                                      "sideNav" //
always specify name);


OAStackLayoutBean search =

      (OAStackLayoutBean)createWebBean(pageContext,


"/oracle/apps/fnd/framework/toolbox/tutorial/webui/HomeSearchRN",

                                               "HomeSearchRN", // always specify
name

                                                 true); // region created in
Oracle JDeveloper OA Extension



sideNav.addIndexedChild(search);

Restrictions

The OA Framework does not readily support the programmatic addition, removal or
replacement of children to any of the "default" regions (for example, an OA Extension
defaultSingleColumn region which is instantiated as an
oracle.apps.fnd.framework.webui.beans.layout.OADefaultSingleColumnBean)


208
Oracle Application Framework Developer's Guide, Release 12.1.3


. These regions should be defined declaratively. If you absolutely must replace or remove items
in a "default" region (you cannot add items), follow these steps:

   1. Find the child web bean that you want to remove or replace by calling
      webBean.findIndexedChildRecursive().
   2. Get the child's parent web bean by calling
      childWebBean.getAttribute(OAWebBeanConstants.PARENT).

       Note: The OAWebBeanConstants.PARENT attribute is intended exclusively for OA
       Framework internal development use (if you look at the OAWebBeanConstants
       Javadoc, you'll see a warning to this effect). You may leverage this approach only for
       default regions due to their unique implementation; as a rule, the OA Framework
       Controller Coding Standards discourage modifying parent web beans from child
       controllers. Furthermore, the default regions have been deprecated so you should not be
       using them for new development.

   3. Then, perform the replace or remove on the parent bean itself.

Handling an HTTP POST (Form Submit)
During HTTP POST processing, the OA Framework first checks to see if the page's web bean
hierarchy is available in its cache. If not, because resources are constrained or the user
navigates with the browser Back button, the OA Framework must recreate the web bean
hierarchy before proceeding. This means that all of your processRequest() code is re-
executed as if the browser had issued an HTTP GET request.

Note: The potential recreation of the web bean hierarchy yields a number of coding
considerations which are fully described in Chapter 6: Supporting the Browser Back Button and
the corresponding OA Framework View and Controller coding standards.

The primary POST processing occurs in two separate passes over the web bean hierarchy:

   •   First, OA Framework writes form data to the model by calling processFormData() on
       each web bean recursively until the entire hierarchy is traversed. Any code that needs to
       be executed during this processing phase should be added in your controller's
       processFormData(OAPageContext pageContext, OAWebBean webBean)
       method.
   •   Assuming no exceptions were thrown during the first processing phase, OA Framework
       proceeds to the second phase which involves calling
       processFormRequest(OAPageContext pageContext, OAWebBean
       webBean)on each web bean.

processFormData( )

In most -- if not all -- of the pages that you build, you will have no cause to overwrite this
method. In fact, the only use case we could think of is extremely unlikely in an OA Framework
application: if the data source for a region is not a view object, so the view instance and attribute


                                                                                                 209
Oracle Application Framework Developer's Guide


properties are not defined for the individual web beans, then you could code the region's
processFormData() to write the child web bean data to the appropriate data source.

Note: The OA Framework implements processFormData() at the item level, but you can
overwrite it only at the region level, so you must process all of the region's items if you ever
implement anything like this. If you do choose to implement something like this, remember to
call super.processFormData(OAPageContext pageContext, OAWebBean webBean)
first.

processFormRequest( )

Any code that handles user form submit actions belongs in the processFormRequest()
method.

The following example is typical of the processFormRequest() code that you will write. It
illustrates how to determine that a particular form submit component was selected (in this case,
a "Go" button), how to initiate a query in the model code, and how to perform a JSP Forward
back to the same page so web bean properties can be changed in the processRequest()
method.



public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)

{

      // Always call this before adding your code

      super.processFormRequest(pageContext, webBean);



      // Pressing the Go button causes the search to be executed.
      If (pageContext.getParameter("Go") != null)

      {

          String orderNumber = pageContext.getParameter("SearchOrder");

          String created = pageContext.getParameter("Created");

          String showMyOrders = pageContext.getParameter("MyOrders");



     OAApplicationModule am =
pageContext.getApplicationModule(webBean);


210
Oracle Application Framework Developer's Guide, Release 12.1.3




     // All parameters passed using invokeMethod() must be
serializable.



       Serializable[] parameters = { orderNumber, created, showMyOrders
};

       am.invokeMethod("search", parameters);



       // Now forward back to this page so we can implement UI changes
as a

     // consequence of the query in processRequest(). NEVER make UI
changes in

       // processFormRequest().



       pageContext.setForwardURLToCurrentPage(null, // no parameters to
pass

                                                            true, // retain the AM


OAWebBeanConstants.ADD_BREAD_CRUMB_NO,


OAWebBeanConstants.IGNORE_MESSAGES);

  }

} // end processFormRequest();



This example shows how to pass request parameters using the setForwardUrl() method,
including how to replace a pre-existing parameter value (in this case, with "X" which would be
used as an "ignore" value in the target page).



import com.sun.java.util.collections.HashMap;


                                                                                             211
Oracle Application Framework Developer's Guide


import oracle.bali.share.util.IntegerUtils;

...



processFormRequest(OAPageContext pageContext, OAWebBean webBean)

{

      // Always call this before adding your code

      super.processFormRequest(pageContext, webBean);



      String poEvent = pageContext.getParameter("poEvent");



      HashMap params = new HashMap(2);



      // Replace the current poEvent request parameter value with "X"

      params.put("poEvent", "X");



      // IntegerUtils is a handy utility

      params.put("poStep", IntegerUtils.getInteger(5));




pageContext.setForwardURL("OA.jsp?page=/oracle/apps/dem/employee/webui
/EmpDetailsPG", // target page

                                    null, // not necessary with
KEEP_MENU_CONTEXT

                                    OAWebBeanConstants.KEEP_MENU_CONTEXT, //
no change to menu context

                                    null, // No need to specify since we're
keeping menu context


212
Oracle Application Framework Developer's Guide, Release 12.1.3


                                        params, // request parameters

                                        true, // retain the root application
module

                                        OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
// display breadcrumbs

                                        OAException.ERROR); // do not forward w/
errors

}

Note: If a view object is used as a data source for a web bean that is to be displayed, do
not remove the view object, its rows, or the containing nested application module. If you
want to remove any of these objects before redirecting to a page that will no longer show
the view object data (for performance optimization reasons), then after making the
remove calls, be sure to redirect to the new page using
oracle.apps.fnd.framework.webui.OAPageContext.forwardImmediatelyOAPage
Context.setforwardURL). This ensures that the forward action takes place immediately
and no further web bean processing is done on the current page after the forward call;
otherwise, the removed view object or row instances may cause side effects in subsequent
OA Framework web bean processing routines.

Posting to an OA Framework Page from a Different Technology

If you post to an OA Framework page from a different technology (a JTT page, for example) the
OA Framework executes only the processRequest phase in the target page. It does not
execute the processFormData and processFormRequest phase. It is important that you do
not work around this behavior; please design your application to accommodate this expected
behavior.

Model Interaction
In simple terms, the only model object that you should access directly from your OA controller is
the application module. In other words, the only valid model import in your controller code is:

import oracle.apps.fnd.framework.OAApplicationModule;

You should not access view objects directly to execute queries, iterate the rowset, or interact
with the underlying entity object(s). For example, the following code (although technically
feasible) is incorrect according to the OA Framework Controller Coding Standards.



import oracle.apps.fnd.framework.OAViewObject;

    ...

                                                                                              213
Oracle Application Framework Developer's Guide




      // Get the root application module

      OAApplicationModule am = pageContext.getRootApplicationModule();



      // Find the view object you want to query

   OAViewObject vo =
(OAViewObject)am.findViewObject("<instanceName>");



      ...

Instead, if you need to execute a view object query, you should proceed as shown in the
following example which illustrates handling a "Go" button press in a "Search" region.

First, add a method to the containing application module (in this example, it's the page's root
application module) which accepts search criteria and then delegates to the target view object
for query execution (see Implementing the Model for information about query execution).



public void search(String orderNumber, String created, String
showMyOrders)

{

    PoSummarySimpleExpVOImpl vo = getPoSummarySimpleExpVO();



  // Always check for the null condition if the VO cannot be
found/created

    if (vo == null)

    {

    MessageToken[] tokens = { new MessageToken("OBJECT_NAME",
"PoSummarySimpleExpVO")};

        throw new OAException("ICX", "FWK_TBX_OBJECT_NOT_FOUND", tokens);

    }


214
Oracle Application Framework Developer's Guide, Release 12.1.3




    vo.initQuery(orderNumber, created, showMyOrders);



} // end search()

Then, add button handler code like the following to your controller which invokes the correct
method in the application module.

Note that you should always check for an event source in your processFormRequest() code;
never assume that the browser issued a POST request because your item was selected (even in
a simple page with just one button, for example). Behind the scenes, the OA Framework often
submits for the page form when you might not be expecting it to do this.



processFormRequest(OAPageContext pageContext, OAWebBean webBean)

{



    // Check to see if the "Go" button was pressed...

    if (pageContext.getParameter("gButton") != null)

    {

        // Get the search criteria

        String orderNumber = pageContext.getParameter("SearchOrder");

        String created = pageContext.getParameter("Created");

        String showMyOrders = pageContext.getParameter("MyOrders");



    OAApplicationModule am =
pageContext.getApplicationModule(webBean);



    // All parameters passed using invokeMethod() must be
serializable.
    Serializable[] parameters = { orderNumber, created, showMyOrders
};

                                                                                                215
Oracle Application Framework Developer's Guide


        am.invokeMethod("search", parameters);

    }

}

Tip: Whenever you call invokeMethod() on a server-side BC4J component, any parameters
that you pass must be Serializable. The example above illustrates the invokeMethod()
signature that expects all the parameters to be Strings. If you need to pass other object types,
use the version of invokeMethod() that takes an array of parameter types. For example:



Class[] parameterTypes = { String.class, Hashtable.class, Number.class
...};

am.invokeMethod("search", parameters, parameterTypes);

Similarly, since the view object is the conduit to the entity object -- and you should not interact
directly with view objects in your controllers -- it stands to reason that you should also route all
entity object actions through an application module also.

Note: As described in Implementing the Model, the methods that you add in your application
module should be named for the corresponding UI "events." For example, if the user presses a
"Create" button, the application module method should be named "create" and so on.

Create Example



processFormRequest(OAPageContext pageContext, OAWebBean webBean)

{

    OAApplicationModule am = pageContext.getApplicationModule(webBean);

    am.invokeMethod("create", null);

}

Delete Example

This example illustrates invoking a delete method on a nested application module associated
with a shared region as opposed to the page's root application module.



processFormRequest(OAPageContext pageContext, OAWebBean webBean)


216
Oracle Application Framework Developer's Guide, Release 12.1.3


{



 if (pageContext.getParameter("DeleteYesButton") != null)

 {

     // User has confirmed that she wants to delete this purchase order.

     // Invoke a method on the AM to set the current row in the VO and

     // call remove() on this row.



     String poHeaderId = pageContext.getParameter("poHeaderId");

     Serializable[] parameters = { poHeaderId };



     OAApplicationModule am = pageContext.getApplicationModule(webBean);
     am.invokeMethod("delete", parameters);

    }



 ...

Custom Action Example ("Approve")



processFormRequest(OAPageContext pageContext, OAWebBean webBean)

{

    if (pageContext.getParameter("Approve") != null)

    {

    OAApplicationModule am =
pageContext.getApplicationModule(webBean);

        am.invokeMethod("approve");

    }

                                                                                    217
Oracle Application Framework Developer's Guide


}

Commit Example



processFormRequest(OAPageContext pageContext, OAWebBean webBean)

{

   // Simply telling the transaction to commit will cause all the
Entity Object validation

      // to fire.

      //

   // Note: there's no reason for a developer to perform a rollback.
This is handled by

   // the OA Framework if errors are encountered during the
processFormData phase.



      OAApplicationModule am = pageContext.getApplicationModule(webBean);
      am.invokeMethod("apply");

}

Disabling Validation
There are times when you need to bypass the normal validation that occurs during the OA
Framework HTTP POST processing. For example, if you are implementing an "Add Another
Row" button in a table, you may not want error messages to be displayed for incomplete rows
when the user opts to add a new row. Similarly, you might want to defer validation in a multistep
page flow until the final review and submit page, or while navigating through sub tabs presenting
different views of the same underlying object.

Disabling Server-Side Validation

To prevent exceptions from being thrown by your model validation logic, call the
setServerUnvalidated(true) method on any of the following beans as appropriate for
your page (remember to add this web bean modification code in a processRequest()
method!):

    •      OASubmitButtonBean
    •      OATableBean

218
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   OAAdvancedTableBean
   •   OASubTabLayoutBean
   •   OANavigationBarBean
   •   OADefaultHideShowBean
   •   OAHideShowHeaderBean

Note: You can also set this declaratively by setting the component's Disable Server Side
Validation property to True, and you can disable this validation for links or icon that have
been configured to perform a form submit. See the Javascript URL section below for additional
information.

When the user performs an action on one of these beans that causes the form to be submitted,
the OA Framework proceeds through all the HTTP POST processing described above --
including executing all your attribute-level validation logic (entity-level validation is not
performed). If oracle.apps.fnd.framework.OARowValException or
oracle.apps.fnd.framework.OAAttrValException exceptions (or their deprecated
suprclasses) are thrown during processFormData(), the OA Framework simply ignores them
and continues processing as if it had encountered no exceptions.

Note: The OA Framework does not ignore serious exceptions (like a
NullPointerException) thrown in processFormData(). These are displayed as usual,
and processing does not proceed to processFormRequest(). Furthermore, any exceptions
that you or BC4J throw in processFormRequest() are displayed as usual.

Disabling Client-Side Validation

Whenever a form with user-entered data submits, UIX performs some basic onSubmit
Javascript validation (it verifies required fields, data types and formats), and submits the form
only if the validation succeeds. To complete the process of bypassing validation, you also need
to disable these client-side checks by calling setUnvalidated(true)for the same beans
listed in the "Disabling Server-Side Validation" section above.

Note: You can also set this declaratively by setting the component's Disable Client Side
Validation property to True, and you can disable this validation for links or icon that have
been configured to perform a form submit. See the Javascript URL section below for additional
information.

Tip: For tables and HGrid components, you must enable/disable client-side validation by setting
a property for the table and HGrid regions themselves since you do not have direct access to
the OANavigationBarBean child web beans used for data set navigation. Note that you
currently cannot disable server-side validation for these components.

Error Handling
The OA Framework automatically displays any error messages thrown in the model layer; you
don't need to do anything in your controller to facilitate this.



                                                                                              219
Oracle Application Framework Developer's Guide


   •   See Error Handling for information about throwing exceptions in your controller code and
       displaying Error, Warning, Confirmation and Information messages at the top of a page.
   •   See Chapter 4: Dialog Pages for information about displaying a model Error, Warning,
       Confirmation, and Information dialog page.

Javascript
UIX and the OA Framework are rapidly adding new features to provide a more interactive user
experience (partial page rendering, automatic table totaling, and so on). You are certainly
encouraged to leverage these features as they are released, however, you should not attempt
to implement them yourself before they're ready.

In short, Javascript is prohibited without explicit permission from the OA Framework team.
Furthermore, you must have confirmation from the corporate UI design team that a Javascript
implementation is essential for your product.

Javascript URL

Previously, there was one exception to the Javascript prohibition: if you wanted to configure a
link or image to submit the page form (because you need an event to handle before navigating
to a new page), you could set its destination property to the UIX submitForm Javascript
function

Now, even this small amount of Javascript is prohibited. Instead, you should configure a
fireAction event instead of using the Javascript URL. See the Declarative Submit Form
documentation for additional information.




220
Oracle Application Framework Developer's Guide, Release 12.1.3



Error Handling
Overview
This document describes how to throw OA Framework exceptions in your model and controller
code.

Contents

   •   Exception Types
   •   Exception Classes
   •   Bundled Exceptions
   •   Exception Examples
   •   Dialog Pages and Message Boxes

Prerequisite Reading

   •   Implementing the Model
   •   Implementing the View
   •   Implementing the Controller

Related Information

   •   Implementing Entity Objects
   •   Implementing PL/SQL Entity Objects

Exception Types
The OA Framework handles three basic types of exceptions: general, validation and severe.
These types are briefly described in this section; specific exception usage instructions are
provided below.

General Exceptions

Errors in the BC4J framework are handled by throwing an implicit (runtime) exception of the
type oracle.jbo.JBOException. The OA Framework has its own specialization of this
called oracle.apps.fnd.framework.OAException . This specialization provides a
mechanism for bundling multiple exceptions together, while also translating the exception
messages using Oracle E-Business Suite Message Dictionary, so that useful messages can be
displayed. In any of your code, you can throw an OAException for general, page-level
exceptions.

Validation Exceptions

Validation exceptions are thrown from entity objects and view objects for both row and attribute
level validation failures.

                                                                                               221
Oracle Application Framework Developer's Guide


   •   oracle.apps.fnd.framework.OAAttrValException - specialization of
       OAException used for attribute level validation failures
   •   oracle.apps.fnd.framework.OARowValException - specialization of
       OAException used for row (entity) level validation failures

The OA Framework displays error messages to the user as follows:

   •   Attribute-level exceptions are visually indicated on the error item(s) and at the top of the
       page
   •   Row-level exceptions are visually indicated on the error row(s) and at the top of the page
   •   Page-level exceptions are visually indicated at the top of the page

Severe Exceptions

Severe (or "fatal") exceptions include unexpected system-level errors (like a
NullPointerException) and selected JBOExceptions like NoDefException. You can also
deliberately throw a severe exception in your code.

If a fatal exception occurs, the user is directed to the OAErrorPage (f the fatal exception occurs
in the middle of page rendering, the page is partially rendered with a user-friendly error
message that includes a link to the detail stack trace). The OAErrorPage also displays a user-
friendly error message with a link to the detail stack trace.

Note: This is an untranslated message that customers can change on site.

Oracle Workflow Notification

The OA Framework also ships a seeded business event
(oracle.apps.fnd.framework.OAFatalError)which sends a notification to the
SYSADMIN user whenever OA Framework page reports a severe or fatal exception. The
notification includes the detailed error stack for the fatal exception and information about the
user who encountered the exception. If you wish to change the notification's default recipient
from SYSADMIN, you need to customize the definition of Item Type OAERROR.

The subscription to this business event is disabled by default. To enable the subscription, refer
to the Oracle Workflow documentation on how to enable a subscription for a business event.

   •   If you are using Oracle Workflow Release 11i/2.6, with the original Oracle Applications
       user interface, see "To Update or Delete an Event Subscription", Oracle Workflow
       Developer's Guide.
   •   If you are using the OA Framework-based user interface for the Business Event System,
       see "To View and Maintain Event Subscriptions", Oracle Workflow Developer's Guide.

Exception Classes
The OA Framework exception inheritance hierarchy is shown in Figure 1 below. The
OAException superclass extends JBOException. OAAttrValException and OARowValException
extend OAViewObjectException, a deprecated class that extends OAException.

222
Oracle Application Framework Developer's Guide, Release 12.1.3


Figure 1: OA Framework exception inheritance hierarchy




OAException

OAException is the exception that you would throw in generic error cases (for example, if you
encountered an unexpected problem in some controller code as shown):



OACellFormatBean shipTermsCell =


(OACellFormatBean)webBean.findIndexedChildRecursive("ShipTermsCell");



 if (shipTermsCell == null)

 {

   MessageToken[] tokens = { new MessageToken("OBJECT_NAME",
"ShipTermsCell")};


                                                                                                223
Oracle Application Framework Developer's Guide


      throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", tokens);

 }



Note that we created a message in the Oracle E-Business Suite Message Dictionary
(FWK_TBX_OBJECT_NOT_FOUND) in the AK application. The message was defined with a
token (OBJECT_NAME) that we replace with the name of the UI component that we expected
to find. The OA Framework will use this information to automatically display a properly
translated error message at the top of the page (if you instantiate an OAException, and don't
specify the message type, it always renders as an error).

Note: Although it is not an explicit coding standard, it is good coding practice and beneficial
to wrap an exception rather than create a new exception:

throw OAException.wrapperException(myException);

Wrapping an exception creates a new OAException that includes the original exception as a
detail exception. By wrapping an exception, the core exception gets reported and OA
Framework inspects the original exception to determine its severity. If you create a new
exception, you do not get that information, and the exception stack trace stops with your
code, resulting in a bug with less information.

Since the OAException is a flexible object that can also be used to display other types of
messages to the user (Information, Confirmation and Warning), you can also instantiate it with a
message type as shown for the following Confirmation example (see the Dialog Pages and
Message Boxes section below for pointers to documents that describe how to use these
features to display Information, Confirmation and Warning messages).



MessageToken[] tokens = { new MessageToken("SUPPLIER_NAME", name),
                          new MessageToken("SUPPLIER_NUMBER",
supplierId) };

OAException confirmMessage = new OAException("AK",


"FWK_TBX_T_SUPPLIER_CREATE_CONF",

                                                              tokens,


OAException.CONFIRMATION,

                                                              null);




224
Oracle Application Framework Developer's Guide, Release 12.1.3


Message Type

The OAException, OAAttrValException, and OARowValException classes all include
constructors that accept a message type (byte) parameter. The message type parameter tells
OA Framework the type of message to display to a user. Valid options include:

    •   OAException.ERROR
    •   OAException.WARNING
    •   OAException.INFORMATION
    •   OAException.CONFIRMATION
    •   OAException.SEVERE

OAAttrValException

If any attribute-level validation fails in a view object row or an entity object, you can throw an
OAAttrValException as shown below.

To instantiate this exception, you must pass the following information:

    •   Source object type (OAException.TYP_ENTITY_OBJECT or
        OAException.TYP_VIEW_OBJECT)
    •   Full entity definition name or view instance name as appropriate
    •   Primary key of the entity or row
    •   Attribute name being validated
    •   Attribute value that failed validation
    •   Error message application short name
    •   Error message name

Entity Object Example



public void setSalary(Number value)

{

    if (value != null)

    {

        // Verify value is > 0
        if (value.compareTo(0) <= 0)

        {

         throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
// indicates EO source



                                                                                                     225
Oracle Application Framework Developer's Guide


                                                   getEntityDef().getFullName(), //
entity name

                                                   getPrimaryKey(), // entity
primary key

                                                   "Salary", // attribute Name

                                                   value, // bad attribute value

                                                   "AK", // nessage application
short name


"FWK_TBX_T_EMP_SALARY_REQUIRED"); // message name



          }

          setAttributeInternal(SALARY, value);

      }

} // end setSalary()

View Row Example

Also see the Mapping section below for additional information about raising these exceptions
from a view row.



setDescription(String value)
{
  if("XXX".equals(value)

  {
          throw new OAAttrValException (

                                         OAException.TYP_VIEW_OBJECT, //
indicates VO row source

                                         getViewObject().getFullName(), //View
Object full usage name

                                         getKey(), // row primary key

                                         "Description", //attribute name

226
Oracle Application Framework Developer's Guide, Release 12.1.3


                                            value, // bad attribute value

                                            "FND", //message application short name

                                            "ATTR_EXCEPTION"); // message name

  }
  setAttributeInternal("Description", value);
} // end setDescription()

OARowValException

If any row-level validation fails in a view object row or an entity object, you can throw an
OARowValException as shown below.

To instantiate this exception, you must pass the following information:

    •   Full entity definition name or view instance name as appropriate
    •   Primary key of the entity or row
    •   Error message application short name
    •   Error message name

Entity Object Example



protected void validateEntity()
{
 super.validateEntity();

 if(attr1!=attr2)

    throw new OARowValException (

           getEntityDef().getFullName(), // entity full definition name

           getPrimaryKey(),                           // entity object primary key

           "FND",                                     // message application short
name

           "ATTR_EXCEPTION");                         // message name

}

View Row Example

Also see the Mapping section below for additional information about raising these exceptions
from a view row.

                                                                                               227
Oracle Application Framework Developer's Guide




protected void validate()
{
  super.validate();
  if(attr1!=attr2)
    throw new OARowValException (
        getViewObject().getFullName(),//View Object full usage name

           getKey(),                                   // row primary key
           "FND",                                      // message application short
name

           "ATTR_EXCEPTION");                          // message name
}

Overriding the Row-Level Error Prefix

When the OA Framework renders row and attribute error and warning messages in tables, the
message is comprised of two components: row prefix + error message. For example:

    •   Row 2 Error: <Some error message relating to the entire row 2>
    •   Row 2 <Attribute Prompt>: <Some error message relating to the given attribute in Row
        2>

You can optionally override this prefix if the default row references are not appropriate for your
user interface. For example:

    •   Line 2-3 Error: <Some error message relating to this row in the table>
    •   Line 2-3 <Attribute Prompt>: <Some error message relating to the given attribute in this
        designated row>

To implement this:

Step 1: Create a transient view object attribute to include the translated String that you want to
display as the row prefix.

Step 2: Create a custom property for the view object:

    •   Set its Name to ROW_DISPLAY_PREFIX_ATTR_NAME
    •   Set its Value to the name of the attribute that you created in Step 1

When processing exceptions related to this view object, the OA Framework will check to see if
this custom property is set, and if it is, will use the designated attribute value as the row prefix.

Note: For consistency, the OA Framework applies this prefix to any error or warning message
that you generate, plus any row-level messages that it generates internally.

Mapping Entity Attributes into VO Attributes

228
Oracle Application Framework Developer's Guide, Release 12.1.3


When you create custom view row methods that throw exceptions originating in entity object,
you must call doEntityToVOMapping on the exception to create a mapping between the
entity object attributes and the view object attributes as shown in the following example:



/**

 * Approves the purchase order associated with this row.

 */

public void approve()

{

  // Whenever you write custom methods on the VO Row that call custom
methods

  // on the Entity Object you need to do a manual mapping as shown
below

    // to correctly handle the entity exceptions.

    try

    {

        getPurchaseOrderHeaderEO().approve();

    }

    catch(OARowValException e)

    {

        OAViewObject[] vos = {(OAViewObject)getViewObject()};

        e.doEntityToVOMapping(getApplicationModule(), vos);

        throw e;

    }

} // end approve()

Behind the scenes, the OA Framework calls this method for you for exceptions thrown in the
following methods:


                                                                                             229
Oracle Application Framework Developer's Guide


   •   viewRow.setAttribute()
   •   viewRow.validate() (catches all exceptions thrown from eo.validate())
   •   create(AttributeList)
   •   viewRow.remove()

Note: If you override these methods, this mapping is performed when you call super. If your
overriding code explicitly throws entity object exceptions, then you need to call
doEntityToVOMapping.

Bundled Exceptions
Bundled exceptions let you accumulate "peer" exceptions while proceeding with validation, and
then display them as a set when you are done. These peer exceptions are grouped in a
container exception called a bundled exception.

Bundled exceptions can include any kind of server-side exceptions (including system-level
exceptions, data formatting errors, attribute validation errors, row validation errors, and entity
creation errors).

Peer Exceptions List

To creat a bundled exception, you first must create a list to which you add exceptions as you
encounter them:



ArryList peerExceptions = new ArrayList();
peerExceptions.add(new OAException(....));
peerExceptions.add(new OAException(....));
...

Bundled Exceptions

When you're ready to throw your bundled exception, call
OAException.getBundledOAException to create the bundled OAException from the list of
peer exceptions that you pass to it or call OAException.raiseBundledOAException to
create and throw the bundled OAException immediately.

   •   Note that bundling similar APIs are also available on OAAttrValException and
       OARowValException.
   •   See the various accessors published by the OA*Exception classes for interacting with
       bundled exceptions (remember that the bundled exception itself is simply a container
       including the peer exceptions array).

During entity and row validation, if you don't want to do your own bundling, you can also register
exceptions. These exceptions will be thrown when validation completes, or when an exception
is explicitly thrown as illustrated in the examples below (see the Javadoc for



230
Oracle Application Framework Developer's Guide, Release 12.1.3


oracle.apps.fnd.framework.server.OAEntityImpl and
oracle.apps.fnd.framework.server.OAViewRowImpl).

BC4J Bundled Exception Mode

When this mode is disabled, all exceptions thrown by the entity attribute setters are thrown right
away to the calling view row, which then throws the exception to the caller. When you enable
bundled exception mode, BC4J stacks exceptions thrown from the entity attribute setters, and
throws them end of valdiateEntity, or when validateEntity throws an exception. All of these
exceptions are bundled into a single exception that is returned to the caller.

You can enable this mode by calling:

OADBTransaction.setBundledExceptionMode(true);

By default, this mode is disabled. We recommend that you do not use this feature as the OA
Framework collects all exceptions on your behalf without this.

Exception Examples

Example 1

The following code example illustrates how to catch exceptions and throw them as a single
bundled exception.



public void foo()

{

    ArrayList exceptions = new ArrayList();



    for(int ...; ...; ...)

    {

        if(.....)

        {

            exceptions.add(new OAException(.....));

        }

    }

                                                                                              231
Oracle Application Framework Developer's Guide




    OAException.raiseBundledOAException(exceptions);



}

Example 2

The following code caches exceptions thrown during validateEntity(), and then throws the
cached exceptions as one bundled exception.



protected void validateEntity()
{
  super.validateEntity();



    ArrayList exceptions = new ArrayList();



    //check for duplicate Filter Name

    if (getEntityState() == STATUS_NEW)

    {

        String value = getFilterName();

        OADBTransaction tx = getOADBTransaction();

            OAApplicationModule vam = getMyValidationAM();

            FiltersVOImpl vo = vam.findViewObject("filtersViewUsage");

            if (vo == null)

        {

          vo =
vam.createViewObject("filtersViewUsage","oracle.apps.qrm.filter.server
.FiltersVO");

              vo.setMaxFetchSize(-1);


232
Oracle Application Framework Developer's Guide, Release 12.1.3


           vo.initQuery(value,"C");

           Row r = vo.first();

           if (r != null)

           {

                 exceptions.add(

                   new OAAttrValException (

                            OAException.TYP_ENTITY_OBJECT, // Entity
attribute exception.

                            getEntityDef().getFullName(), //Entity full
def name

                            getPrimaryKey(), //Row primary key

                            "FilterName", //Attribute Name

                            value, //Bad Value

                            "QRM", //Message Application Short Code

                            "QRM_UNIQUE_FILTERS_ERR")); //Message Code

           }

       }



     //check for empty filters(no conditions)



        EntityDefImpl def =
EntityDefImpl.findDefObject("oracle.apps.qrm.filter.server.QrmFilterCo
nditionsEO");

        Iterator iterator =
def.getAllEntityInstancesIterator(getDBTransaction());

       String flag = "no";

       while (iterator.hasNext())


                                                                                 233
Oracle Application Framework Developer's Guide


          {

                QrmFilterConditionsEOImpl fcEO =
(QrmFilterConditionsEOImpl)iterator.next();

                    // only check rows in valid state

                if ( fcEO.getEntityState() != STATUS_DELETED &&
fcEO.getEntityState() != STATUS_DEAD )

          {

                       flag = "OK";

          }

          }

          if (flag.equals("no"))

          {

                    exceptions.add(

                      new OARowValException (

                               getEntityDef().getFullName(),

                               getPrimaryKey(), //Row primary key

                               "QRM", //Message Application Short Code

                               "QRM_NO_CONDITIONS_ERR")); //Message Code

          }



          OAException.raiseBundledOAException(exceptions);

 }

Example 3

The following code example caches exceptions thrown in a view object method, and then
throws the cached exceptions as one bundled exception.




234
Oracle Application Framework Developer's Guide, Release 12.1.3


public void checkUsed()
{
   String ifSelected = null;
   String name;
   ArrayList exceptions = new ArrayList();
   FiltersVORowImpl row = (FiltersVORowImpl)first();
   while (row != null)
   {
     ifSelected = (String)row.getAttribute("SelectFlag");


    if ("Y".equals(ifSelected))
    {
       name = (String)row.getAttribute("FilterName");
       OAViewObjectImpl vo =


(OAViewObjectImpl)getApplicationModule().findViewObject("IsFilterUsedV
O");
        vo.setWhereClause(null);
        vo.setWhereClauseParams(null);
        vo.setWhereClauseParam(0,name);
        vo.executeQuery();
        Row r = vo.first();


       //if there are analyses, then use them
       if (r != null)
       {
         String msg= (String)r.getAttribute("AnalysisName");
         String flag ="f";


          while (r != null)
          {
            //change flag if it was the first row,if not append
analysis name
            if (flag.equals("f"))
              flag = "N";
            else
              msg = msg +", "+ (String)r.getAttribute("AnalysisName");
              r = vo.next();
          }
          MessageToken[] tokens = {new
MessageToken("FILTER_NAME",name),
                                   new MessageToken("ANALYSIS",msg)};
          exceptions.add(
             new OARowValException(
                  getViewObject().getFullName(),
                  row.getKey(),
                  "QRM",

                                                                                235
Oracle Application Framework Developer's Guide


                      "QRM_FILTER_REMOVE_ERR",
                      tokens));
           }
       }


      row =(FiltersVORowImpl)next();
    }
    OAException.raiseBundledOAException(exceptions);
}

Example 4

The following code example registers a validation exception in set<Attribute>() so BC4J
can throw this exception later during the entity validation.



public void setAmount(oracle.jbo.Number amnt)
{

      // Clears any old exceptions for a fresh start.
      clearAttributeException("Amount");
      if(amnt < 0)
      {
         OAAttrValException attrEx = new OAAttrValException(
            OAAttrValException.TYP_ENTITY_OBJECT,
            getEntityDef().getFullName(),
            getPrimaryKey(),
            "Amount",
            amnt,
            "QRM",
            "QRM_AMOUNT_IS_NEGATIVE");




registerAttributeException(getEntityDef().getAttributeDefImpl("Amount"
),amnt, attrEx);

           }

 }

Example 5

This code example registers exceptions thrown during validateEntity()so BC4J can throw
these exceptions when validation completes.



236
Oracle Application Framework Developer's Guide, Release 12.1.3




protected void validateEntity()
{
  super.validateEntity();

  // Clears all Row and Attribute exceptions registered in
validateEntity() for a fresh start.

  clearAttributeException("FilterNAme");

  clearRowExceptions();



  //check for duplicate Filter Name
  if (getEntityState()==STATUS_NEW)
  {
     String value = getFilterName();
     OADBTransaction tx = getOADBTransaction();
     OAApplicationModule vam = getMyValidationAM();
     FiltersVOImpl vo = vam.findViewObject("filtersViewUsage");


     if(vo == null)

     {
        vo = vam.createViewObject("filtersViewUsage",
"oracle.apps.qrm.filter.server.FiltersVO");

     }


     vo.setMaxFetchSize(-1);
     vo.initQuery(value,"C");
     Row r = vo.first();
     if (r != null)
      {
        OAAttrValException attrEx = new OAAttrValException (
            OAException.TYP_ENTITY_OBJECT, // Entity attribute
exception.
            getEntityDef().getFullName(), //Entity full def name
            getPrimaryKey(), //Row primary key
            "FilterName", //Attribute Name
            value, //Bad Value
            "QRM", //Message Application Short Code
            "QRM_UNIQUE_FILTERS_ERR")); //Message Code




                                                                                237
Oracle Application Framework Developer's Guide



registerAttributeException(getEntityDef().getAttributeDefImpl("FilterN
ame"), value, attrEx);
      }
    }



          //check for empty filters(no conditions)
      EntityDefImpl def =


EntityDefImpl.findDefObject("oracle.apps.qrm.filter.server.QrmFilterCo
nditionsEO");
    Iterator iterator =
def.getAllEntityInstancesIterator(getDBTransaction());
    String flag = "no";
    while (iterator.hasNext())
    {
      QrmFilterConditionsEOImpl fcEO =
(QrmFilterConditionsEOImpl)iterator.next();
      // only check rows in valid state
      if ( fcEO.getEntityState() != STATUS_DELETED &&
fcEO.getEntityState() != STATUS_DEAD )
       flag = "OK";
    }
    if (flag.equals("no"))
    {
      registerRowException(
        new OARowValException (
             getEntityDef().getFullName(),
             getPrimaryKey(), //Row primary key
             "QRM", //Message Application Short Code
             "QRM_NO_CONDITIONS_ERR")); //Message Code
    }
  }

Dialog Pages and Message Boxes
For information about displaying modal Error, Information, Warning and Confirmation dialog
pages, see Chapter 4: Implementing Dialog Pages.

For information about displaying Error, Information, Warning and Confirmation messages boxes
at the top of a page (when not simply displayed automatically as a consequence of throwing an
exception), see Chapter 4: Implementing Message Boxes.




238
Oracle Application Framework Developer's Guide, Release 12.1.3



Creating Attribute Sets
Overview
This document describes how to create attribute sets in accordance with the OA Framework
coding standards.

Contents

   •   Designing Attribute Sets
   •   Creating Attribute Set Packages Manually
   •   Creating Attribute Sets Manually
   •   Generating Attribute Sets Automatically
   •   Deploying Attribute Sets

Prerequisite Reading

This document assumes that you have read the following in the OA Framework Developer
Guide:

   •   Anatomy of an OA Framework Page
   •   Implementing the View

Designing Attribute Sets
Note: This section is intended for internal Oracle E-Business Suite developers only.

First and foremost, all attribute sets that Oracle E-Business Suite developers create must
comply with the following standards:

   •   The OA Framework View Coding Standards describe the circumstances under which
       you should (must!) create attribute sets. Note that attriubte sets are also required for
       service definitions. See Creating Services for additional information.
   •   The OA Framework File / Package / Directory Structure standards describe all the
       naming conventions that you should use for the attribute set packages and individual
       attribute sets. It also describes the directory structure that you should use for the XML
       package files.

Once you understand the standards, you're ready to proceed:

   1. Product teams who own some of the key shared data entities (example: TCA, ITEMS
      and FND) should take the lead on building the attribute sets associated with their
      schema.
   2. If you need to use a column for which no attribute set is currently published, you should
      coordinate with the owner team to have the attribute set created. If, for any reason, the
      owner team can't meet your schedule requirements, you can make an arrangement with


                                                                                               239
Oracle Application Framework Developer's Guide


      the owner team to create the attribute set on their behalf and hand it over for source
      control and packaging.
   3. Before creating an attribute set, make sure it is truly unique and warranted (do NOT
      duplicate existing attribute sets without explicit permission from the OA Framework
      team).
   4. Changes to existing attribute sets are not permitted until an impact and mitigation study
      is conducted by the OA Framework team.
   5. As a rule, you should generate your table-based attribute set packages automtically
      using the procedure described below, and then make any necessary manual edits.

Creating Attribute Set Packages Manually
As described in Implementing the View, all attribute sets are created into the context of an OA
Component package file.

To create an attribute set package in JDeveloper:

   1. In the JDeveloper Navigator, select the OA Project where you want to create your
      package.
   2. From the main menu, choose File > New to open the New Object Gallery.
   3. In the Categories tree, expand the Web Tier node, and select OA Components.
   4. In the Items list, select Package File to open the New Package File dialog.
   5. Enter a Name and a Package in accordance with the OA Framework File / Package /
      Directory Structure standards. Select OK to save create your <Package>.<Name>.xml
      OA Component document.
   6. Save your work.

Creating Attribute Sets Manually
To create and edit individual attribute sets in JDeveloper:

   1. Identify which Attribute Set Template (all of which are described in the next section) you
      should be using based on the kind of attribute set you need to create. For example, if
      you are creating a button attribute set, you need to use the Button Template.
   2. In the JDeveloper Applications Navigator pane, select the attribute set package to
      display its contents in the Structure pane.
   3. In the Structure pane, select the Attribute Set folder, right-click and select New >
      Attribute Set to open the New Attribute Set dialog.
   4. In the New Attribute Set dialog, enter an Attribute Set Name in accordance with the OA
      Framework File / Package / Directory Structure standards. Per the attribute set template
      that you identify in Step 1, select all the appropriate properties in the Available
      Properties list and shuttle them to the Included Properties list. Select OK to create the
      attribute set.
   5. Enter values for the attribute set's included properties in the Property Inspector.
   6. Save your work.

Generating Attribute Sets Automatically (Only on Linux)

240
Oracle Application Framework Developer's Guide, Release 12.1.3


In order to facilitate the process of creating table-related attribute set packages and attribute
sets, you should automatically generate these using a command-line utility.

Prerequisites

   1. Before proceeding, make sure that any tables for which you want to generate attribute
      sets are fully described in FND_TABLES and FND_COLUMNS (to do this, you need to
      load properly defined XDF table definitions). The table name, column name and column
      descriptions defined in these entities become the basis for the generated attribute sets.
   2. You should check out any preexisting attribute set packages from source control that
      you want to update with the generator. Note the physical location of the XML files in your
      working area.

Running the Attribute Set Generator

To automatically generate new and updated existing attribute sets, run the Attribute Set
Generator from the Linux command line as shown below. This utility will create new attribute
sets, and update preexisting attribute set Comments property values with the corresponding
column descriptions in FND_COLUMNS. You can elect to generate attribute sets for an entire
product, or for specific tables within a product. Once you generate your attribute sets, you can
maintain all other properties in JDeveloper as described above (the generator never overrides
any other property values).

Note: For persistent attributes, the Comments property value is always copied from
FND_COLUMNS (the column description value in FND_COLUMNS should be treated as the
single source of truth). If you need to make changes to the Comments property value, you need
to change the underlying column description.

The resulting attribute set packages and attribute sets are named according to the OA
Framework naming conventions. Correct naming and packaging is essential for service creation
since the OA Framework automatically detects table.column attribute sets using these naming
conventions, and defaults them when you create view object attributes that map to persistent
entity attributes.

The following shows the online help for the attributesets command:



****** attributesets ******



Creates or Updates attribute set files



Parameter(s) passed to attributesets:

    1 = Username to database

                                                                                                    241
Oracle Application Framework Developer's Guide


      2 = Password to database

      3 = Database hostname

      4 = Database port number

      5 = Database SID

      6 = Xml classpath. Location to where your XML files are located
         (Example: /home/[name]/jdevhome/myprojects)

      7 = Application Short Name (Example: PO)

      ----- optional parameter(s) -----

   8 = Table Specification. Default is to generate attribute sets for
all tables

          belonging to Application Short Name (parameter 7).

      Example 1) PO_VENDORS - generates the attribute set PoVendors.xml

   Example 2) PO_VENDOR% - generates the attribute sets for all tables
that match

                                     the query PO_VENDOR%.

      9 = Package (Example: /oracle/apps/po/attributesets)

Examples

Assuming the generated attribute set package will be /oracle/apps/po/attributesets,
the following command generates all the attribute sets for the PO product, and puts the resulting
files in the
/home/jfrost/jdevhome/jdev/myprojects/oracle/apps/po/attriubtesets
directory.



/jdevbin/<SelectedJDevBuild>/build attributesets APPS APPS
appsdbs.us.oracle.com 1521 devdb /home/jfrost/jdevhome/jdev/myprojects
PO

Assuming the generated attribute set package will be /oracle/apps/po/attributesets,
the following command generates all the attribute sets for PO tables starting with the name
PO_VENDOR, and puts the resulting files in the
/home/jfrost/jdevhome/jdev/myprojects/oracle/apps/po/attriubtesets
directory.


242
Oracle Application Framework Developer's Guide, Release 12.1.3




/jdevbin/<SelectedJDevBuild>/build attributesets APPS APPS
appsdbs.us.oracle.com 1521 devdb /home/jfrost/jdevhome/jdev/myprojects
PO PO_VENDOR%

Attribute Set Templates

JDeveloper supports a large variety of properties when creating an attribute sets. In
consideration of reuse, customization, verticalization and translation realities, Oracle E-Business
Suite product teams should limit themselves to the templates provided in this section.

   •   Properties designated as Required must be included in the attribute set definition with
       appropriate values.
   •   Optional properties must NOT be included in the attribute set definition unless there is a
       sensible property to specify. If you include a property in an attribute set without
       populating its value, you run the risk of unintended behavior when combining attribute
       set usage with extension.
   •   Do NOT include any properties not explicitly listed in these templates.

Table.Column Template

The following is a list of the properties that may be used to define table column attribute sets.
You should also use this template if you create a Transient.xml attribute set package for
commonly used attributes that have no associated base table.

Property         Description                        Required      Specific Guidelines
Additional Text Used for bubble help and            Optional
                tooltips.
Comments         Desribes the associated            Required      Examples include:
                 attribute.
                                                                  Need-By Date
                 Note: This value is used as for                  Date by which line items must
                 attribute-level comments as                      be delivered.
                 described in Creating Services.
                                                                  Promise Date
                 Note: For persistent attributes,                 Date by which supplier promises
                 this value should be copied                      to deliver line items.
                 from FND_TABLES as
                 described above.                                 Receipt Date
                                                                  Date on which line items were
                                                                  received.



Data Type        VARCHAR2, DATE,                    Required for Specify only for transient items
                 DATETIME, NUMBER, or               transient    that has no mapping to a data
                 BOOLEAN (might change to           items        entity. Otherwise must default to
                 JAVA like types in the future)                  data type of associated data

                                                                                                243
Oracle Application Framework Developer's Guide


                                                                  attribute.
Document                                           Required       See the OA Framework File /
Name                                                              Package / Directory Structure
                                                                  standards.
Height            Display height                   Optional       Use for multi-line input text only.
Length            Item display Length              Optional       Number of characters to display,
                                                                  should be between 1 and
                                                                  maximumLength value
Maximum           Maximum number of                Required for Specify only for transient items
Length            characters allowed in the item   transient    that has no mapping to a data
                  value.                           items        entity. Otherwise must default to
                                                                value length of associated data
                                                                attribute.
Prompt            Item's prompt                    Required
Required          Is runtime form value required? Required for Specify only for transient items
                                                  transient    that has no mapping to a data
                                                  items        entity or when overriding a not-
                                                               required value corresponding to
                                                               a persistent data entity.
Tip Message       Message Dictionary message       Optional,      Specify if applicable
Appl Short        application short name.          depends on
Name                                               tipType
Tip Message       Message Dictionary message       Optional,      Specify if applicable
Name              name.                            depends on
                                                   tipType
Tip Type          dateFormat, longMessage,         Optional       Specify if applicable
                  shortTip, and none. For
                  longMessage and shortTip,
                  you must specify the Tip
                  Message Appl Short Name
                  and the Tip Message Name.

Button Template

The following is a list of the properties that may be used to define button attribute sets.

Property          Description                Required     Specific Guidelines
Additional Text   Used for bubble help       Required     Required for buttons per Accessibility
                  and tooltips.                           standards.
Comments          Describes attribute set    Required     Must include the context in which the
                  usage                                   attribute set is used.
Document                                     Required     See the OA Framework File / Package /
Name                                                      Directory Structure standards.
Prompt            Button label               Required


244
Oracle Application Framework Developer's Guide, Release 12.1.3


Region Header Template

The following is a list of the properties that may be used to define header attribute sets.

Property        Description               Required          Specific Guidelines
Additional Text Used for bubble help      Optional
                and tooltips.
Comments        Describes attribute set   Required          Must include the context in which the
                usage                                       attribute set is used.
Document                                  Required          See the OA Framework File / Package
Name                                                        / Directory Structure standards.
Icon URI        Header icon               Optional          Populate only if applicable to most
                                                            uses
Maximum         Maximum number of         Required for    Specify only for transient items that
Length          characters allowed in     transient items has no mapping to a data entity.
                the item value                            Otherwise must default to value length
                                                          of associated data attribute.
Prompt          Header text               Required


Deploying Attribute Sets
Once you create your attribute sets, you need to deploy them so they can be used by other
developers.

Note: the process for this is currently being designed for the Oracle E-Business Suite Division.




                                                                                                  245
Oracle Application Framework Developer's Guide



Internationalization
Overview

Contents

   •   User Preferences
   •   Language
   •   Timezone
   •   Client Character Encoding
   •   Dates
   •   Numbers/Currency
   •   Text and Component Alignment
   •   Localized Layouts
   •   Calendar Support
   •   Character Encoding of BC4J XML Files

Prerequisite Reading

   •   Implementing the Model
   •   Implementing the View
   •   Implementing the Controller

Related Information

   •   OA Framework Naming / File / Package / Directory Structure Standards
   •   OA Framework View Coding Standards

User Preferences
Most OA Framework application pages include a standard global Preferences button, which is
used to change the following locale-related session settings:

   •   Language
   •   Territory
   •   Timezone
   •   Client character encoding
   •   Date format
   •   Number format

When a user logs in, locale information is stored in ICX_SESSIONS and OA Framework
automatically considers these settings when rendering pages and handling data. See OA
Framework State Management for additional information about the Oracle E-Business Suite
User Session.

However, you must use the OA Framework methods described below when doing any explicit
manipulation of locale-sensitive data. This is so that it can be converted and formatted correctly

246
Oracle Application Framework Developer's Guide, Release 12.1.3


according to user's preferences and cultural conventions and not the default locale setting and
default encoding.

Note: Obtain the locale information like country, language, date/number format and so on
by calling the getUserLocale() and getUserLocaleContext()methods on
oracle.apps.fnd.framework.OANLSServices, which itself can be retrieved from an
oracle.apps.fnd.framework.webui.OAPageContext in a controller or an
oracle.apps.fnd.framework.OADBTransaction in model code).

Language
All text that is displayed to a user must be fully translatable. This section describes how you
ensure this for an application.

Note: When a value is "eligible for translation," it displays in the correct language for the
user assuming a translation is present. If not, the value is displayed in American English
regardless of the user's language preference.

Menu Definitions and Responsibilities

All the displayable properties that you define for menus, functions, and responsibilities are
eligible for translation. At runtime, the Oracle E-Business Suite displays these values in the
user's language, assuming that a translation for that language has been completed.

OA Component Definitions

All the displayable properties that you define declaratively in the Oracle JDeveloper OA
Extension are also eligible for translation. At runtime, OA Framework displays these values in
the user's language, assuming that a translation for that language has been completed.

Some web beans let you declaratively specify a message name for long text. This message is
defined in an Applications repository called Message Dictionary, and it is fully translatable. At
runtime, OA Framework displays the appropriate text for the user's language.

Tip: See the Oracle E-Business Suite Developer's Guide for information about creating
messages using Message Dictionary.

You can also define lists of attribute/value pairs (known as "Lookup Codes") for use in the UI to
display translated values to the user while your code deals with the static attributes.

Tip: See the Oracle E-Business Suite Lookups online help for information about creating
lookup codes.

To translate an OA component definition, use the OA Extension Translation toolset. Refer to
Translating Personalizations Stored in MDS in the OA Framework Personalization Guide for
detailed instructions. Although these instructions are specific to translating a personalization,
you can follow the same steps, but instead of locating and specifying a personalization
document to translate, you simply locate and specify a OA component definition to translate.

                                                                                                    247
Oracle Application Framework Developer's Guide


Code

Any other text that you display yourself, such as in exceptions or programmatically defined
beans, must be retrieved from a translated data source ( Message Dictionary, a translated
product table, or from a declaratively defined web bean whose displayed values are translated).
Never display hard-coded text strings in the UI!

Note: Oracle E-Business Suite developers using OA Framework do not use Java resource
bundles.

To retrieve a product specific message from Message Dictionary, use
OAPageContext.getMessage() as shown in the following example:



MessageToken[] tokens = { new MessageToken("PO_NUMBER", orderNumber)};

String pageHeaderText =

  pageContext.getMessage("AK", "FWK_TBX_T_PO_HEADER_TEXT", tokens);

To set a message for bundled exceptions or validation exceptions, use the
oracle.apps.fnd.framework.OAAttrValException and
oracle.apps.fnd.framework.OARowValException classes as illustrated in Error
Handling.

To display the translated text for a static styled text item, for example, simply call its getText()
method as shown. Remember to always use any web bean accessor signatures that take
OAPageContext as a parameter:



OAMessageStyledTextBean styledTextBean =


(OAMessageStyledTextBean)webBean.findIndexedChildRecursive("itemName")
;

String itemText = styledTextBean.getText(pageContext);

Tip: For information about creating messages using Message Dictionary, see the Oracle E-
Business Suite Developer's Guide. You can also refer to the Applications Release
Engineering Messages Translation Rules for additional rules regarding Message Dictionary
translation.

Timezone


248
Oracle Application Framework Developer's Guide, Release 12.1.3


With global e-business, customers from one timezone can place orders that are created in a
server in a different timezone. In this case, the time difference (encompassing both the time
zone and Daylight Saving Time) must be reconciled between the client and the server. See
Profile Options for information about the Oracle E-Business Suite client and server timezone
profile options.

OA Framework automatically reconciles this difference for you. For example, all queried date-
time values are displayed in the user's time and written in the server's time. To manually convert
values based on the client and server timezones, OALNSServices publishes a number of
methods for this purpose.

Client Character Encoding
During file upload, file download or data export, OA Framework automatically sets the file
encoding to the client character encoding defined by the profile option FND: NATIVE CLIENT
ENCODING.

Note: The value of this profile option is an Oracle character set name (for example
WE8ISO8859P1), which is not understood by Java. If you get the client character encoding
value from the FND: NATIVE CLIENT ENCODING profile using the OAPageContext
method getProfile(), the value returned may cause your Java code to throw a runtime
exception because it will not recognize the Oracle character set name. Instead, always get
the client character encoding value by calling the OANLSServices method
getJAVAClientEncoding(). This method maps the Oracle character set name to its
equivalent Java encoding name and returns a Java value that you can then supply to any
Java API that requires encoding.

Date and Time
Date and time information can be represented as a String in Java Date/Time Format, a String in
Oracle Date/Time Format, a Java Date/Time Object, or as an Oracle Date Object. You need to
know what kind of format you are dealing with, and call the right methods to convert from one
type to another. Some of the most common conversion methods are listed below; see the
OANLSServices and oracle.apps.fnd.framework.OAFwkUtils Javadoc for additional
information.

To convert a String in user specified date/time format (Oracle date/time format) to a Java
Object, use the OANLSServices methods:



public Date stringToDate(String text);

public Timestamp stringToDateTime(String text);

To convert a Java Date/Time object to a String in the user specified date/time format ( Oracle
date/time format), use the following OANLSServices methods:


                                                                                                249
Oracle Application Framework Developer's Guide




public String dateTimeToString(Date dateTime);

public String dateToString(Date date);

To convert from Oracle Date/Time Format to Java Date/Time Format, use the following
OAFwkUtils methods. Retrieve the user specified date/time format mask by calling
OANLSServices.getDateFormatMask():



public static String oracleToJavaDateFormat(String
userDateFormatMask);

public static String oracleToJavaDateFormat(String userDateFormatMask,
boolean isNumeric);

public static String oracleRRRRToJavaDateFormat(String
userDateFormatMask);

public static String oracleRRRRToJavaDateFormat(String
userDateFormatMask, Boolean isNumeric);

Note: These methods support only a subset of the Oracle formats. For unsupported Oracle
formats, the MM/dd/yyyy or mm/dd/yy Java format will be returned. Also, the conversion
between Oracle Date/Time Format and Java Date/Time Format is currently hardcoded, so
adding a new format for conversion requires an OA Framework code change. In the future,
the implementation will be changed to store conversion information in a flexible mapping
table.

Warning: There is a mismatch between the Java Date Oracle Date formats when the
month format mask is MON. In this case, the to_date function might return an error. To
avoid this, always set any WHERE clause bind variables with Date data.

The following example illustrates converting a String date to an appropriate format for use as a
WHERE clause bind variable:



initQuery(String submittedDateString)

{

    Vector parameters = new Vector(1);

  StringBuffer whereClause = new StringBuffer(100); // where clause
for ViewObjects.


250
Oracle Application Framework Developer's Guide, Release 12.1.3




  if ((submitedDateString != null) && (submitedDateString.length() !=
0))

  {

      java.sql.Date javaSqlDate =

        transaction.getOANLSServices().stringToDate(submitedDateString);

      whereClause.append("DATE_COLUMN_NAME = :1");

      parameters.addElement(javaSqlDate);

  }



setWhereClause(whereClause.toString());

Object[] params = new Object[1];

parameters.copyInto(params);

setWhereClauseParams(params);

executeQuery();

Formatting DateTime Fields

The following example illustrates changing the formatter/validator of number or date beans to
format DateTime fields without time:



OAWebBean bean = ...

OANLSServices nls = pageContext.getOANLSServices();

oracle.cabo.ui.validate.Formatter formatter =

  new OADateValidater(nls.getUserJavaDateFormat(),
nls.getUserRRRRJavaDateFormat());

bean.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter);

The following example illustrates changing the formatter/validator to format dates with time:


                                                                                                251
Oracle Application Framework Developer's Guide




OAWebBean bean = ...

OANLSServices nls = pageContext.getOANLSServices();

oracle.cabo.ui.validate.Formatter formatter =

  new OADateValidater(nls.getUserJavaDateFormat()+"HH:mm:ss",

  nls.getUserRRRRJavaDateFormat()+"HH:mm:ss");

bean.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter);

To provide a specific date format mask for date fields, use:



oracle.cabu.ui.validate.Formatter formatter =

  new OADateValidater("dd-MMM-yyyy", "dd-MMM-YY");

Note: Although the DateTime field gets formatted to not display the time, it still presents the
value in the user's timezone.

Note: Arabic and Hijrah calendars are supported as of OA Framework Release 12.1. To
provide a specific date format mask for date fields that include a calendar, specify the
desired calendar type when using OADateValidater:



oracle.cabu.ui.validate.Formatter formatter =

  new OADateValidater("dd-MMM-yyyy", "dd-MMM-YY", calendarType);

The session calendarType can be retrieved by calling OANLSServices as follows:



OANLSServices nls = pageContext.getOANLSServices();

int calendarType = svc.getCalendarType(svc.getUserCalendar());

Numbers/Currency

Numbers


252
Oracle Application Framework Developer's Guide, Release 12.1.3


When a Number is rendered as a String in the browser, OA Framework automatically formats it
based on the user's number format preference (numbers can be displayed with different
grouping size, grouping separators as well as different decimal separators (for example,. "," or
".")). If you need to perform your own conversions between Java Numbers, Oracle SQL
Numbers and Strings, you can use OANLSServices without having to worry about the user's
locale because OA Framework handles this for you.

For example, to convert a String number representation to a Java Number or an Oracle SQL
Number object, you should use the following APIs.

Warning: Do not use Java functions like Integer.parseInt() or
Double.parseDouble() because they do not take the locale related number formatting
into consideration when they do String parsing.



public Number stringToNumber(String text);

public Number stringToNumber(String text, String formatMask);

To convert a Java Number object to a String number representation use:



public String NumberToString(Number num);

public String NumberToString(Number num, String formatMask);

The following code illustrates correctly converting a Double to a String:



java.lang.Double num = new java.lang.Double(123456.7890);

String strNumber =


pageContext.getOANLSServcies().NumberToString(num,"###,###,##0.00000;-
###,###,##0.00000");

The following API's have been introduced in OANLSServices for BigDecimal data.

For converting String to java.math.BigDecimal object:



public BigDecimal stringToBigDecimal(String text);

public BigDecimal stringToBigDecimal(String text, String formatMask);

                                                                                             253
Oracle Application Framework Developer's Guide


For converting java.math.BigDecimal to a String representation



public String bigDecimalToString(BigDecimal num);

public String bigDecimalToString(BigDecimal bigDecimal, String
formatMask);

Validating Number Fields

OA Framework uses the following rules to validate number fields:

   •   The decimal and thousand separator characters must follow the preference setting
       10,000.00 or 10.000,00.
   •   When validating, the thousand separator character is ignored.
   •   The decimal separator character is validated.

Examples for a 10,000.00 preference:

   •   10,345,2 will be taken as 103452.
   •   10.32 will be taken as 10.32.
   •   10.2.3 will not pass validation.

To provide a specific number format mask for number fields, use:



oracle.cabu.ui.validate.Formatter formatter =

  new OADecimalValidater("###0.###;-###0.###","#.##0.###;-#,##0.###");

Currency

In addition to the basic number formatting, with a currency value you must also display the
correct symbol for the currency code and locate it properly in relation to the value.

To convert a Number (a Java Number or an Oracle SQL Number) to its String currency
representation, call OANLSServices.formatCurrency(Number num, String
currencyCode). To parse a String representation of a currency value to produce a Java
Number, call OANLSServices.parseCurrency(String text, String
currencyCode).

The following example shows how to properly format a currency number value:



java.lang.Double num = new java.lang.Double(123456.7890);


254
Oracle Application Framework Developer's Guide, Release 12.1.3


String currencyFormattedNumber =

  pageContext.getOANLSServcies().formatCurrency(num,"USD");

To convert a java.math.BigDecimal to its String currency representation.



public String formatCurrency(BigDecimal num, String currencyCode);

To parse a String representation of a currency value to produce a java.math.BigDecimal



public BigDecimal parseCurrencyToBigDecimal(String text, String
currencyCode);

Validating Currency Fields

OA Framework uses the following rules to validate currency fields:

   •   The decimal and thousand separator characters must follow the preference setting
       10,000.00 or 10.000,00.
   •   Validation is much stricter than for a normal number field.
   •   The number format must be in exactly the current format regarding where the thousand
       separator is placed as well as in the number of decimal points.

Examples for a 10,000.00" preference and USD currency:

   •   1,034,522 will pass the validation.
   •   1,034,52 will not pass the validation.
   •   10.3 will be taken as 10.30.
   •   10.312 will be taken as 10.31.
   •   10.2.3 will not pass validation.

Text and Component Alignment
OA Framework automatically aligns components correctly in a bi-direction session. If you
explicitly align components, always set "start" and "end" alignment; never use "right" and "left." If
you need to set this programmatically, use the OAWebBeanConstants H_ALIGN_START and
H_ALIGN_END as shown:



OACellFormatBean cell =

  (OACellFormatBean)createWebBean(pageContext,



                                                                                                 255
Oracle Application Framework Developer's Guide


                                               OAWebBeanConstants.CELL_FORMAT_BEAN,

                                               null,"exampleCell");

formatedCell.setHAlign(OAWebBeanConstants.H_ALIGN_END);

Localized Layouts
Unfortunately, OA Framework APIs do not currently provide standard web beans for common
localized layouts like name and address (this is planned for a future release). In the interim, you
must implement appropriate layouts yourself.

Calendar Support
OA Framework supports multiple calendars in date and datetime formatting and parsing. The
supported calendars are below:

   •   Gregorian Calendar (default)
   •   English Hijrah Calendar
   •   Arabic Hijrah Calendar
   •   Thai Buddihst Calendar

The date formatting and parsing are handled by OA Framework automatically based on the
user's preferred calendar.

If there is a requirement to support an additional calendar, as an exceptional case, developers
must change the existing code to take advantage of multiple calendar support.

The exception is to format or parse a date/datetime manually with an arbitrary date format.

As an example, if the following OANLSServices APIs are called in the code, developers can
consider calling new APIs.

dateToString(java.util.Date date, String formatMask)

stringToDate(String text, String formatMask)

OANLSServices has a variety of APIs to format or parse a date/datetime, and most of the APIs
are sensitive to the calendar. However, the APIs listed above always work on a Gregorian
based Calendar and this is intentional behavior.

The APIs that take a date format as an argument are calendar insensitive. This is based on
the assumption that the caller of those APIs must know the date format of the date to be parsed
or formatted, and the Gregorian calendar date/datetime would be expected in such cases.

If non-Gregorian calendars are required, where the above APIs are called, developers must
change the existing code to call one of the following new OANLSServices APIs:


256
Oracle Application Framework Developer's Guide, Release 12.1.3


dateToString(java.util.Date date, String formatMask, String
calendarName)

dateToString(java.util.Date date, String formatMask, int calendarType)

stringToDate(String text, String formatMask, String calendarName)

stringToDate(String text, String formatMask, int calendarType)

calendarName is the name of the calendar stored in the profile option.

calendarType is the integer calendar type code that is defined in
oracle.apps.fnd.i18n.text.AppsDateFormatter. Developers have to specify the
target calendar to format/parse a date/datetime with arbitrary date format.

The majority of the cases in manual date formatting/parsing can be based on the user's
preferred calendar. Developers can get the user's preferred calendar using the
getUserCalendar() API in OANLSServices.

Refer to the following code snippets to rewrite the existing API call with calendar support.

//Format/parse a date with user's preferred calendar
OANLSServices nls = pageContext.getOANLSServices();
//String formattedDate = nls.dateToString(date, formatMask);
String formattedDate = nls.dateToString(date, formatMask,
nls.getUserCalendar());
//Date parsedDate = nls.stringToDate(text, formatMask);
Date parsedDate = nls. stringToDate(text, formatMask,
nls.getUserCalendar());


Here are some sample cases where API calls might need to be replaced

Hardcoded Date String

If you are using hardcoded date strings in your logic, such as a particular date, "12-31-4712" to
indicate "does not expire", the hardcoded strings are usually based on the Gregorian calendar,
requiring attention to your OANLSServices API choice. To make a Date object from a
hardcoded Gregorian date string, you must call a calendar insensitive API such as
OANLSService.stringToDate(String dateString, String format).

Calendar Insenstive Conversion

As an example, your need to convert between OANLSServices.dateTimeToString() and
OANLSServices.StringToDateTime() and the conversion is to be done based on a Gregorian
Calendar, the API calls must be replaced as follows:

OANLSServices nls = pageContext.getOANLSServices();
// String FormattedDate = nls.dateTimeToString(dateTime)

                                                                                               257
Oracle Application Framework Developer's Guide


String FormattedDate = nls.dateToString(dateTime,
nls.getUserJavaDateFormat() + " HH:mm:ss");
// Date parsedDate = nls.stringToDateTime(dateTimeString)
Date parsedDate = nls.stringToDate(dateTimeString,
nls.getUserJavaDateFormat() + " HH:mm:ss");

Since dateTimeToString() and StringToDateTime() do not have a signature to specify
a format or a calendar, use dateToString() or stringToDate() with the session date time
format. The session date time format can be assembled from the session date format and the
constant string " HH:mm:ss". Remember to add one space character before the time format.
The session date format can be retrieved using getUserJavaDateFormat() API.

Refer to the OANLSServices javadoc for more detail of the new APIs and their calendar
sensitivity.

Character Encoding of BC4J XML Files
Character encoding of BC4J region or page definition XML files is automatically set based on
JDeveloper's environment encoding. JDeveloper's environment encoding is set based on your
operating system's locale when you launch JDeveloper for the first time (specifically when you
create your system folder).

OA Framework and the Oracle E-Business Suite Internationalization team strongly recommend
using "UTF-8" for BC4J XML file encoding. Some encodings, such as Asian native encodings,
may cause unexpected Java errors depending on the environment configuration.

Note: US-ASCII encoding and some European encodings are acceptable for use, based on the
"Basic Encoding Set" of Java-supported encoding. If you need to use encodings other than the
Java "Basic Encoding Set", please consult with the OA Framework team first.




258
Oracle Application Framework Developer's Guide, Release 12.1.3



Files in a Typical OA Framework Application
Overview
This document lists the files that comprise a typical OA Framework application and is organized
into the following categories:

   •   Workspaces and Projects
   •   Java
   •   XML
   •   Seed Data
   •   Images
   •   JSPs
   •   Style Sheets

For each file type the list indicates whether you should expect to source control and
package/ship the file in a product ARU.

Note: The instructions for source controlling and packaging/shipping apply to Oracle's internal
E-Business Suite developers.

Related Information

   •   Chapter 8: OA Framework Files / Package / Directory Standards

Workspaces and Projects

Type           Description                                            Source     Package/Ship
                                                                      Control
<Name>.jws     A JDeveloper OA Workspace XML definition               Optional Never
                                                                      *
<Name>.jpr     A JDeveloper OA Project XML definition                 Optional Never
                                                                      *
<Name>.jpx     A JDeveloper OA Project XML definition (additional     Optional Never
               file created for BC4J projects)                        *
bc4j.xcfg      JDeveloper configuration file for each BC4J project    Optional Never
                                                                      *

* Tip: Source controlling your workspaces and projects so people don't need to track down all
the files that comprise a given module makes collaborative development easier. If you do want
to source control your workspaces and projects, you should include all of the files listed here.

Java

Type                      Description                                Source      Package/Ship

                                                                                              259
Oracle Application Framework Developer's Guide


                                                                 Control
UI Controller           Java controllers associated with UI      Required Required
                        regions.
BC4J Implementations:   Java implementation for each BC4J        Required Required
                        component that you create.
   •   Application
       Module
   •   Entity Object
   •   View Object
   •   View Row

Entity Expert           A special class associated with entity   Required Required
                        objects.
Utility Classes         Any supplemental classes that you create Required Required
                        for use by other model or controller code.


XML

Type                    Description                              Source    Package/Ship
                                                                 Control
UI Definitions         XML definition for each UI component file Required Required
                       that you create. A file can include a
   •   Page            complete page definition or a shared
   •   Reusable Region region. You can also create "packages"
   •   Attribute Sets  for attribute set definitions and related UI
       Package         components (for example, all the
   •   UI Components pages/shared regions in a multistep
       Package         transaction flow).

BC4J Definitions        XML definition for each BC4J component Required Required
                        that you create.
   •   Application
       Module
   •   Association
       Object
   •   Entity Object
   •   View Object
   •   View Link

BC4J server.xml         Automatically maintained by JDeveloper Required Required
                        for each BC4J package that you create.


Seed Data



260
Oracle Application Framework Developer's Guide, Release 12.1.3


Although an OA Framework application can include any standard Oracle E-Business Suite seed
data (concurrent program definitions, attachments, flexfields, profile options, lookup types/codes
and so on) menus, messages and page flow Workflow definitions are listed separately since
they are particularly common in any OA Framework application (the menu definition is required,
and it is almost certain that you will create translatable messages).

Type                                                  Description    Source      Package/Ship
                                                                     Control
Menus (.ldt)                                          All menu       Required Required
                                                      definitions
                                                      associated
                                                      with an OA
                                                      Framework
                                                      application.
Messages (.ldt)                                       Translatable   Required Required
                                                      text strings
                                                      defined in
                                                      Message
                                                      Dictionary.
Page Flow Workflow Definitions (.wft)                 Item type for Required Required
                                                      an OA
                                                      Framework
                                                      UI page flow.
Others                                                Standard       Required Required
                                                      Oracle E-
   •     Security (Users, Responsibilities)           Business
   •     Sequential Numbers                           Suite seed
   •     Attachments                                  data as
   •     Concurrent Program Libraries, Definitions    required for
         and so on                                    any
   •     Profile Options and Values                   application.
   •     Multilanguage/Currencies/Territories
   •     Lookup Types and Lookup Codes
   •     Flexfields
   •     Functional Workflow Definitions
   •     Online Help Navigation Trees



Images
OA Framework pages can include a rich visual vocabulary. However, all images are created by
the Oracle User Interface Design and Usability team and deployed centrally in special OA
Framework Image ARUs, so individual applications do not include image files.

JSPs


                                                                                              261
Oracle Application Framework Developer's Guide


Alll OA Framework page URLs are routed through a single, central JSP (OA.jsp) which is
provided by the OA Framework. There is no need for an OA Framework application to create
additional JSPs, although external JSPs can be embedded in an OA Framework page (see
JTT/OA Framework Interoperability for additional information).

Style Sheets
All OA Framework applications use a single style sheet which is provided by the OA
Framework. Oracle's internal E-Business Suite Development teams cannot ship additional,
product-specific style sheets (you can, however, add styles to the central style sheet). See
Working with Style Sheets additional information about this.




262
Oracle Application Framework Developer's Guide, Release 12.1.3



Chapter 4: Implementing Specific UI Features
Accelerator Keys ('Hot Keys')
Overview
As described in the Oracle Browser Look and Feel (BLAF) UI Guideline: Keyboard Shortcuts [
OTN Version ], OA Framework pages provide support for two kinds of "hot keys" for quickly
performing selected actions/navigation using the keyboard:

    •    Mnemonic (Common) Accelerator Keys - centrally defined mnemonic letter and symbol
         assignments for commonly accessed buttons as shown in Figure 1 below.
    •    Numeric (Application-Specific) Accelerator Keys - numeric assignments which may be
         selectively assigned to common actions within a given application page.

Figure 1: Accelerator Keys in Common Cancel and Apply buttons.




In Windows, users exercise the accelerator keys by selecting Alt + <char> from the
keyboard.

    •    For buttons, the accelerator key "activates" the widget. For example, typing Alt + p on
         the page shown in Figure 1 selects the Apply button and submits the form.
    •    For message beans, the accelerator key sets the focus to that bean. For example, if you
         designate "2" as the numeric accelerator key for a messageTextInput, then typing
         Alt + 2 moves your cursor to that text field.
    •    Accelerator keys are automatically provided for subtabs. At runtime, users can quickly
         move focus to the next or previous subtab by selecting Alt + > and Alt + < from the
         keyboard. Selecting Enter displays the subtab contents.

Mnemonic (Common) Accelerator Keys

Declarative Implementation

The centralized list of mnemonic accelerator keys is maintained in the Keyboard Shortcuts UI
guideline, and implemented by the OA Framework team in the standard attribute sets contained
in the package /oracle/apps/fnd/attributesets/Buttons. To ensure that any
instances of buttons that you have on this list inherit the correct accelerator key value, simply
assign the button the appropriate attribute set in this package.

The following process is the easiest way to ensure that you specify the correct attribute set in
JDeveloper:


                                                                                               263
Oracle Application Framework Developer's Guide


   1. Select your button to access the Property Inspector and select the Attribute Set
      property's LOV icon.
   2. In the Attribute Set window, enter the button label that you're seeking in the Attribute
      Set field (for example, Go, Apply, Cancel and so on).
   3. Opt to perform a search in the Entire MDS XML Path.
   4. Select the Search button to find the matching attribute set in
      /oracle/apps/fnd/attributesets/Buttons. For example, Searching for "Apply"
      should return the attribute set
      /oracle/apps/fnd/attributesets/Buttons/Apply.

Tip: A Perl upgrade script is provided to help you quickly set the correct attribute sets for
preexisting code (if needed).

Runtime Control

If you need to programmatically set the prompt for a common button (there should be little or no
reason to do this), you may call the setText(String) method with an ampersand character
(&) immediately before the character to serve as an accelerator key. For example, UIX will
assign"r" as the accelerator key for the String value Sea&rch. Note that you must also explicitly
set the short description to an appropriate value by calling the setShortDesc(String). For
example, if the prompt is set to "Sea&rch", then the short description should be set to "Search"
or something similar.

Tip: The character & itself can be included in the prompt by using the value &&.

Any values that you set when calling setText or setShortDesc must be translated (you
cannot use untranslated, static Strings). Although you could obtain the values from message
dictionary for this, a better approach would be to use the values set in the corresponding
attribute sets. For example, you could reuse the prompt definition from the
/oracle/apps/fnd/attributesets/Buttons/Apply attribute set. See Programmatic
Access to Attribute Sets in Implementing the View.

Numeric (Application-Specific) Accelerator Keys
You may -- in exceptional cases where rapid navigation/action execution is essential for
frequent users -- assign numeric accelerator keys for selected items in a page.

At runtime, numeric access keys appear underlined if present in the component's prompt. If not,
UIX appends the underlined access key to the end of the prompt and encloses it in
parentheses. For example: Some Button (9).

Declarative Implementation

Step 1: Create an item with one of the following styles:

   •   button
   •   submitButton
   •   any message* style

264
Oracle Application Framework Developer's Guide, Release 12.1.3


Step 2: Set the Access Key property to a value of 0 - 9 by selecting it from the property's
poplist.

Note: Limit your access key implementation to product-specific buttons where execution speed
is absolutely essential for high-frequency users. So, for example, you don't need product-
specific button access keys in a self-service application that is likely to be used once a year.

Runtime Control

If you need to set the access key programmatically, call setAccessKey(char) on any of the
supported beans.

Warning: You MUST use a value of 0 - 9. Do not use letters as these are reserved for use by
UIX for the common accelerator keys.

Personalization Considerations
   •   None.

Known Issues
   •   None

Related Information
   •   BLAF UI Guideline(s)
          o Keyboard Shortcut [ OTN Version ]




                                                                                              265
Oracle Application Framework Developer's Guide



Attachments
Overview
As described in the Oracle Browser Look-and-Feel (BLAF) UI Guidelines: Attachments
Templates [OTN version] and Attachments Flows [OTN version], use the attachments feature to
associate a URL, file content, or text with an object, such as an expense report, contract, or
purchase order.

To enable the attachments feature, you should first understand the concept of an entity. An
entity is an object within Oracle E-Business Suite data, such as an item, an order, or an order
line. (An entity is not related to BC4J Entity Objects). The attachments feature must be enabled
for an entity before users can link attachments to the entity. In the context of attachments, an
entity can be considered either a base entity or a related entity. A base entity is the main entity
of the region. A related entity is an entity that is usually related to the region by a foreign-key
relationship.

An entity consists of a set of view attribute names (declared through your OA Extension region
items), which are the primary keys for the view object related to your region. When an
attachment is stored, the values of these primary keys and the Entity ID are stored so the
attachments can be uniquely retrieved. Several regions can access the same entity, providing a
consistent view of attachments throughout your application.

OA Framework also supports multiple entities associated with a region item, with functionality
similar to the core functionality of attachments in Oracle E-Business Suite Forms-based
functions.

For instance, a purchase order has a PO Header and PO Lines. At the line level, you can add
attachments pertaining to the entity PO_LINES. Note that you usually enter an item number in
PO Lines. When you create the item in the master Item form, you can add an attachment, such
as a picture of the item, that gets stored with a different entity, such as MTL_SYSTEM_ITEMS.
With multi-entity support, when you view the attachments for a PO Line, you can see the
attachments for both entities, that is, PO_LINES and MTL_SYSTEM_ITEMS.

Contents

   •   Attachment Styles in a Region
   •   Attachments User Interface
   •   Inline Attachments
   •   Enabling the Attachments Feature for an Entity
            o Declarative Implementation
            o Runtime Control
            o Enabling Virus Scanning
   •   Personalization Considerations
   •   Services Exposed
   •   Known Issues
   •   Related Information


266
Oracle Application Framework Developer's Guide, Release 12.1.3


Attachment Styles in a Region
When a region is attachment-enabled, a user can add, view, and delete attachments associated
with the records in that region. The attachments are generally displayed in an Attachments table
or Attachments page, although you can also display inline links of attachments in a single row
region or enable a feature that allows inline viewing and addition of attachments.

Note: You can also render an Attachments table as read-only.

There are four attachment styles that you can render in a region:

   •   Display a View List Link and Add Button in a Single Row Region
   •   Display an Attachments Table on the Page of a Single Row Region
   •   Display Inline Links of Attachments in a Single Row Region
   •   Display an Attachments Column in a Multi-Row Table Region

Display a View List Link and Attachment Icon in a Single Row Region

In the case of a single-row region, you can implement attachments by displaying a View link,
whose label you may change. In the example shown below, the default View link is overridden
by the value "Attachment List". The user may select the link to display the Attachments page or
select the Add button to display the Add Attachment page.




Display the Attachments Table on the Page of a Single Row Region

For a single-row region, you can choose to render the Attachment Table region on the product
page directly as shown in the figure below. The Attachment Table region is identical to the
Attachments Page used to launch the attachments flow.




                                                                                            267
Oracle Application Framework Developer's Guide




Display Inline Links of Attachments in a Single Row Region

For a single-row region, rather than display a View List link or an Attachments table in the
region, you may choose instead to display inline links to the first few attachments for the record
as shown in the figure below. The inline links allow users to easily view the first few attachments
without navigating from the current page and is generally used in the Workflow Notification
Details page, as described in the Oracle Browser Look-and-Feel (BLAF) UI Guidelines:
Notification Page Templates [OTN version].

Users can also view additional attachments if there are any, or perform further operation on the
attachments by selecting the More . link that follows the attachment links. The More ... link takes
the user to the Attachments page. If the attachments are not updateable, and the number of
attachments that exist is equal to or less than the number of links that are allowed to be
displayed (as set when you enable this feature), the More ... link does not appear.




If the attachment type of the inline link is File, then when you select the link, a dialog box opens
in your Browser. You can either open the file and display the content or save the file. If you
choose Save, the file is created and saved to your client machine.



268
Oracle Application Framework Developer's Guide, Release 12.1.3


If the attachment type of the inline link is Text, then when you select the link, you navigate to the
View Attachment page, where you can view the content of the text.

If the attachment type of the inline link is URL, then when you select the link, you navigate to the
destination URL.

Display an Attachments Column in a Multi-Row Table Region

You may also enable attachments in a multi-record table region by displaying an Attachment
column at the end of the table. Each row in the table that contains an attachment displays an
Attachments icon (a paperclip attached to paper), that navigates to the Attachments page when
selected, and an Add icon (a plus sign), that navigates to the Add Attachment page when
selected.

The following figure illustrates a multi-row region with an Attach column, containing Attachments
and Add icons in the table:




Attachments User Interface
The following pages or functions are available in the traditional Attachments flow:

   •   Attachments Page
   •   View Attachment Page
   •   Adding Attachments
           o Add Attachment Page
   •   Editing an Attachment
   •   Deleting an Attachment
   •   Publishing a Document to the Document Catalog

Attachments Page



                                                                                                 269
Oracle Application Framework Developer's Guide


When you select the Attachments icon in a multi-row region, the View List link in a single-row
region or the More... link that follows the inline attachment links in a single-row region, you
launch the Attachments flow by displaying the Attachments page as follows:




If the list of attachments is long, use the Hide/Show search region to list specific attachments by
description, category, last updated by and/or last updated date.

Select a File Name link to view the content of an attachment in the View Attachment page.
Select the Update icon to edit the attachment in the Update Attachment page or select the
Delete icon to delete an attachment.

Select the Add Attachments button above the table to add attachments using the Add
Attachment page. If you select the Return... link at the bottom of this page, you return to the
product page from which you launched the Attachments flow.

The Attachments page may also vary slightly depending on whether you enable the Document
Catalog when you implement attachments in a region. If you enable the Document Catalog and
the function FND_FNDATTCH_PUBTOCAT is granted to the current user, a Publish to Catalog
column appears in the Attachments page. You can select an enabled Publish to Catalog icon
for a document to publish that document to the Document Catalog.

View Attachment Page



270
Oracle Application Framework Developer's Guide, Release 12.1.3


To view the content of an attachment, select a File Name link in the first column of the table on
the Attachments page. If the attachment is a web page, you navigate to the specified URL when
you select the link. If the attachment is a file, a dialog box opens in your Browser when you
select the link. You can either open the file and display the content or save the file. If you
choose Save, a file with the content is created and saved to your client machine. If the
attachment is text, a View Attachment page appears, as shown below, displaying the text
content.




When you select the Return... link on this page, you return to the Attachments page.

Adding Attachments

Add attachments to the current record using the Add Attachment page. The Add Attachment
page varies depending on whether you enable the Document Catalog when you implement
attachments in a page. If you:

   •   Enable Document Catalog - an Add poplist control appears at the top of the Add
       Attachment page. The Add poplist displays two choices:
           o Desktop File, Text, URL - selecting this choice updates the Add Attachment
              page so you can add a file, text, or URL as an attachment.
           o From Document Catalog - selecting this choice updates the Add Attachment
              page so you can add an attachment from the Document Catalog.
   •   Disable Document Catalog - an Add poplist control does not appear at the top of the
       Add Attachment page, and you can only add a file, text, or URL as an attachment.

Add Attachment Page

When you add an attachment, you need to specify a category for the attachment. A category is
a label that users apply to individual attachments and documents. When you set up a region to
be attachment-enabled, you must assign a category for the documents that can be attached.
The Attachments page can query only those documents that are assigned to the category to
which the calling page's entity is associated. A "Miscellaneous" category is seeded to provide


                                                                                             271
Oracle Application Framework Developer's Guide


easy visibility of a document across pages. If you do not assign a category to the documents
that can be attached, the category defaults to Miscellaneous.

Adding a Desktop File, Text, or URL as an Attachment

In the Add Attachment page, select "Desktop File/ Text/ URL" from the Add poplist to add a new
attachment. Specify a title to label the attachment, a description and a category, followed by an
attachment type (File, URL, or Text) and attachment information (file name, URL, or the text
itself) for the new attachment, as shown below.

Attention: All Text attachments are added as "Short Text" type, with a maximum length of 4000
bytes. If you need to add an attachment that is longer than 4000 bytes, put the text into a text
file and add the attachment as a File.




In the Add Attachment page, you can select Cancel to cancel and return to the previous
Attachments page, select Add Another to add another attachment, or select Apply to insert the
rows into the view object and return to the Attachments page.

Note: The new attachments are not committed until a submit is performed by the associated
parent region. Clicking Apply on the Add Attachment page does not commit the changes by

272
Oracle Application Framework Developer's Guide, Release 12.1.3


default. If you want a commit to occur when clicking Apply, refer to the Runtime Control -
Committing Changes section for additional information.

Adding an Attachment from the Document Catalog

Oracle E-Business Suite keeps a catalog of documents that have been attached to applications
data records. You can use this catalog to attach an existing document to another data record,
that is, copy an attachment from another record. To add an attachment from the Document
Catalog, select "From Document Catalog" in the Add poplist of the Add Attachment page.

Use the search region to specify search criteria to locate one or more specific attachments. The
results of your search are displayed in a table. The figure below displays all attachments
currently stored in the document catalog:




The table lists the name of the document, its type, description, category, who it was last updated
by, when it was last updated, and its usage. Select the document name link to display the
document in the View Attachment page.

                                                                                              273
Oracle Application Framework Developer's Guide


The usage type indicates how the document may be used. There are three usage types:

   •   Template - the document is meant to be modified before use. When you select a
       Template usage document in the Document Catalog, a copy of the document is created
       and the document usage of the copy is set to One-Time. The copy is also updateable. If
       you delete an attachment that has a usage type of Template, the document content, as
       well as the association of the document to the record is deleted. Documents that appear
       in the Document Catalog with a usage type of Template, are created from the
       Documents Window screen in Oracle E-Business Suite. See the Oracle E-Business
       Suite User's Guide for additional information.
   •   One-time - the document is meant to be used only once. If you delete an attachment
       that has a usage type of One-time, the document content, as well as the association of
       the document to the record is deleted. All documents that you add using the Add
       Attachment page will have their usage type set to One-time.
   •   Standard - the document is a standard document that can only be referenced. When
       you select a Standard usage document in the Document Catalog, a copy of the
       document is not made. As a result, the document is not updateable. If you delete an
       attachment that has a usage type of Standard, the document content is not deleted, only
       the association of the document to the record is deleted. Documents that appear in the
       Document Catalog with a usage type of Standard, are created from the Documents
       Window screen in Oracle E-Business Suite. See the Oracle E-Business Suite User's
       Guide for additional information.

Note: You can only select Standard or Template usage types from the Document Catalog.

Once you locate the document(s) of interest, use the select checkbox to select the
attachment(s). Choose Apply to attach the document(s) to your record and return to the
Attachments page. Select Cancel to cancel and return to the Attachments page.

Editing an Attachment

In the Attachments page, you can choose the Update icon to update a particular attachment.
The Update icon displays the Update Attachment page. The figure below shows the Update
Attachment page for a Text attachment:




274
Oracle Application Framework Developer's Guide, Release 12.1.3




Note: You can only edit the information as it pertains to the attachment. You can not change the
attachment type in this page. For example, if an attachment is a web page, you can update the
URL that is associated with this attachment, but you cannot change the attachment type to a
file.

In the Update Attachment page, selecting Apply updates the necessary rows in the view object
and returns the user to the Attachments page.

Note: Changes to attachments are not committed until a submit is performed by the associated
region. Clicking Apply on the Update Attachment page does not commit the changes by default.
If you want a commit to occur when clicking Apply, refer to the Runtime Control - Committing
Changes section for additional information.

Deleting an Attachment

Choose the Delete icon to disassociate an attachment from a record. If the usage type of the
attachment is Template or One-time, a warning confirmation also appears as this action will
delete the document content.

Important: You must delete the associated attachments before deleting the base entity,
otherwise you will cause orphaned attachments. Therefore, the logic of deleting the base entity
should also include deleting the associated attachments.

Publishing a Document to the Document Catalog

                                                                                               275
Oracle Application Framework Developer's Guide


The Publish to Catalog icon is enabled in the Attachments page for any attachment that is a
One-Time usage-type document. Choose the Publish to Catalog icon to publish the document
to the document catalog so that it can be attached to other records. When you select the
Publish to Catalog icon, the following behavior occurs depending on whether the document you
select to publish is of type File, URL or Short Text:

    •    Short Text - a dialog page appears, asking you whether you want to publish the
         document to the Document Catalog as a Standard or Template usage-type document.
             o If you select Standard then choose Continue, the document is automatically
                 reset as a Standard usage-type document and is published to the Document
                 Catalog as such. A message appears above the Attachments page to confirm.
             o If you select Template, then choose Continue, a copy of the document is made
                 and the copy is published to the Document Catalog as a Template usage-type
                 document. A message appears above the Attachments page to confirm.
    •    File or URL - since File- or URL-type documents can only be published as a Standard
         usage-type, the document is automatically published to the Document Catalog as such
         and a message appears above the Attachments page to confirm this.

Note: A document is not actually published to the Document Catalog until you save (commit) all
changes to your attachments in the originating region.

Once you publish a document to the document catalog, the Publish to Catalog icon is disabled
for that document because it is no longer a One-Time usage document. You should be able to
view that published document from the Document Catalog using the Add Attachment page.

Inline Attachments
You can enable a feature called Inline Attachments that allows a user to add or view
attachments by hovering the mouse over an icon, button, or link typically used to navigate to the
Attachments user interface.

For example, by hovering over the Add icon, an Inline Add Attachments pop-up window appears
that allows you to add an attachment without navigating to the traditional Attachments User
Interface.

The Add icon:




Similarly, by hovering over the Attachments icon, an Inline View Attachments pop-up window
appears that allows you to view, update or delete attachments inline.

The Attachments icon:




The inline pop-up window appears to the bottom and right of the item that triggers the pop-up, if
there is enough browser window space. If there is insufficient space to the right, the pop-up

276
Oracle Application Framework Developer's Guide, Release 12.1.3


window renders to the left of the item. If there is insufficient space at the bottom, the pop-up
window renders to the top of the item.

Enabling Inline Attachments

Note: Inline Attachments can only be enabled if the accessibility mode is set to None using the
profile option Self Service Accessibility Features. Inline Attachments are disabled if
accessibility is set to "Screen Reader Optimized" mode or "Standard Accessibility" mode.

To enable Inline Attachments, refer to the Declarative Implementation section that describes
how to enable attachments for an entity.

Inline Attachments Support

In Oracle E-Business Suite Release 12.1.2 and above, the Inline Attachment feature is
supported on all four attachment styles and for all three attachment types (Text/ Url/ File).

The following table summarizes the support of the Inline Add Attachment pop-up window and
the Inline View Attachments pop-up window for the different attachment styles.

Attachment Item Style                                Inline Add          Inline View Attachments
                                                     Attachment
Attachments Column in a Multi-Row Table Region Supported                 Supported
(attachmentImage)
View List Link and Add Button in a Single Row        Supported           Supported
Region (attachmentLink)
Inline Links of Attachments in a Single Row          Supported           Supported
Region (messageInlineAttachment)
Attachments Table on the Page of a Single Row        Supported           Supported (for Text-type
Region (attachmentTable)                                                 attachments only)

The following table lists the events that trigger the Inline Add Attachment window and the Inline
View Attachments window to pop up for the four attachment styles. The event is fired after a
time-delay of one-second.

Attachment Item Style       Inline Add Attachment                 Inline View Attachments
attachmentImage             Mouse hover/ Focus on Add             Mouse hover/Focus on
                            (Plus) icon                           Attachment (Paper Clip) Icon
attachmentLink              Mouse hover/Focus on Add              Mouse Hover/Focus on
                            button                                Attachments List link
messageInlineAttachment Select on Add Attachment link in Mouse Hover/Focus on More...
                        the inline View Attachment pop- link
                        up
attachmentTable             Mouse hover/ Focus on Add             Mouse Hover/Focus on Title link
                            Attachment button                     of Text-type attachments only.


                                                                                                   277
Oracle Application Framework Developer's Guide


Inline Add Attachment Pop-up Window

When a user hovers over an icon, button or link that activates the Inline Add Attachment feature,
as described above, an Inline Add Attachment pop-up window appears, displaying the following:

   •   Attachment Type poplist
   •   Title text input field
   •   Category poplist

Based on the Attachment Type that a user selects, one of the following also renders:

   •   Text area
   •   Url text input field
   •   File-upload item

The default Attachment Type is Text. The figure below shows an example of an Inline Add
Attachment pop-up window with the Attachment Type set to Text.




The bottom of the Inline Add Attachment pop-up window also displays Save, Add Another and
Cancel buttons. Select the Cancel button or the Close icon to dismiss the Inline Add
Attachment pop-up window. Select the Save button to post the entered data to the middle-tier
and close the Inline Add Attachment pop-up window. Select the Add Another button to post the

278
Oracle Application Framework Developer's Guide, Release 12.1.3


data to the middle tier and refresh the pop-up window for a new entry. The refreshed Inline Add
Attachment pop-up window retains the Attachment Type last selected.

Inline View Attachments Pop-up Window

When a user hovers over an icon or link that activates the Inline View Attachments feature, as
described above, an Inline View Attachments pop-up window appears with a table displaying
the current record's attachments.

The table displays the following columns:

   •   Title
   •   Attachment Type
   •   Details
   •   Update (icon)
   •   Delete (icon)

For Text-type attachments, the Details column displays a fixed number of characters. If more
characters exist, an ellipsis (.) and a More link follows the displayed text. Select the More link to
display the complete text in a separate pop-up window.

For URL-type attachments, select the URL to render the contents of the URL in a new window.

The figure below shows an example of an Inline View Attachments pop-up window for Text-type
attachments.




                                                                                                 279
Oracle Application Framework Developer's Guide




If the attachment item is update-enabled, an enabled Update (pen) icon appears. Select the
Update icon to launch the Inline Update Attachment pop-up window. The pop-up window
displays the editable title and details of the selected attachment. Note that the attachment type
cannot be modified in this update window. Select the Cancel button or the Close icon to
dismiss the Inline Update Attachment pop-up window. Select the Update and Close button to
post the data to the middle-tier and close the Inline Update Attachment pop-up window.

The figure below shows the update attachment pop-up window.




280
Oracle Application Framework Developer's Guide, Release 12.1.3




If the attachment item is delete-enabled, an enabled Delete (trash can) icon appears. Select the
Delete icon to delete an attachment. A dialog box appears to confirm the delete action. Select
OK on the confirmation dialog to delete the attachment and re-render the Inline View
Attachments pop-up window without that attachment. If you delete the only remaining
attachment in the pop-up window, the Inline View Attachments pop-up window no longer
appears.

The Inline View Attachments pop-up window can render five attachments at a time. Use the
Next and Previous links to navigate to other attachments.

For the Message Inline Attachment Item Style

For inline links of attachments in a single row region (the messageInlineAttachment item style),
when you hover over the More... link, the Inline View Attachments pop-up window that appears
also displays an Add Attachment link as shown in the figure below. Selecting the Add
Attachment link displays the Inline Add Attachments pop-up window.




                                                                                             281
Oracle Application Framework Developer's Guide




For the Attachments Table Item Style

For an Attachments table in a single row region (the attachmentTable item style), when you
hover over a Title link for a Text-type attachment record, a pop-up window with the content of
that attachment displays. When you hover over the Update icon for an attachment record in the
table, an Inline Update Attachment pop-up displays as shown in the figure below, allowing you
to update the attachment, regardless of type.




When you hover over the Delete icon for an attachment record, a dialog box displays asking
you to confirm whether to delete the attachment.



282
Oracle Application Framework Developer's Guide, Release 12.1.3


Enabling the Attachments Feature for an Entity

Declarative Implementation

The Attachments page is rendered using standard OA Framework components. There is no
programming required to enable attachments. You simply need to define your attachment region
item and the relationship between the item and the entity via OA Extension. Be sure to follow
the OA Framework naming standards as you define your OA Extension components.

Step 1: Define the view object for your application.

Step 2: Using OA Extension, define a region that is to be attachments-enabled.

Note: Make sure your region is enclosed in a form and has a Submit button. Changes to
attachments data can only be committed with a form submit.

Step 3: Define your region items and for each region item, enter the appropriate view attribute
name defined by your view object.

Step 4: If you are enabling attachments only for the OA Framework interface, skip to Step 5.

If you are an Oracle E-Business Suite Division developer and you want to enable attachments
for both the Oracle Forms and the OA Framework interfaces, you need to specify your entity
information in the FND_DOCUMENT_ENTITIES table so that the entity can be shared by both
interfaces.

To define your Entity information in the FND_DOCUMENT_ENTITIES table, use the AK Entity
form under the AK HTML Forms responsibility in E-Business Suite:




                                                                                               283
Oracle Application Framework Developer's Guide




   a. Enter the main table name that your view object references. This is just informative for
      users. OA Framework does not actually use this piece of information.
   b. Enter the Entity ID. This is used to identify your entity and you need to reference this
      when you define your region item in OA Extension.
   c. From Step 3, enter the view attribute names for the region items that you defined in OA
      Extension that can be used as primary keys. Please note that the view attribute names
      that you enter into the Entity definition need to be able to uniquely identify a record of the
      specified entity.

Note: The E-Business Suite interface for defining entities in the AK Entities form is at:
OA.jsp?akRegionCode=AK_ENTITY_VIEW_PAGE&akRegionApplicationId=601

Note: If you want to download the entities you define in FND_DOCUMENT_ENTITIES, you need
to use FNDLOAD. The usage of FNDLOAD is as follows:

FNDLOAD logon 0 Y mode configfile datafile [ entity [ param ...] ]

where

   •    logon - username/password[@connect]
   •    mode - UPLOAD or DOWNLOAD
   •    configfile - configuration file
   •    datafile - data file
   •    entity - an entity name or - to specify all values in an upload
   •    param - a NAME=VALUE string used for parameter substitution


284
Oracle Application Framework Developer's Guide, Release 12.1.3


Step 5: If your region is a single row region, create a nested item with one of the following item
styles in OA Extension:

   •   attachmentTable - to render an Attachments table below the current region.
   •   attachmentLink - to render the View List link and Add button below the current region.
       Users need to select the View List link to display the Attachments page.
   •   messageInlineAttachment - to render a list of inline attachment links. Users can select
       the More. link to navigate to the Attachments user interface to perform further operations
       on attachments.

       Note The messageInlineAttachment item style should only be added to layout style
       containers such as messageComponentLayout, header, and so on. It should not be
       added to any table family members, such as table, advancedTable, HGrid or gantt.

If you have a multi-row table region, define a region item with the item style attachmentImage
nested in the table or in the column of an advanced table. This creates an attachment column in
the table. In the attachment column, you select the Attachment icon to display the Attachments
page or Add icon to display the Add Attachment page.

Step 6: Specify the following properties for the attachment region item you just created:

   •   ID - a unique ID for the attachment region item.
   •   View Instance - the name of the view instance for the entity you are attachment-
       enabling.
   •   Rendered - set to True.
   •   Enable Document Catalog - set to True to enable adding attachments from the
       document catalog or False to disable access to the document catalog. The default is
       True. Refer to the Attachments Page and Adding Attachments sections for further
       details.
   •   Render Search Region - set to True to render the Search region for the Attachments
       page or region. The Search region allows you to query for a specific set of attachments.

If the item style is attachmentLink, set these additional properties:

   •   Prompt - a label for the attachment region item. If this property is null, the prompt
       defaults to "Attachments".
   •   Link Text - text for the Attachment link, if you select attachmentLink as the item
       style. If this property is null, the link text defaults to "View".

If the item style is attachmentTable, set these additional properties:

   •   Text - a display name for the Attachments table.
   •   Icon URI - a gif file containing the image to display next to the Attachments table
       display name.

If the item style is messageInlineAttachment, set this additional property:

   •   Prompt - a label for the attachment region item. If this property is null, the prompt
       defaults to "Attachments".

                                                                                                285
Oracle Application Framework Developer's Guide


   •   Links Displayed - the maximum number of inline attachment links to display. The
       default is 5.

If the item style is attachmentImage, set this additional property:

   •   Prompt - a label for the attachment column. If this property is null, the prompt defaults to
       "Attachments".

Step 7: By default, changes made to the Attachments table or page are saved (committed) only
when a user selects the Apply button on the base page from which Attachments is launched.
See the Runtime Control section.

If you want changes to the Attachments table or page to commit automatically, without requiring
a user to select Apply in the base page, you can turn on "auto-commit" by setting the
Automatic Save property to True for the attachmentLink, attachmentTable, or
attachmentImage item.

With "auto-commit" turned on, each action ("Add", "Update", "Detach") performed by the user in
the Attachments table or page is automatically committed.

Step 8: In the Structure pane, select the default entityMap that is created under the attachment
region item you just created in the previous step. Select the entityMap in the Structure pane. In
the OA Extension Property Inspector, enter a unique ID for the entity map and one of the
following values for the Entity property:

   •   If you performed Step 4 and defined an entity in the AK Entity form to share between
       the Oracle Forms and OA Framework interfaces, specify the Entity ID you defined in the
       AK Entity form.
   •   If you skipped Step 4 because you are enabling attachments only to be viewed from the
       OA Framework interface, enter a unique arbitrary value for Entity. Select the Entity Map
       named child in the Structure pane. Under New in the context menu, select primaryKeys
       to create a primary key named child for the entity map. Select the primaryKey named
       child in the Structure pane. Enter a view attribute name for the primary key in the OA
       Extension Property Inspector.

Note Many regions can share an entity; in fact, if you want the same attachment(s) to be
viewable from different regions, those regions must share the same entity. In addition, the
attachment region items of those different regions must have the same view attribute name and
reference the same view instance.

Step 9: If you want to make the Attachments table or page read-only, so that it does not display
the Update and Detach columns, select the Entity Map named child for the attachment region
item in the OA Extension Structure pane. Set the Insert Allowed, Update Allowed, and
Delete Allowed properties in the Property Inspector to False. Set any combination of these
properties to False to better control the level of change you want users to have in the
Attachments table or page.

Note: The OA Framework
oracle.apps.fnd.framework.webui.beans.layout.OAAttachmentTableBean

286
Oracle Application Framework Developer's Guide, Release 12.1.3


setUpdateable(boolean updateable) method (which is specified by setUpdateable in
interface oracle.apps.fnd.framework.webui.beans.OAWebBeanAttachment), to
make an Attachments table read-only, has been deprecated. Use the
oracle.apps.fnd.framework.webui.beans.OAAttachmentImageBean
setEntityMappings(Dictionary[] entityMaps) method instead if you need to
maintain backwards compatibility.

Step 10: Create a category map to specify the category of documents that can be associated
with an attachment. Document categories provide security by restricting the documents that can
be viewed, added or deleted as an attachment. In the Structure pane, select the entity map you
just defined. Select New > categoryMap from the context menu to create a Category Map
named child.

Step 11: Select the new categoryMap entity in the Structure pane. In the Property Inspector,
specify values for the following properties:

   •   ID - specify a unique ID for the category map.
   •   Category - specify the document category that can be associated with the attachments.
       Note that the value of Category must be a predefined Name (internal name, rather than
       display name) from the FND_DOCUMENT_CATEGORIES table, such as MISC.
   •   Secure - specify True to secure the category using Application Security. By securing a
       category, the documents of that category will only be accessible to users based on the
       security rules defined in Oracle E-Business Suite. To secure a category, please refer to
       the Securing Attachment Categories section for additional information. By default,
       Secure is set to False for backwards compatibility.

Once you define a categoryMap and if the showAll property on the entityMap is set to false,
then only the attachments that are assigned with the same category as specified in your
categoryMap(s) can be queried or added from the Attachments page.

Note: A property called setDefaultMiscCategoryEnabled creates a default category map
and sets the category to MISC, if one is not already defined. As a result, if the showAll
property on the entityMap is set to False and you do not define a category map for the entity,
OA Framework creates a default category map for the entity and sets the category to MISC. If
the showAll property is set to True, however, it disregards the category maps, as all
categories are available.

If you change the setDefaultMiscCategoryEnabled property to False, and you do not
create a category map before running your attachment-enabled page or the category map has
only one category defined, the Category poplist does not display in the Search region of the
Attachments table or in the Add Attachment page.

This property is set by default to True. To change the value of this property to False, you
must use the following API:



attachBean.setDefaultMiscCategoryEnabled(false);


                                                                                               287
Oracle Application Framework Developer's Guide


Step 12: To enable the Inline Attachments feature, set the profile option FND: Disable Inline
Attachments to false at the Site or Application level. The default value at the Site level is false.

You can also set the Inline Attachment Enabled property of your attachment region item
to enable or disable the Inline Attachments feature for that particular attachment item. Valid
values for the Inline Attachment Enabled property are true, false, or default, where
default means to default to the value set in the FND: Disable Inline Attachments profile option.
Users may also personalize the Inline Attachment Enabled property at runtime. The
following table illustrates Inline Attachments behavior for the different combination of values set
for the profile option and the attachment item property:

Value of Inline Attachment               Value of 'FND: Disable Inline             Inline
Enabled property                         Attachments' profile                      Attachment
true                                     any value                                 active
false                                    any value                                 inactive
default                                  true                                      inactive
default                                  false                                     active

You may also set these attachment region item properties to control the behavior of the Inline
Attachments feature:

   •      Update Enabled - set to true to enable the Update icon in the Inline View
          Attachments pop-up window.
   •      Delete Enabled - set to true to enable the Delete icon in the Inline View Attachments
          pop-up window.

Securing Attachment Categories

As mentioned above, you can now set the secure property on a category map to True to
ensure that the category is secured by Application Security. Oracle E-Business Suite provides a
seeded 'category' object, along with permissions and permission sets that define the actions
(functions) that can be performed on the seeded object. You can then use the seeded object
and permission sets to define the security rules for the secured category.

The following object is seeded by Oracle E-Business Suite to enforce data security on
attachment categories:



OBJ_NAME = FND_DOCUMENT_CATEGORIES

DATABASE_OBJECT_NAME = FND_DOCUMENT_CATEGORIES

PK1_COLUMN_NAME = NAME

The following permissions (functions) are seeded by Oracle E-Business Suite to define the
securable actions on attachment categories:

288
Oracle Application Framework Developer's Guide, Release 12.1.3




FND_FORM_FUNCTIONS

  FUNCTION_NAME = "FND_ATTACHMENT_VIEW"

  OBJECT_ID = "FND_DOCUMENT_CATEGORIES"

  TYPE = "SUBFUNCTION"



  FUNCTION_NAME = "FND_ATTACHMENT_CREATE"

  OBJECT_ID = "FND_DOCUMENT_CATEGORIES"

  TYPE = "SUBFUNCTION"



  FUNCTION_NAME = "FND_ATTACHMENT_UPDATE"

  OBJECT_ID = "FND_DOCUMENT_CATEGORIES"

  TYPE = "SUBFUNCTION"



  FUNCTION_NAME = "FND_ATTACHMENT_DELETE"

  OBJECT_ID = "FND_DOCUMENT_CATEGORIES"

  TYPE = "SUBFUNCTION"

The following three permission sets are seeded by Oracle E-Business Suite to specify the
combination of permissions (functions) necessary to perform a particular role on an object
instance. You may add additional permission sets if other combinations of functions are
required.



MENU_NAME = 'FND_ATTACHMENT_FULL_ACCESS'

  FUNCTION_NAME = 'FND_ATTACHMENT_VIEW'

  FUNCTION_NAME = 'FND_ATTACHMENT_CREATE'

  FUNCTION_NAME = 'FND_ATTACHMENT_UPDATE'


                                                                                             289
Oracle Application Framework Developer's Guide


  FUNCTION_NAME = 'FND_ATTACHMENT_DELETE'



MENU_NAME = 'FND_ATTACHMENT_VIEW'

  FUNCTION_NAME = 'FND_ATTACHMENT_VIEW'



MENU_NAME = 'FND_ATTACHMENT_NO_DELETE'

  FUNCTION_NAME = 'FND_ATTACHMENT_VIEW'

  FUNCTION_NAME = 'FND_ATTACHMENT_CREATE'

  FUNCTION_NAME = 'FND_ATTACHMENT_UPDATE'

Using the seeded object and permission sets, define one or more grants to define the rules to
secure your attachment category. Please refer to the online help for the Grants page in the
Functional Administrator responsibility, as well as the Oracle E-Business Suite System
Administrator's Guide - Security for information on how to define a grant. The section on
Application Security in Chapter 3: Menus and Page Security also discusses grants and
permissions in more detail.

The following example illustrates two grants that you can create to access the secured
attachment category called "To Approver":



FND_GRANTS

  GRANTEE_TYPE = GROUP

  GRANTEE_KEY = MANAGER_ROLE

  MENU_NAME = FND_ATTACHMENT_FULL_ACCESS

  OBJECT_ID = FND_DOCUMENT_CATEGORIES

  INSTANCE_TYPE = INSTANCE

  INSTANCE_SET_ID = NULL

  INSTANCE_PK1_VALUE = TO_APPROVER

  CTX_SECGRP_ID = -1

  CTX_RESP_ID = -1

290
Oracle Application Framework Developer's Guide, Release 12.1.3


     CTX_RESP_APPL_ID = -1

     CTX_ORG_ID = -1




FND_GRANTS

     GRANTEE_TYPE = GROUP

     GRANTEE_KEY = EMPLOYEE_ROLE

     MENU_NAME = FND_ATTACHMENT_VIEW

     OBJECT_ID = FND_DOCUMENT_CATEGORIES

     INSTANCE_TYPE = INSTANCE

     INSTANCE_SET_ID = NULL

     INSTANCE_PK1_VALUE = TO_APPROVER

     CTX_SECGRP_ID = -1

     CTX_RESP_ID = -1

     CTX_RESP_APPL_ID = -1

     CTX_ORG_ID = -1

This example shows that users who sign on as MANAGER_ROLE can view, create, update and
delete attachments of category "To Approver", whereas users who sign on as
EMPLOYEE_ROLE can only view attachments of category "To Approver".

Note: You can use the setCategoryMapsForAddAndUpdate method to override the
behavior of this particular example.

Now suppose you have a Requisition Header (ID 100) and it has three attachments as shown in
the table below. In OA Extension, the meta data for this Requisition Header attachment item
contains two categoryMaps, called "MISC" and "To Approver" and categoryMap "To Approver"
is secured.

         Attachment ID                Category ID                 Category Name
11                             1                          MISC
12                             33                         To Approver


                                                                                       291
Oracle Application Framework Developer's Guide


13                              33                         To Approver

If User A signs on as MANAGER_ROLE, User A would see and have full access to the three
attachments indicated in the table above. If User B signs on as EMPLOYEE_ROLE, User B
would also see the three attachments above, but would only be able to view and not create,
update or delete attachments associated with the "To Approver" category.

If no grant is defined for EMPLOYEE_ROLE, then if User B signs on as EMPLOYEE_ROLE,
User B would only see the one attachment associated with the MISC category.

Granting Access to Custom Categories

If you define your own custom categories, you may want to grant access for MANAGER_ROLE
to all these custom categories instead of creating a separate grant for each newly defined
category. The most convenient way to achieve this by having your System Administrator create
an object instance set definition.

Since only a seeded user would have a User ID less than or equal to 2, seeded categories in
the FND_DOCUMENT_CATEGORIES table would also have a value in the CREATED_BY
column that is less than or equal to 2. Therefore, all custom categories have a CREATED_BY
value larger than 2:



FND_OBJECT_INSTANCE_SETS_VL

     INSTANCE_SET_NAME = "OA_DOC_CATEGORY_CUSTOM"

     OBJECT_ID = "FND_DOCUMENT_CATEGORIES"

     PREDICATE = "&TABLE_ALIAS.CREATED_BY > 2"



FND_GRANTS

     GRANTEE_TYPE = GROUP

     GRANTEE_KEY = MANAGER_ROLE

     MENU_NAME = FND_ATTACHMENT_FULL_ACCESS

     OBJECT_ID = FND_DOCUMENT_CATEGORIES

     INSTANCE_TYPE = SET

     INSTANCE_SET_ID = OA_DOC_CATEGORY_CUSTOM

     INSTANCE_PK1_VALUE = NULL

292
Oracle Application Framework Developer's Guide, Release 12.1.3


  CTX_SECGRP_ID = -1

  CTX_RESP_ID = -1

  CTX_RESP_APPL_ID = -1

  CTX_ORG_ID = -1

With this definition, MANAGER_ROLE would have full access to attachments of all custom
categories.

Runtime Control

In general, there are no runtime control steps necessary to enable attachments for an entity.
However, you can refer to the following sections for instructions on additional programmatic
changes you can make to attachments:

   •   Secure Attachment Documents to a Particular Context
   •   Secure Categories
   •   Get a Handle to an Attachment Event
   •   Control When to Commit Changes
   •   Create or Update an Attachment

Securing Documents to a Particular Context

To secure your attachment documents with a particular context, such as organization, set of
books, or business unit, you can do so using these two APIs in the
oracle.apps.fnd.framework.webui.beans.OAWebBeanAttachment interface:

   •   setSecurityType(int securityType)
   •   setSecurityId(int securityId)

Typically, attachments in financial applications are secured by sets of books, attachments in
manufacturing applications are secured by organization, and attachments in human resource
applications are secured by business unit ID.

The following example illustrates how to use these APIs to secure documents by organization
ABC. This should be included in the controller code for the page that launches the Attachments
feature:



attachmentBean.setSecurityType(1);

// security type 1 = Organization, 2 = Sets of Books,

// 3 = Business Unit, and -1 = No security type



                                                                                                293
Oracle Application Framework Developer's Guide


attachmentBean.setSecurityId(123);

// org id: 123 = company "ABC"

As a result of the above code, when a user creates an attachment for the application page, the
document is automatically secured to organization ABC. The Attachments UI displays
documents that have this security context, as well as documents that are not secured.

If you do not set a security context when you enable the Attachments feature for a page, the
attachment documents that get created will have a security type of "None" and can be shared
across different security context.

Securing Categories

If you need to secure an attachment category programmatically, you can use the
setCategorySecured method on OAAttachmentImageBean, OAAttachmentTableBean,
OAMessageAttachmentLinkBean, or OAMessageInlineAttachmentBean.

Getting a Handle to an Attachment Event

If you want to get a handle on an attachment event so that you can add custom logic before
leaving the base page, you can do so by checking for the return of any of the following
OAWebBeanConstants from UIConstants.EVENT_PARAM:

    •   OA_ADD_ATTACHMENT - returned when the Add Attachment button is pressed from
        attachment table or when Add icon/button is pressed from
        attachmentImage/attachmentLink style.
    •   OA_UPDATE_ATTACHMENT - returned when the Update attachment icon is pressed from
        attachment table.
    •   OA_DELETE_ATTACHMENT - returned when the Delete attachment icon is pressed from
        attachment table
    •   OA_VIEW_ATTACHMENT - returned when the link for viewing attachment is pressed from
        attachment table
    •   OA_GOTO_ATTACHMENTS - returned when navigating to Attachments page from the
        base page. Valid for attachmentImage, attachmentLink, and messageInlineAttachment
        styles only.

For example, the following code in the processFormRequest method of the controller, checks
if the Add Attachment button has been selected:



String eventName = pageContext.getParameter(EVENT_NAME);

// Check if Add attachment button is clicked

if ( OA_ADD_ATTACHMENT.equals(eventName) )

{

294
Oracle Application Framework Developer's Guide, Release 12.1.3


// product team's special handling code

}

Committing Changes

By default, changes made to the Attachments table or page are saved (committed) only when a
user selects the Apply button on the product page from which the Attachments flow is launched.
The Automatic Save property on the attachment web bean is set to False in this case. This
means that in the processFormRequest method of the controller object, you need to capture
the event of this submit button and call commit() explicitly.

If you want changes to the Attachments table or page to commit automatically, without requiring
a user to select Apply in the base product page, you can turn on "auto-commit" by setting the
Automatic Save property on the attachment web bean to True.

With "auto-commit" turned on, each action ("Add", "Update", "Delete") performed by the user in
the Attachments table or page is automatically committed.

Create or Update an Attachment

As of Release 12.1.3, you can programmatically create or update an attachment using these
oracle.apps.fnd.framework.server.OAAttachmentServerUtils APIs:

    •




        createAttachment(String input, String[] pkValues, String
        categoryName,

           String entityId,String contentType, BlobDomain fileContent,
        String title,

           String description, OAApplicationModule am, String
        automaticallyAddedFlag,

           String attachmentType)

    •




        updateAttachment(String input, String[] pkValues,String
        categoryName,

           String entityId, String contentType,BlobDomain fileContent,


                                                                                            295
Oracle Application Framework Developer's Guide


        String title,

           String description, OAApplicationModule am, String
        automaticallyAddedFlag,

             String attachmentType, long attachmentDocumentId)

Enabling Virus Scanning

This feature scans a file type attachment before uploading. To enable virus scanning, the Virus
Scan Enabled property should be set to true in the design time for the attachmentLink,
attachmentTable, or attachmentImage item.

Runtime control is also supported.

The processRequest of the controller class should have the following code:
attachBean.setVirusScanEnabled(true); where attachBean is the bean corresponding
to the attachmentLink, attachmentTable, or attachmentImage item.

In addition to the above design time or runtime settings, the following profiles need to be set
appropriately:

    •   FND_ANTIVIRUS_SOFTWARE: Specifies the name of the anti-virus software. Currently
        only Symantec anti-virus software is supported.
        The valid values are NONE and SYMANTEC.
        If this profile has not been set then the normal uploading of file attachment will take
        place without any scanning for viruses.
    •   FND_ANTIVIRUS_SERVER: Specifies the server address where the anti-virus software
        is running.

If FND_ANTIVIRUS_SOFTWARE is set properly but FND_ANTIVIRUS_SERVER is not set or
has some invalid value then an error message will be thrown and file will not be uploaded.

If a virus is detected in the file then anti-virus software tries to repair the file. If the file is repaired
then the repaired file is uploaded else an error message is displayed about the virus infected file
and the file is not uploaded.

Personalization Considerations
See a summary of Attachments personalization considerations in the Oracle Application
Framework Personalization Guide.

Services Exposed

Bulk Upload - Overview



296
Oracle Application Framework Developer's Guide, Release 12.1.3


The OAAttachmentsService is developed using the 12.1 Business Service Object infrastructure.
This allows users to upload attachments in bulk. This service can be searched for from the
Integration Repository, which contains WSDL documents for all EBS services. Please refer to
the"Introduction to SOA and Services" section for an overview of the SOA concepts.

Service Description

Name -OAAttachmentsService.
Note: This is the name to be used to search for the service in the Integration Repository.

This service exposes the processDataSource service API for adding attachments in bulk. To
know more about this, please look at the Invoking Bulk Upload Operation section in this
document.

Methods - processDataSource.

Service Data Objects - FndAttachBulkUploadVO

Methods

processDataSource

This method performs the Bulk Upload operation and attaches uploaded data with specified
business entities. User needs to invoke this method by passing appropriate parameters as
mentioned in the table below.

Parameters

Parameter Name                      DataType                      Description
dataSourceName                      java.lang.String              The name of the data source
                                                                  to process. In this case, the
                                                                  value for this should be
                                                                  "FndAttachBulkUploadVO".
operation                           java.lang.String              The operation to perform. Can
                                                                  be one of the following:
                                                                  "Create" or "Merge".
oaattachmentsprocessControl         /oracle/svc/ProcessControl    control the post control object
ServiceRoot                         /oracle/svc/DataObject        The root data object containing
                                                                  a list of data objects to be
                                                                  processed.

Return Type

oracle.svc.DataObject

Note: This is an object of type oracle.svc.DataObject whose qualified name is
OAAttachmentServiceRoot which has APIs to get the list of the service data objects returned by
the service method.

                                                                                              297
Oracle Application Framework Developer's Guide


This operation will return oracle.svc.DataObject instance which contains the list of service data
objects of type 'FndAttachBulkUploadVO'.
The bulk upload status can be verified by getting the value of the service data object present in
the returned DataObject. For successful attachments it lists the attachment id and for invalid
records it lists appropriate error messages.

Service Data Objects

Following Service Data Objects are available in this service:

FndAttachBulkUploadVO

This is the Service Data Object that contains the attributes that need to be input by the user to
upload the attachments corresponding to the business entity. The fileContent from this data
source will be attached to the specified business entities.

Attributes

Attribute Name Data Type                                Description
fileName          java.lang.String                      The name of the file to be uploaded.
                                                        Please note this is a mandatory field.
contentType       java.lang.String                      The type of file content viz. text/html,
                                                        image, icon etc This is MIME type and
                                                        can contain any valid MIME entry.
fileContent       oracle.jbo.domain.BlobDomain          The content of the file.
pk1_Value         java.lang.String                      Primary key1 value.
Pk2_Value         java.lang.String                      Optional primary key2 value.
Pk3_Value         java.lang.String                      Optional primary key3 value.
Pk4_Value         java.lang.String                      Optional primary key4 value.
Pk5_Value         java.lang.String                      Optional primary key5 value.
categoryName      java.lang.String                      The name of the category. This should
                                                        be a valid value of Category ID from the
                                                        FND_DOCUMENT_CATEGORIES
                                                        table.
entityId          java.lang.String                      The id of the entity to which the
                                                        document will be attached.
description       java.lang.String                      Optional description of the attachment.
status            java.lang.String                      The status of the upload operation for
                                                        the current object.
                                                        For successful attachments it lists the
                                                        attachment id and for invalid records it
                                                        lists appropriate error messages.
                                                        This is used only for the output operation
                                                        and users need to ignore this attribute
                                                        while invoking the service


298
Oracle Application Framework Developer's Guide, Release 12.1.3


Related Documents

Search services in Integration Repository
Service Interface in integration repository
Invoking service from BPEL
Web services and Function Security
Business Service Objects (BSO)

Known Issues
   •   The Inline Attachments feature is disabled in Screen Reader Accessibility modes.
   •   There is no BIDI support for the Inline Attachments feature.

Related Information
   •   BLAF UI Guideline
          o Attachments Templates [OTN version]
          o Attachments Flows [OTN version]
   •   Javadoc File
          o oracle.apps.fnd.framework.webui.beans.layout.OAAttachmentTa
              bleBean
          o oracle.apps.fnd.framework.webui.beans.OAAttachmentImageBean
          o oracle.apps.fnd.framework.webui.beans.message.OAMessageAtta
              chmentLinkBean
          o oracle.apps.fnd.framework.webui.beans.message.OAMessageInli
              neAttachmentBean
          o oracle.apps.fnd.framework.webui.beans.OAWebBeanAttachment
          o oracle.apps.fnd.framework.webui.OAWebBeanConstants
          o oracle.apps.fnd.framework.server.OAAttachmentServerUtils
   •   Lesson
   •   Sample Code




                                                                                          299
Oracle Application Framework Developer's Guide



Auto-Repeating Layout (ARL)
Overview
You can auto-repeat the layout of children web beans in a container, based on the rows in a
view object by using a process called Child View Usage. The process attaches a data source
(view object) to a container web bean, which then replicates its children web beans based on
the number of data objects or rows in the source. Each replica of the container's children
reflects a different row in the data source, similar to what you see when you render a table or
advanced table web bean.

Contents

   •   Auto-Repeating Layout Variations
   •   Usage Restrictions
   •   Declarative Implementation
          o Creating a One-Level Auto-Repeating Layout
          o Creating a Two-Level Auto-Repeating Layout
   •   Runtime Control
   •   Personalization Considerations
   •   Known Issues
   •   Related Information

Auto-Repeating Layout Variations
You can implement an auto-repeating layout in one or two levels:

   •   One Level - you create a container web bean and attach a view object to it, which
       results in the replication of the container children based on the rows in the view object.
   •   Two Levels - you create a master-detail relationship between two lists and create a view
       link to join them. The outer list replicates its container children based on the master view
       object and the inner list replicates its container children based on the detail view object.

You can also implement an auto-repeating layout as a display-only list or as a list with Form
Elements:

   •   Read Only - a read-only auto-repeating layout can be based on a single view object or a
       single view link. In the case of a single view object, a one level list of children are
       replicated. In the case of a single view link, a composite list results, where a different
       inner list is created for each current master record.
   •   Form Element - an auto-repeating layout with form elements can be based only on a
       single view object. A layout with form elements allows you to update any row and submit
       your changes to update the underlying view object.

Usage Restrictions
   •   You cannot implement an auto-repeating layout in the following container regions:

300
Oracle Application Framework Developer's Guide, Release 12.1.3


           o   Table
           o   Advanced Table
           o   Hide/Show
           o   Switcher
           o   HGrid
           o   SubTabLayout
   •   You cannot replicate the above container regions indirectly. For example, you cannot
       create a header region, add a Table region beneath it, and expect to replicate the
       header region (and the underlying Table region). This is not supported.
   •   You cannot implement a two-level auto-repeating layout with a list containing Form
       Elements.
   •   OA Framework does not support view objects (for the Child View Usage) with composite
       primary keys. The view object should have a single-column primary key.
   •   LOV's are not supported in Auto Repeating Layouts (ARLs).
   •   The items under an Auto Repeating Layout should not be made hidden/rendered on a
       Partial Page Refresh (PPR) event.
       If such a scenario exists, on a PPR event, the page should be re-rendered by calling
       pageContext.setForwardURL().
       This will ensure the items under Auto Repeating Layout are rendered with correct bean
       Ids.

Declarative Implementation
This section describes how to declaratively implement an auto-repeating layout for your page.

Creating a One-Level Auto-Repeating Layout

Step 1: In your project, create an application module for your auto-repeating layout, if you
don't yet have one for your page.

Step 2: Create a view object for your auto-repeating layout and add it to your application
module. For example, you can create the following BC4J setup:

   •   Create an application module.
   •   Create a view object based on the Dept table, called DeptVO.
   •   DeptVO has the primary key 'Deptno'.

Step 3: Define a page in OA Extension, and create a pageLayout region beneath it. Set the AM
Definition property on the pageLayout region to the application module you created in Step
1.

Step 4: Create a container region and the children that you want as your auto-repeating layout.
Select, in the Structure pane, the container region. For example, suppose you create a header
region, with a rowLayout region that contains a messageTextInput item and a submitButton item
beneath it and you want the messageTextInput and submitButton web beans to auto-repeat for
all the rows returned from an view object. In this case, you would select the rowLayout region.

Step 5: For the selected container region, set the Child View Instance property to the
name of the view object you created in Step 2 and the Child View Attribute property to

                                                                                               301
Oracle Application Framework Developer's Guide


an attribute in the view object that uniquely identifies a row (the primary key). Based on the
BC4J example in Step 2, you would set the Child View Instance property to DeptVO and
the Child View Attribute property to Deptno.

Note In case a view object does not have a primary key, you can use RowId as the Child
View Attribute.

Creating a Two-Level Auto-Repeating Layout

Step 1: In your project, create an application module for your auto-repeating layout, if you
don't yet have one for your page.

Step 2: Create a view object for your master list, a view object for your detail list and a view
link between these two view objects. Add these view objects and view link to your application
module. For example, you can create the following BC4J setup:

   •   Create an application module.
   •   Create a view object based on the Dept table, called DeptVO.
   •   DeptVO has the primary key 'Deptno'.
   •   Create a view object based on the Emp table, called EmpVO.
   •   Create a view link between DeptVO and EmpVO, called DeptEmpVL.
   •   Add the above view objects and view link to the application module.

Step 3: Define a page in OA Extension, and create a pageLayout region beneath it. Set the AM
Definition property on the pageLayout region to the application module you created in Step
1.

Step 4: Create the outer container region and its children, and the inner container region and its
children, that you want to use for your two-level auto-repeating layout.

Step 5: Select, in the OA Extension Structure pane, the outer container region and set the
following properties:

   •   Child View Instance - set to the name of the view object you created in Step 2 for
       the outer list.
   •   Child View Attribute - set to an attribute in the outer view object that uniquely
       identifies a row (the primary key).
   •   View Link Instance - set to the view link defined between the inner and outer view
       objects.

Based on the example in Step 2, you would set the Child View Instance to DeptVO, the
Child View Attribute to Deptno, and the View Link Instance to DeptEmpVL.

Note In case a view object does not have a primary key, you can use RowId as the Child
View Attribute.

Step 6: Select, in the OA Extension Structure pane, the inner container region and set the
following properties:

302
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   Child View Instance - set to the name of the view object you created in Step 2 for
       the inner list.
   •   Child View Attribute - set to an attribute in the inner view object that uniquely
       identifies a row (the primary key).
   •   View Link Instance - set to the view link defined between the inner and outer view
       objects.

Based on the example in Step 2, you would set the Child View Instance to EmpVO, the
Child View Attribute to Deptno, and the View Link Instance to DeptEmpVL.

Note In case a view object does not have a primary key, you can use RowId as the Child
View Attribute.

Runtime Control
There are no programmatic steps required for implementing an auto-repeating layout region.

The child view usage set on the container web beans is automatically queried when the page
renders. If you wish to turn off auto-execution of the query, set the
oracle.apps.fnd.framework.webui.OAWebBeanConstants attribute,
CHILD_VIEW_AUTO_QUERY_ATTR, to Boolean.FALSE, as illustrated in the following code
example:



containerBean.setAttributeValue(

  OAWebBeanConstants.CHILD_VIEW_AUTO_QUERY_ATTR, Boolean.FALSE)

Personalization Considerations
See a summary of Auto-Repeating Layout personalization considerations in the Oracle
Application Framework Personalization Guide.

Known Issues
   •   None

Related Information
   •   BLAF UI Guideline
   •   Javadoc File
          o oracle.apps.fnd.framework.webui.OAWebBeanConstants
   •   Lesson
   •   Sample Code



                                                                                             303
Oracle Application Framework Developer's Guide




304
Oracle Application Framework Developer's Guide, Release 12.1.3



BI Publisher Integration - Printing A Report
From Within an OA Framework Page
Overview
Business Intelligence (BI) Publisher integration allows you to print a BI Publisher report from
within an OA Framework page.

Declarative Implementation

Perform the following steps to implement printing of a BI Publisher report from within an OA
Framework page:

   1. In Oracle JDeveloper OA Extension, create a new item of style Button under the desired
      region of an OA Framework page.
   2. Provide a suitable prompt for the button.
   3. Set the Destination URL property of the button to point to the BI Publisher page
      using the following format:




       OA.jsp?OAFunc=DGF_PRINT_OPTIONS&biamdef=<AM_NAME>&p_form_code=<fo
       rm_code>&p_block_code=<block_code>&retainAM=Y

       The value of biamdef should be a fully qualified Application Module (AM) name, such
       as oracle.apps.fnd.toolbox.server.LabSolutionsAM.

       The p_form_code and p_block_code values should be registered through the
       Document Generation Framework UI.

Personalization Considerations
   •   None, although you can also print BI Publisher reports via Personalizations.

Known Issues
   •   None

Related Information
   •   BLAF UI Guideline(s)
   •   Javadoc File(s)
   •   Lesson(s)
   •   Sample Code

                                                                                                  305
Oracle Application Framework Developer's Guide




306
Oracle Application Framework Developer's Guide, Release 12.1.3



Bound Values
Overview
Data binding allows you to map data from UIX web beans to BC4J components and back,
bridging the gap between the two so you can create HTML pages that generate dynamic
content for each user. As mentioned in the Anatomy of an OA Framework Page, OA Framework
web bean attributes are implemented as data bound values, so that the underlying data source
(BC4J) is not resolved to the component (by the UIX framework) until rendering time. OA
Framework uses UIX's oracle.cabo.ui.data.BoundValue,
oracle.cabo.ui.data.DataObject and oracle.cabo.ui.data.DataObjectList
interfaces to perform data binding at runtime.

A table content Switcher, on the other hand, is a region with two or more display alternatives.
The display alternatives are predefined items of which only one is selectively rendered at any
given time.

Bound Values versus Table Content Switchers

You should limit your use of Switchers to within tables, particularly when you want to switch
between different kinds of web beans, such as a poplist or a checkbox. When you have only
one type of web bean, but the value of an attribute on that web bean varies at runtime, then you
should implement that attribute as a bound value rather than as a Switcher.

There are exceptions to this, however, as demonstrated in the ToolBox Tutorial Delete Lab. The
tutorial example creates an employee table that contains a Delete column. The Delete column
allows you to delete employees from the table, depending on the status of the employee - if the
employee is active, the Delete icon is enabled, otherwise it is disabled. However, to meet the
standards of 508, alternate text (alt text) is associated with the enabled icon, as well as the
disabled icon. At runtime, to be able to display the enabled Delete icon, with its alt text, or the
disabled Delete icon with its appropriate alt text, the tutorial uses the convenience of a table
content Switcher to switch between the two distinct sets of attribute values for the same web
bean type.

If you were to use bound values instead of a Switcher in this case, you would bind the image
source of the Delete icon to a view object attribute to get the image file name, and bind the alt
text to another view object attribute to get the alt text for the image.

Note Although you can use a table content switcher outside a table, UIX discourages this.
Instead you should bind the Rendered property of the indexed child when possible.

Contents

   •   Bound Values
          o Why Use Bound Values?
          o Data Binding in OA Framework
          o Data Binding for Fields Outside a Table
          o Data Binding for Fields in a Table

                                                                                                307
Oracle Application Framework Developer's Guide


    •    Declarative Implementation
    •    Runtime Control
    •    Personalization Considerations
    •    Known Issues
    •    Related Information

Bound Values
Why Use Bound Values?

Since it is possible to write custom code to populate the contents of an HTML page, as well as
derive UI content from certain metadata specified in the OA Extension Property Inspector, why
bother to use bound values? There are several reasons, the main reason being that bound
values simplify the code needed to fetch values from a data source at rendering time.

In the case of interdependent attributes, where the value of one attribute depends on the value
of another, the use of bound values eliminates the need for a lot of duplicate code. Consider the
example, "If data type is NUMBER, right align". Without data binding, you would have to write
code such as:



public void setDataType(String type)

{

    if ("NUMBER".equals(type))

    {

        setAttributeValue(HALIGN_ATTR, HALIGN_RIGHT);

        setAttributeValue(DATATYPE_ATTR, type);

    }



}



public void setHAlign(String hAlign)

{

    if ("NUMBER"Equals(getAttributeValue(DATATYPE_ATTR)))



308
Oracle Application Framework Developer's Guide, Release 12.1.3


    {

        setAttributeValue(HALIGN_ATTR, HALIGN_RIGHT);

    }

    else

    {

        setAttributeValue(HALIGN_ATTR, hAlign);

    }

}



public String getDataType()

{
    return getAttributeValue(DATATYPE_ATTR, type);
}



public String getHAlign()
{
  if ("NUMBER"Equals(getAttributeValue(DATATYPE_ATTR)))
  {

        return HALIGN_RIGHT;
        return getAttributeValue(HALIGN_ATTR, hAlign);

    }
}

By implementing bound values, you can reduce this code to:



bean.setAttributeValue(HALIGN_ATTR, new HAlignBoundValue(bean));

with HAlignBoundValue defined as:



public class HAlignBoundValue implements BoundValue


                                                                                       309
Oracle Application Framework Developer's Guide


{

    private OAWebBean mOAWebBean;

    HAlignBoundValue(OAWebBean bean)

    {

        mOAWebBean = bean;

    }

    public Object getValue(RenderingContext context)

    {

        if ("NUMBER"Equals(bean.getDataType()))

        {

            return HAlignRight;

        }

    }

}

Note that bound values are especially relevant when the value of the "depended on" attribute
can change at any point up until rendering time. See the Runtime Control section for another
example.

Another occasion when bound values are desirable is in the case of tables, where you have a
handful of columns, but an unknown number of rows. Rather than consider a bean for each row
and column, which does not scale, or reuse the bean hierarchies, you can bind the data in each
column to a data source, such as a view object.

Data Binding in OA Framework

To understand how bound values work, let us take a look at the structure of a typical web bean.
It can consist of indexed children, named children, and attributes. Attributes derive their values
from a data dictionary of name/value pairs. Some name/value pairs are static values, such
prompt /"Employee" or style/"OraTipText", and are specified at design time in the OA
Extension Property Inspector. Others are implemented as data bound values, such as the text
attribute (TEXT_ATTR) on message beans, where the value is retrieved from the data source at
rendering time.

For attributes such as TEXT_ATTR, UIX calls the OABoundValue class, an OA implementation
of the UIX BoundValue interface. The class contains a single method:

310
Oracle Application Framework Developer's Guide, Release 12.1.3




       public Object getValue(RenderingContext context);

Before examining how a value is fetched from a BoundValue object, note that OA Framework
creates a named DataObject for each data source and then caches the DataObject on
oracle.cabo.ui.RenderingContext. A data source is identified by the viewName set on
the web bean. OA Framework then gets the value from the DataObject using the viewAttr
attribute on the bean as a lookup key. Oracle Application implementations of the UIX
DataObject interface are: OADictionaryDataViewObject, OADictionaryDataRow, and
OADictionaryDataString.

At rendering time, when UIX uses the BoundValue object to retrieve the value for
TEXT_ATTR,the getValue method in the BoundValue object constructs a key using
viewName and viewAttr and gets the named DataObject that is cached on
RenderingContext. The logic in the BoundValue object then invokes selectValue, the
only method in the UIX DataObject interface, which in turn calls the getAttribute method
on the underlying view object to retrieve the value. That value is put on the
BoundValue.getValue method, and is the value returned for the attribute at rendering time.

Attention To guarantee thread-safety in a multi-threaded enviroment, OA Framework uses
data bound values (OABoundValue) for web bean attribute values. Classes that implement
OAWebBean use the data bound values wherever necessary. If these web bean classes
provide multiple versions of a method such as setText(String text) and
setText(OAPageContext pageContext, String text), then to use data bound values, be sure
to select the one that has the OAPageContext parameter. The method without
OAPageContext is usually inherited from the super class. For example, use
OAMessageTextInputBean.setText(OAPageContext page context, String text)
instead of OAMessageTextInputBean.setText(String text).

Avoid calls like setAttributeValue(TEXT_ATTR, "<hardcoded string>"), as the attribute value
is not a data bound value in this case. If you intend to set your custom attribute value
through the setAttributeValue method, you should set the attribute value to your own
custom data bound value object.

Attention When you want to get an attribute value from a bean, use the
getAttributeValue(RenderingContext, AttributeKey) signature whenever
possible to ensure that the attribute value is resolved correctly. Simply calling the attribute
accessor or the getAttributeValue(AttributeKey) method without the
RenderingContext parameter, may return incorrect results if the attribute was set as a
bound value. For example, use:

getAttributeValue(pageContext.getRenderingContext(), RENDERED_ATTR);

The public Oracle E-Business Suite bound values that you can use are as follows and are
discussed in more detail in the Runtime Control section:



                                                                                             311
Oracle Application Framework Developer's Guide


OADataBoundValueAppModule
OADataBoundValueViewObject
OAFunctionSecurityBoundValue

Data Binding for Fields Outside a Table

When OA Framework implements bound values for fields outside of a table, the named
dictionary of DataObjects is maintained with the current context. The data object name for
each bean is defined by:

   •   Application module name and view object instance name - for view object data
   •   NON_VIEW_OBJECT_DATA (static variable in
       oracle.apps.fnd.framework.webui.OAWebBeanConstants interface) - for non-
       view object data

The data attribute name for each bean is defined by:

   •   View attribute name - for view object data
   •   Region code, item name, etc. - for non-view object data

Data Binding for Fields in a Table

When you implement bound values for fields in a table, OA Framework generates a
DataObjectList instead of a single DataObject. A DataObjectList is simply a list of
DataObjects. UIX iterates through the list, setting the "current DataObject" for each
iteration. As a result, the bound value on the text attribute (TEXT_ATTR) uses the "current
DataObject" to fetch its value, as described above.

Declarative Implementation

Certain attributes (the Required, Rendered, Disabled, and Read Only properties in the
Property Inspector) can be bound to values declaratively using SPEL binding. For other
attributes where there is currently no means for declaratively implementing bound values, a later
release of OA Framework will provide more general declarative data binding support.

Runtime Control

OA Framework provides three implementations of bound values that you can use:
oracle.apps.fnd.framework.webui.OADataBoundValueViewObject,
oracle.apps.fnd.framework.webui.OADataBoundValueAppModule and
oracle.apps.fnd.framework.webui.OAFunctionSecurityBoundValue.

OADataBoundValueViewObject

You can use the OADataBoundValueViewObject class to bind a web bean's property with a
view object attribute. To do this, set the attribute, representing the web bean's property, to:



312
Oracle Application Framework Developer's Guide, Release 12.1.3


       new OADataBoundValueViewObject(webBean, viewAttrName)

At rendering time, the attribute value becomes the value of the viewAttrName of the view
instance associated with the web bean (which defaults to the OA Extension View Instance
property). If you wish to override this default view instance, you can use the alternate
constructor that allows specification of the view usage name:



       new OADataBoundValueViewObject(webBean, viewAttrName,
       viewUsageName)

You can also indicate whether or not to format the output of a bound value.

Specify OADataBoundValueViewObject as follows, to bind attributes that need to be
formatted and rendered on the page (such as TITLE_ATTR, TEXT_ATTR, PROMPT_ATTR, ...).
The output that results is always a string, formatted according to the data type of the web bean
or view attribute:



OADataBoundValueViewObject(OAWebBean webBean,

                                                                              String
lookupName,

                                                                              String
viewUsageName)



OADataBoundValueViewObject(OAWebBean webBean,

                                                                              String
lookupName)

Specify OADataBoundValueViewObject as follows, to bind attributes that do not need to be
formatted and rendered on the page (such as RENDERED_ATTR, READONLY_ATTR,
DISABLED_ATTR, ...). Pass formatToString as 'false'.



OADataBoundValueViewObject(OAWebBean webBean,

                                                                              String
lookupName,

                                                                              String
viewUsageName,

                                                                                             313
Oracle Application Framework Developer's Guide


                                                                           boolean
formatToString)




OADataBoundValueViewObject(OAWebBean webBean,

                                                                           String
lookupName,

                                                                           boolean
formatToString)

Example

The following code shows how to bind the currency code attribute of the Total bean to display a
formatted total according to the currency code attribute value of each row in a table:



// Now format the order total value based on the PO's currency code.

// "CurrencyCode" is the name of the attribute in the
POSimpleSummaryVO

// that this table is referencing.



OAMessageStyledTextBean orderTotal =


(OAMessageStyledTextBean)webBean.findIndexedChildRecursive("OrderTotal
");

if (orderTotal !== null)

{

    orderTotal.setAttributeValue(CURRENCY_CODE,

      new OADataBoundValueViewObject(orderTotal, "CurrencyCode"));

}

OADataBoundValueAppModule

314
Oracle Application Framework Developer's Guide, Release 12.1.3


You can use the OADataBoundValueAppModule class to bind a web bean's property with a
value returned from an application module. To do this, override
initializeWebValues(Hashtable paramValues) in the application module to put values
into the Hashtable keyed by a lookupName. For example, to have a specific web bean's
prompt derived from one of the values returned by the application module, put (lookupName,
"Value of the prompt"). Then set the attribute, representing the property of the web bean
to:



       new OADataBoundValueAppModule(webBean, lookupName)

At rendering time, the attribute value is fetched from the web values Hashtable based on
lookupName.

OAFunctionSecurityBoundValue

OAFunctionSecurityBoundValue is a bound value that returns Boolean.TRUE or
Boolean.FALSE based on whether the current session user is authorized to access a specific
function. Use this class to check whether a certain function is granted based on specific data
context. For example, you can bind the RENDERED_ATTR attribute to a function so that the
bean is hidden if the function is not granted



//Hides the customer name bean if function 'ShowCustomerNameFunction'
is not granted.

...
OAFunctionSecurityBoundValue fSBoundValue =

  OAFunctionSecurityBoundValue("ShowCustomerNameFunction");

custNameBean.setAttribute(pageContext.getRenderingContext(),

  RENDERED_ATTR, fSBoundValue);

...

Other UIX Bound Values

UIX provides many other useful bound values. The following table lists the bound values that
support some basic operations.

       Operations                                   UIX Bound Values
Arithmetic                  AddBoundValue, ConcatBoundValue
Comparison                  ComparisonBoundValue, AndBoundValue, OrBoundValue,


                                                                                             315
Oracle Application Framework Developer's Guide


                            NotBoundValue
Type Conversion             ToBooleanBoundValue, ToDateBoundValue,
                            ToCharacterBoundValue, ToIntegerBoundValue,
                            ToStringBoundValue
Matching Attribute Values   NodeAttributeBoundValue
Among Beans

For a complete list of UIX bound values, refer to the oracle.cabo.ui.data.bind package.

Example 1

The following code shows how to bind a property based on the value of another property. In this
case the total bean is not rendered if the salary bean is not rendered:



OAMessageStyledTextBean totalBean =


(OAMessageStyledTextBean)webBean.findIndexedChildRecursive("totalBean"
);

OAMessageStyledTextBean salaryBean =


(OAMessageStyledTextBean)webBean.findIndexedChildRecursive("salaryBean
");

if(totalBean!=null && salaryBean!=null)

{

    totalBean.setAttribute(RENDERED_ATTR,

      new NodeAttributeBoundValue(salaryBean, RENDERED_ATTR));

}

Example 2

The following code shows how to use UIX standard bound values to achieve more complex or
compound binding. In this example, the name attribute is concatenated with the description
attribute at rendering time:



OAHeaderBean headerBean =


316
Oracle Application Framework Developer's Guide, Release 12.1.3


    (OAHeaderBean)webBean.findIndexedChildRecursive("headerBean");

if (nameBean!==null && descBean!=null && headerBean!=null)

{
  headerBean.setAttributeValue(TEXT_ATTR, new ConcatBoundValue(new
BoundValue[]

        {new OADataBoundValueViewObject(concatBean,"Name", viewUsage),

    new OADataBoundValueViewObject(concatBean, "Description",
viewUsage)});

}

Form Submit Bound Values

See Submitting the Form for additional information about bound values that can be used in
specific cases where you need to force a form submit when a component is activated.

Personalization Considerations
See a summary of Bound Values personalization considerations in the Oracle Application
Framework Personalization Guide.

Known Issues
    •    None

Related Information
    •    BLAF UI Guideline(s)
            o None
    •    Javadoc
            o oracle.cabo.ui.data.BoundValue
            o oracle.cabo.ui.data.DataObject
            o oracle.cabo.ui.data.DataObjectList
            o oracle.cabo.ui.RenderingContext
            o oracle.apps.fnd.framework.webui.OAWebBeanConstants
            o oracle.apps.fnd.framework.webui.OADataBoundValueViewObject
            o oracle.apps.fnd.framework.webui.OADataBoundValueAppModule
            o oracle.apps.fnd.framework.webui.OAFunctionSecurityBoundValu
               e
    •    OA ToolBox Tutorial / Sample Library
            o Delete Lab




                                                                                            317
Oracle Application Framework Developer's Guide



Branding
Overview
As described in the Oracle Browser Look-and-Feel (BLAF) UI Guideline: Branding [ OTN
Version ], every OA Framework page reserves the upper left-hand corner for either:

    •    Basic (Non-Contextual) Branding - includes corporate ("Oracle") and product brand
         names
    •    In-Context Branding - includes user-selected contextual information in addition to the
         corporate and product brand names

All OA Framework pages must provide basic branding support as described below. In-Context
branding may be used in select cases (see Oracle Branding Options in the guideline for specific
use case recommendations).

Basic (Non-Contextual) Branding
Basic branding supports a regular layout style as shown in Figure 1.

Figure 1: Basic Branding (corresponds to BLAF "Regular" Layout)




Regular Layout

Pages Launched from the E-Business Suite Personal Home Page

If your OA Framework page is launched from the Navigator in the E-Business Suite Personal
Home Page, the OA Framework automatically sets the branding text for you based on the
current selected responsibility and page link. This ensures consistency for the user between the
options presented in the Navigator, and the branding text displayed on the application page.

For example, as shown in the Navigator in Figure 2, the user has selected the responsibility
Workflow Administrator Web (New). The top-level menu associated with this responsibility
has two submenus with prompts: Administrator Workflow and Transaction Monitor. If the
user selects a link beneath one of these submenus (the corresponding function must be of type
JSP or INTEROPJSP), the OA Framework automatically sets the branding text to the parent
submenu's prompt.

    •    If the user selects the Business Events in the example below, the OA Framework sets
         the branding text to Administrator Workflow.
    •    If the user selects the Transaction Monitor link in the example below, the OA
         Framework sets the branding text to Transaction Monitor (if the Transaction Monitor


318
Oracle Application Framework Developer's Guide, Release 12.1.3


         link label were to be changed to "My Monitor," the branding text would still be set to
         Transaction Monitor since the link prompt has no effect on this).

Figure 2: E-Business Suite Personal Home Page Navigator




If you attach a function directly to the responsibility main menu instead of a grouping submenu,
the branding text defaults to the responsibility name. For example, assume you have the
following structure based on the Workflow use case shown above. Note that the new "Worklist"
function is attached directly to the main menu. When this page renders, the branding text will be
Workflow Administrator Web (New).



Workflow main menu // root menu associated with the Workflow
Administrator Web (New) responsibility

| -- Worklist (function)

| -- Administrator Workflow (grouping menu)
     | -- Home (function)

        | -- Developer Studio (function)

        | -- Business Events (function)

        | -- Status Monitor (function)

        | -- Notifications (function)

| -- Transaction Monitor (grouping menu)

        | -- Transaction Monitor (function)

In this case, you can either add a grouping menu to your main menu and move the function
accordingly, or you can use the manual override instructions provided below.

Branding Override


                                                                                                  319
Oracle Application Framework Developer's Guide


If the default behavior is unacceptable, you can override it by following these instructions:

Step 1: Define a form function to represent your branding text (see Tabs / Navigation if you
need information on creating application functions and menus). Note that the User Function
Name value must be set to the branding text that you want to display in the upper left-hand
corner of your application's pages. For example, in the OA Framework ToolBox Tutorial, we
defined a function with the following properties. The value "OA Framework ToolBox Tutorial"
displays in the branding area.

    •    Function: FWK_TOOLBOX_BRAND
    •    User Function Name: OA Framework ToolBox Tutorial

Step 2: Associate this function with your application's "Home Page" navigation menu.

Note: It's important that you do not specify a prompt when you associate your branding function
with the menu. Figure 3 shows the FWK_TOOLBOX_BRAND function properly associated with
the ToolBox Tutorial's "Home Page" navigation menu.

Figure 3: OA Framework ToolBox Tutorial "Home Page" menu with branding function




Step 3: Set the request parameter OAPB to the name of the function that you created in Step 1.
You should specify this wherever you set the menu context OAHP request parameter (see Tabs
/ Navigation if you need information about this).

For example, if you access your application from a test JSP, the page link should include the
OAPB parameter in addition to the OAHP and the OASF menu parameters. This is illustrated in
the URL below from the OA Framework ToolBox Tutorial test_fwktutorial.jsp:



<a href="<%=URLMgr.processOutgoingURL("OA.jsp?OAFunc=FWK_TOOLBOX_HELLO
&OAPB=FWK_TOOLBOX_BRAND&OAHP=FWK_TOOLBOX_TUTORIAL_APP



320
Oracle Application Framework Developer's Guide, Release 12.1.3


&OASF=FWK_TOOLBOX_HELLO&transactionid=" + transactionid +
"&dbc=" + dbcName, macKey) %>">Hello,World!</a><br>

Alternatively, you can specify the product branding on the page itself:

Step 1: For each page in your application, select the pageLayout region in the JDeveloper
structure pane, right-click and select New > productBranding. Set the corresponding item's
Style to formattedText. Assign the formattedText item a standards-compliant ID, and set the
Text property to product name that you want to display in the branding area.

Note: The branding context that you set declaratively on a page is not retained across the
application. If you want to retain the branding context across an application, you should set
the OAPB parameter, as it was introduced specifically for that purpose.

The following matrix describes the precedence order for the different sources of the branding
text value. The OAPB parameter, if specified, always prevails. The declarative page setting also
overrides the automatic setting of the grouping menu value. The responsibility name displays
only if no other options are available.

OAPB Parameter        Declarative Product       Grouping              Result: Branding Source
                      Branding                  Submenu
Not specified         Not specified             Specified             Grouping Submenu
Specified             Not specified             Specified             OAPB
Not specified         Specified                 Specified             Declarative Product
                                                                      Branding
Specified             Specified                 Specified             OAPB
Not specified         Not specified             None                  Responsibility

Once the branding context is set with the OAPB parameter value, it remains unchanged until
you explicitly reset the OAPB parameter value. Options for resetting this value include:

   •   Defining in in a URL associated with a item
   •   Defining it in a navigation function's Web HTML call
   •   Passing it as a parameter in a JSP forward or client redirect method call

Tip: If you support switching application contexts at runtime, remember to change your brand!

Pages Launched from Forms

For OA Framework pages launched from a form, the branding text should render as the display
name of the current form function. To do this, call fnd_function.user_function_name in
your form and set the OAPB branding parameter to this value when you open the OAF page.
For additional information about opening OA Framework pages from Forms, see the Forms / OA
Framework Integration document.




                                                                                             321
Oracle Application Framework Developer's Guide


For OA Framework pages launched from a link in the Forms Navigator, the branding text should
render as the display name of the associated form function. So, when you define this form
function's Web HTML Call, set the OAPB parameter value to the current function name.

In-Context Branding
The in-context branding includes the corporate and product brand images. Additionally,
contextual information renders below the corporate and product information as shown in Figure
4.

Figure 4: Example of in-context branding




Note that this style of branding is intended to be used only for cases where the user makes a
contextual selection when starting work that remains unchanged for the life of the application or
task.

Declarative Implementation

Step 1: For each page in your application, select the pageLayout region in the JDeveloper
structure pane, right-click and select New > productBranding. Set the corresponding item's
Style to formattedText instead of "image" as you did above. Assign the formattedText item a
standards-compliant ID, and set the Text property to product name that you want to display in
the branding area.

Step 2: Select the pageLayout region again, right-click and select New > inContextBranding.
Set the corresponding formattedText item's ID and set the Text property to the context you
wish to display (for example, this would be "Customer <b>Sun Microsystems - Menlo Park</b>"
in Figure 4 above).

Note: Creating an inContextBranding component without a productBranding component is
invalid. The OA Framework throws a Developer Test Mode error for this condition if you work
with this test mode enabled.

Runtime Control

If you need to change the contextual information programmatically, you can do the following:



public void processRequest(OAPageContext pageContext, OAWebBean
webBean)
{




322
Oracle Application Framework Developer's Guide, Release 12.1.3


super.processRequest(pageContext, webBean);



OAFormattedTextBean inContextTextBean =

   (OAFormattedTextBean)createWebBean(pageContext,
FORMATTED_TEXT_BEAN);



 // Remember that you must pass a translated value obtained from
message dictionary,

// not a static String as shown here.



inContextTextBean.setText("Text for In-Context Branding");



// Ensures the correct CSS style is applied.

inContextTextBean.setStyleUsage(IN_CONTEXT_BRANDING_STYLE);



OAPageLayoutBean page = pageContext.getPageLayoutBean();

page.setInContextBranding(inContextTextBean);



}

Personalization Considerations
    •   See a summary of Branding personalization considerations in the Oracle Application
        Framework Personalization Guide.
    •   You can also refer to the section called Personalizing Your System: Branding in the
        Oracle Application Framework Personalization Guide for additional information.

Known Issues
    •   The default Small branding text does not display in a mobile page.



                                                                                              323
Oracle Application Framework Developer's Guide


Related Information
   •   BLAF UI Guidelines
          o Branding [ OTN Version ]
   •   Javadoc
          o oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBe
             an




324
Oracle Application Framework Developer's Guide, Release 12.1.3



Bulleted List
Overview
Simple, HTML bulleted lists appear in numerous BLAF UI Guideline specifications. For example,
they are routinely used in content containers as shown below:

Figure 1: Example of a content container with a bulleted list.




As implemented in the OA Framework, the bulleted list is a container that can hold any kind of
children (although, for all practical purposes, most bulleted lists are simply comprised of plain
text or links). Each region item is rendered with a bullet.

The bulleted list can be split into columns by specifying the maximum number of rows (bullet
items) that should render in a column before starting another until the 3 column maximum is
reached. Once the total number of rows would exceed 3 columns using the specified multiplier,
all rows are allocated as evenly as possible to 3 columns.

Declarative Implementation
To add a bulleted list to your page, follow these steps. The OA Framework will create an
oracle.apps.fnd.framework.webui.beans.layout.OABulletedListBean.

Step 1: Create a region item set its style to bulletedList.

Step 2: Set the region's ID property in accordance the OA Framework FIle Naming Standards.

Step 3: Add one or more items to the bulletedList. They can be of any item style.

Step 4: (optional) Set the Height property to determine how many items should render before
a new column is created.

Step 5: Save your work.

Runtime Control


                                                                                                   325
Oracle Application Framework Developer's Guide


Warning: You should create web beans programmatically only if you cannot create them
declaratively. Programmatically created web beans cannot be personalized, reused, or
extended easily.

See the OA Framework Controller Coding Standards for additional information about this and
other guidelines that you should consider when writing web bean manipulation code.

Instantiate

See the oracle.apps.fnd.framework.webui.OAControllerImpl Javadoc for other
createWebBean*() signatures.

Note: Always choose a signature that lets you specify the web bean's internal name.



import oracle.apps.fnd.framework.webui.OAWebBeanConstants;

import
oracle.apps.fnd.framework.webui.beans.layout.OABulletedListBean;

...

processRequest(OAPageContext pageContext, OAWebBean webBean)

{

...




 // Create the list bean container

 OABulletedListBean bullets =

      (OABulletedListBean)createWebBean(pageContext,


OAWebBeanConstants.BULLETED_LIST_BEAN,

                                                 null, "bulletList");



 // Create and add a link, plain text and an image to the bulleted
list


326
Oracle Application Framework Developer's Guide, Release 12.1.3


 OALinkBean link = (OALinkBean)createWebBean(pageContext,


OAWebBeanConstants.LINK_BEAN, null,

                                                                "linkEx");

 OAStaticStyledTextBean text =

    (OAStaticStyledTextBean)createWebBean(pageContext,


OAWebBeanConstants.STATIC_STYLED_TEXT_BEAN,

                                                          null, "textEx");



 OAImageBean image = (OAImageBean_createWebBean(pageContext,


OAWebBeanConstants.IMAGE_BEAN,

                                                                    null, "imageEx");



 bullets.addIndexedChild(link);

 bullets.addIndexedChild(text);

 bullets.addIndexedChild(image);

...

Control Visual Properties

To set the multiple after which the rows are split into columns, get a handle to the bulleted list
bean and call setRows(int). The default split size is 10. You can also pass the value
Integer.MAX_VALUE as the parameter if you want all your bullet items to render in a single
column, regardless of their number.

Personalization Considerations
   •   None

Known Issues

                                                                                                 327
Oracle Application Framework Developer's Guide


   •   None

Related Information
   •   BLAF UI Guideline
          o Content Containers in a Page [ OTN Version ]
   •   Javadoc
          o oracle.apps.fnd.framework.webui.beans.layout.OABulletedList
             Bean
   •   ToolBox Tutorial / Sample Library
          o oracle.apps.fnd.framework.toolbox.samplelib.webui.SampleBro
             wserPG.xml




328
Oracle Application Framework Developer's Guide, Release 12.1.3



Buttons (Action/Navigation)
Overview
As described in the BLAF UI Guideline: Buttons (Action/Navigation) [ OTN Version ]
specification, action/navigation buttons can be used to:

    •    Perform actions without navigating the user off the page (the page redraws with
         evidence that an action has been performed)
    •    Navigate the user to another page without performing any actions
    •    Perform an action and navigate the user to another page

Action/navigation buttons can be placed as follows within a page.

    •    In relation to a single field, poplist, or text area
    •    In relation to a group of standard widgets
    •    In relation to a table
    •    In relation to the entire page (as individual action buttons, or within a multistep
         navigation control)

Figure 1: BLAF UI Guidline illustration of all possible action/navigation button usages within a page




                                                                                                        329
Oracle Application Framework Developer's Guide




330
Oracle Application Framework Developer's Guide, Release 12.1.3


This document describes how to implement each of the following:

   •   Action (Submit) Buttons
   •   Navigation (Link) Buttons

It also describes how to position buttons in different page locations (for example, page-level
buttons).

For information on implementing buttons for navigating multistep transaction flows, see the
Locator Element: Page/Record Navigation document.

Action (Submit) Buttons
Action buttons submit the page form when selected by the user (they perform an HTTP POST).

Declarative Implementation

To add a submit button to your page (regardless of its location) follow these steps. The OA
Framework will instantiate an
oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean with the
name you assign the region item in Step 1.

Step 1: Create a region item and set its style to submitButton

Step 2: Set the region item's ID property in accordance the OA Framework File naming
standards.

Step 3: (optional): I you're adding a common button (like the "Apply," "Go," or "Cancel" buttons,
or a standard button for your product), specify an attribute set. For example, the standard OA
Framework "Go" button attribute set is:

/oracle/apps/fnd/attributesets/Buttons/Go

See Implementing the View for additional information about using attribute sets.

Step 4: (assuming no attribute set): Specify the button label by setting the Prompt property.

Step 5: (assuming this isn't inherited from the attribute set): Specify the ALT text by setting the
Short Description property. This value is required for assistive technologies, and is also
displayed as tooltip text when a mouse moves over the button.

Runtime Control

Warning: You should create web beans programmatically only if you cannot create them
declaratively. Programmatically-created web beans cannot be personalized, reused, or
extended easily.



                                                                                                 331
Oracle Application Framework Developer's Guide


See the OA Framework Controller Coding Standards for additional information about this and
other guidelines that you should consider when writing web bean manipulation code.

Instantiate

To instantiate an OASubmitButtonBean, call the appropriate createWebBean() factory
method in the oracle.apps.fnd.framework.webui.OAControllerImpl class. If you
select a signature that requires a constant to determine what kind of bean to create, use
oracle.apps.fnd.framework.webui.OAWebBeanConstants.BUTTON_SUBMIT_BEAN.

Control Visual Properties

The only visual property of a button that you might change at runtime is its text. To do this, get a
handle on the OASubmitButtonBean and call its setText(pageContext, String)
method.

Remember when setting String values displayed in the user interface to always obtain the value
from Applications Message Dictionary first. Never set a hard-coded value.

Control Behavior and Data

In rare cases, the BLAF UI Guidelines allow for buttons to be disabled. To disable a button, get
a handle on OASubmitButtonBean and call its setDisabled(boolean) method.

You might also want to turn off Javascript onSubmit validation when the button is pressed (for
example, you have a submit button that might be pressed before a page's data is fully entered
by the user, and you don't want to annoy him with premature validation errors). In your
controller's processRequest() method, get a handle to the OASubmitButtonBean and call
its setUnvalidated(Boolean) method.

Finally, you can also turn off server-side validation when a submit button is pressed. In this
case, all page data will be pushed to the underlying view object(s) (and corresponding entity
objects) where server-side validation will be performed, however, any exceptions will be ignored
so code that you write in processFormRequest() will proceed as if there had been no
validation performed in the processFormData() phase. To implement this in your controller's
processRequest() method, get a handle to the OASubmitButtonBean and call its
setServerUnvalidated(Boolean) method.

For additional information about the submit processing phases, see Implementing the View. For
information about bypassing validation, see Implementing the Controller.

Tip: If you define a button and you don't want it to perform either client or server-side validation
(a transaction "Cancel" button is a common example if you don't need to implement special
processing when it's pressed), consider making it a plain navigation button instead.

Handle Button Press Events




332
Oracle Application Framework Developer's Guide, Release 12.1.3


When the user selects a submit button, the browser performs an HTTP POST while adding the
button's name to the request (note that this name is set to the button's ID property, or the name
value specified when creating the web bean programmatically). To ascertain whether a
particular submit button has been pressed , add the following code to a controller associated
with a region above the button in the page's bean hierarchy.



public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)

{

 ...



 // Check to see if a submit button named "Go" has been pressed.

 if (pageContext.getParameter("Go") != null)

 {



 ...



If the action button that you're implementing should also navigate the user to another page after
performing an action (or you need to forward back to the current page so you can edit the web
bean hierarchy in processRequest()), use the setForward*() methods in the
oracle.apps.fnd.framework.webui.OAPageContext.



Blocking on Submit
Whenever a submit action takes place on a page, subsequent submits can be blocked. When
using a blocking on submit technique, when the submit action takes place, the cursor becomes
busy and prevents any other submit action until the current submit event has been handled. The
block on submit behavior is not enabled by default on a page. However, For Partial Page
Refresh (PPR) events alone, it is enabled by default.

To implement the block on submit behavior on a specfic page, add the following code to the
processRequest() of that page:




                                                                                               333
Oracle Application Framework Developer's Guide


import oracle.apps.fnd.framework.webui.beans.OABodyBean;

public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

       {

super.processRequest(pageContext, webBean);

OAWebBean body = pageContext.getRootWebBean();

if (body instanceof OABodyBean)

       {

((OABodyBean)body).setBlockOnEverySubmit(true);

       }

...

...

       }

.

Navigation (Link) Buttons
Navigation buttons navigate the user to a new destination without performing any actions. In
other words, they are simply fancy links that perform an HTTP GET when selected by the user.

Note: It is perfectly appropriate for a navigation button to perform an HTTP POST instead of a
GET if necessary for your page design. In this case, simply define the button with a
submitButton item style. When selected, the button will submit the page form as described
above.

Declarative Implementation

To add a plain, link-like button to your page (regardless of its location) follow these steps. The
OA Framework will instantiate an
oracle.apps.fnd.framework.webui.beans.nav.OAButtonBean with the name you
assign the region item in Step 1.

Step 1: Create a region item and set its style to button.

Step 2: Set the region item's ID property in accordance the OA Framework File Standards.


334
Oracle Application Framework Developer's Guide, Release 12.1.3


Step 3: (optional): If you're adding a standard button for your product, specify an attribute set.

See Implementing the View for additional information about using attribute sets.

Step 4: (assuming no attribute set): Specify the button label by setting the Prompt property

Step 5: (assuming no attribute set): Specify the ALT text by setting the Short Description
property. This value is required for assistive technologies, and is also displayed as tooltip text
when a mouse moves over the button.

Step 6: Specify the Destination URI property as shown in the following examples:

OA.jsp?OAFunc=FWK_TBX_EMPLOYEE&retainAM=Y
OA.jsp?page=/oracle/apps/fnd/framework/toolbox/tutorial/webui/PoDetail
sPG

See Implementing the View for additional information about specifying URL parameters.

Runtime Control

Warning: You should create web beans programmatically only if you cannot create them
declaratively. Programmatically-created web beans cannot be personalized, reused, or
extended easily.

See the OA Framework Controller Coding Standards for additional information about this and
other guidelines that you should consider when writing web bean manipulation code.

Instantiate

To instantiate an OAButtonBean, call the appropriate createWebBean factory method in the
OAControllerImpl class. If you select a signature that requires a constant to determine what
kind of bean to create, use OAWebBeanConstants.BUTTON_BEAN.

Control Visual Properties

The only visual property of a button that you're likely to change is whether it's displayed or not.
To do this, get a handle to the OAButtonBean and call its setRendered(boolean) method.
You can also change its prompt by calling its setText(pageContext, String) method,
and its ALT text by calling setShortDescription(String).

Remember when setting String values displayed in the user interface to always obtain the value
from Applications Message Dictionary first. Never set a hard-coded value.

Control Behavior and Data

In rare cases, the BLAF UI Guidelines allow for buttons to be disabled. To disable a button, get
a handle the OAButtonBean and call its setDisabled(Boolean) method.


                                                                                                 335
Oracle Application Framework Developer's Guide


If you need to set the button's destination programmatically, always specify the URL in relation
to the document root node. For example:

Handle Button Press Events

When the user selects a plain navigation button, the browser issues an HTTP GET request to
display the new target page. There is no need to write any code to ascertain whether the button
is pressed. If you must handle the button press before navigating to a new page, create an
OASubmitButtonBean instead.

Location-Specific Button Implementations
This section describes how to add action/navigation buttons to specific locations within a page.
In all cases, create either a submit button or a plain button as described above.

Page-Level Buttons (Page Button Bar)

Page-level action/navigation buttons render below both the page tile and the page contents
bottom line (the "ski") as shown below.

Figure 2: example of page-level action/navigation buttons




Declarative Implementation

Note: You must specify a page title for your page if you want the page-level action/navigation
buttons to appear at the top of the page. If you don't set this value, they will appear only
beneath the "ski." See Headers and Subheaders for additional information about specifying a
page title.

To add page-level action/navigation buttons:




336
Oracle Application Framework Developer's Guide, Release 12.1.3


Step 1: Select the pageLayout region and add a region beneath it with the style
pageButtonBar. The OA Framework will an instantiate an
oracle.apps.fnd.framework.webui.beans.nav.OAPageButtonBarBean.

Step 2: Add one or more buttons to the pageButtonBar region (follow the instructions above for
adding specific button types). Add them in ascending sequence as you want them to appear
from left to right. So, for example, if you have a "Cancel" and "Apply" button on your page, and
you want them to render with "Apply" being the rightmost button as specified in the UI
Guidelines, add the "Cancel" button first.

Note: The OA Framework automatically adds the correct amount of space between buttons
when you add them to the pageButtonBar.

Runtime Control

Warning: You should create web beans programmatically only if you cannot create them
declaratively. Programmatically created web beans cannot be personalized, reused, or
extended easily.

See the OA Framework Controller Coding Standards for additional information about this and
other guidelines that you should consider when writing web bean manipulation code.

To instantiate the OAPageButtonBarBean for page-level action/navigation buttons, follow this
example showing an OASubmitButtonBean "Apply" and an OAButtonBean "Cancel":



import oracle.apps.fnd.framework.webui.OAWebBeanConstants;



import oracle.apps.fnd.framework.webui.form.OASubmitButtonBean;

import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;

import oracle.apps.fnd.framework.webui.beans.nav.OAButtonBean;

import oracle.apps.fnd.framework.webui.beans.nav.OAPageButtonBarBean;
...
processRequest(OAPageContext pageContext, OAWebBean webBean)
{
   ...


    // Assuming the controller is associated with the pageLayout region
    OAPageLayoutBean page = (OAPageLayoutBean)webBean;




                                                                                            337
Oracle Application Framework Developer's Guide


   // Remember to use Message Dictionary for UI Strings; never hard-
code Strings as shown here.



   // Always use the createWebBean signatures that let you specify the
component's internal name,

      // unless you're creating a web bean defined in JDeveloper.

      OAPageButtonBarBean buttons =

      (OAPageButtonBarBean)createWebBean(pageContext,
OAWebBeanConstants.PAGE_BUTTON_BAR_BEAN, null, "pbBar");

      OASubmitButtonBean applyButton =

       (OASubmitButtonBean)createWebBean(pageContext,
OAWebBeanConstants.BUTTON_SUBMIT_BEAN, null, "applyButton");

      applyButton.setText("Apply");

      OAButtonBean cancelButton =

      (OAButtonBean)createWebBean(pageContext,
OAWebBeanConstants.BUTTON_BEAN, null, "cancelButton");

      cancelButton.setText("Cancel");



   // Now add the buttons to the page button bar.    Remember to add
them as you want them

      // to display from left to right (in an American UI).

      buttons.addIndexedChild(cancelButton);

      buttons.addIndexedChild(applyButton);



   // Finally, set the page button bar on the page layout. This
example assumes the

      // page title was set declaratively.

      page.setPageButtons(buttons);


338
Oracle Application Framework Developer's Guide, Release 12.1.3




     ...

Region-Level Buttons

Buttons that relate to a region render right-justified immediately below the region header as
shown below.

Figure 3: example of a region-level button




For a reference implementation, select the Buttons (Action/Navigation) option in the ToolBox
Sample Library. Note that adding a pageButtonBar region to any region other than the
pageLayout region results in its child(ren) button(s) rendering only once beneath the region's
header.

Component Group Buttons

Buttons that relate to a group of components render immediately below the group.

Figure 4: example of a button for a group of related widgets




For a reference implementation, select the Buttons (Action/Navigation) option in the ToolBox
Sample Library.

Component Button




                                                                                                   339
Oracle Application Framework Developer's Guide


A button that relates to a single component (like a field or poplist) renders immediately to the
right of the component as shown below. A "Go" button for a single search field is a common
example.

Figure 5: example of a button in relation to a single widget




For a reference implementation, select the Buttons (Action/Navigation) option in the ToolBox
Sample Library

Table Button

Buttons that relate to an entire table render right-justified immediately above the table as shown
below. A button for creating objects displayed in the table is a common example.

Figure 6: example of a button in relation to a table




For a reference implementation, select the Buttons (Action/Navigation) option in the ToolBox
Sample Library.

Buttons that perform actions on a selected table row are a special case. See the tables (classic
or advanced) documentation for additional information about implementing control bar buttons
and poplists.

Known Issues
     •    None

Related Information
     •    BLAF UI Guideline(s)
             o Buttons (Action/Navigation) [ OTN Version ]
     •    Javadoc
             o oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBe
                an
             o oracle.apps.fnd.framework.webui.beans.nav.OAButtonBean
             o oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBe
                an


340
Oracle Application Framework Developer's Guide, Release 12.1.3


      o   oracle.apps.fnd.framework.webui.beans.nav.OAPageButtonBarBe
          an
•   OA Framework ToolBox Tutorial / Sample Library




                                                                               341
Oracle Application Framework Developer's Guide



Buttons (Global)
Overview
As described in the BLAF UI Guideline: Buttons (Global) [ OTN Version ] specification, global
buttons provide access to tasks that apply to an entire application , and as such, are accessible
from every page in the application. Global buttons render in the upper right-hand corner of an
application above its tabs as shown below:

Figure 1: OA Framework ToolBox Tutorial Application global buttons with "Regular" branding




For information about Application Switchers (which appear with the global buttons) see
Switchers (Application, Context, Table Content).

Declarative Implementation
Global buttons are included in an application's menu definition; they are not defined as an OA
component region in JDeveloper. Customers can disable global buttons for specific
responsibilities and users by leveraging the Application Object Library function security features.

Tip: Menus are cached. If you change a menu for an application that you're running within
JDeveloper, remember to terminate the OC4J server (Run > Terminate) and re-run your
.jsp page to see your menu changes. If you change a menu for a deployed application (as
opposed to one that you're running within JDeveloper), remember to bounce the web
application server's listener and JVM to see your menu changes.

Standard Global Buttons

The standard global buttons that appear in all applications (Home, Logout, Preferences, and
Help) are included in a seeded menu called ICX_STANDARD_GLOBAL_MENU. To
incorporate these buttons in your application, simply add this predefined menu to your
application's top-level "Home Page" menu as shown below for the OA Framework ToolBox
Tutorial "Home Page" menu. Note that the global submenu does not have an associated
prompt.

Note: The ICX_STANDARD_GLOBAL_MENU_G menu has never been supported. Please
refer to Bug 3508626

Tip: This document assumes you are familiar with creating OA Framework application
menus. If not, you might want to read Tabs / Navigation first.


342
Oracle Application Framework Developer's Guide, Release 12.1.3


Figure 3: FWK_TBX_TUTORIAL_APPLICATION "Home Page" menu definition in Oracle E-Business Suite Release 12.




Diagnostics and Personalize Global Buttons

There are two additional "standard" global buttons that render only if corresponding profile
options are set:

    •   As shown in Figure 1 above, the Diagnostics button gives users the ability to view log
        messages for a page (customers generally use this feature under the guidance of an
        Oracle Support representative). To enable this global button, set the FND: Diagnostics
        profile option value to Yes at the appropriate level for your needs. See Logging for
        additional information.
    •   The "Personalize" button gives users the ability to personalize the current page. To
        enable this global button, set the Personalize Self-Service Defn profile option to Yes at
        the appropriate level for your needs. See the Personalization Guide for additional
        information.

Help Global Button

When a user selects the global Help button, OA Framework uses the Application Object Library
online Help technology to present page-level context-sensitive help content.

To enable context-sensitive Help for a page, you must specify the Help Target property in
JDeveloper for the pageLayout region. Note that any Help Target property set for a child of
the pageLayout region is ignored.

    •   The Help Target value must be unique.


                                                                                                            343
Oracle Application Framework Developer's Guide


    •    The Help Target value must start with an alpha character, and may not be longer
         than 40 characters.
    •    The Help Target must comply with the following syntax:
         <appShortName>_<packageFunctionalComponent>_<pageName> (for example,
         FND_tutorial_HelloWorldPG and FND_labsolutions_HelloWorldPG). The package
         functional component in this context helps to clearly differentiate pages given that you
         could have the same page name in different packages owned by the same product. If
         necessary, you may abbreviate the functional component name. Never abbreviate the
         product short code; abbreviate the page name only as a last resort.
    •    Remember to coordinate with your technical writer so she can incorporate the target in
         the page's documentation.

For detailed information about defining and deploying online Help content, see the Oracle E-
Business Suite System Administrator's Guide. Oracle's internal E-Business Suite developers
should also review the Applications Documentation Operations web site for other instructions.

Product-Specific Global Buttons

You can also display product-specific global buttons (see the BLAF Global Buttons Guideline for
limits on the number of buttons that you should add, and criteria that you should evaluate before
designing a product-specific global button).

To do this, you must define a custom menu including the buttons you want to display.

    1. Add the ICX_STANDARD_GLOBAL_MENU to your "Home Page" menu as described
       above.
    2. Define functions for each of your product-specific global buttons as you would for any
       page that you include in a menu, with one small difference: you must also specify an
       icon (these images should be added to your $APPL_TOP/MEDIA directory).
    3. Create a new menu of type Global and add your button functions. Remember to specify
       a prompt for each function (this value displays as the link text).
    4. Add your custom global menu to your "Home Page" menu. Do not specify a prompt.

Product-Specific Preferences

When a user selects the global Preferences button, OA Framework displays both general and
any product-specific preferences in a side navigation menu (if you add them to a
PREFERENCES menu using the following instructions).

Additional Information: Please refer to the Oracle Applications User's Guide for details
about how to use the general Preferences page.

You can configure the General Preferences Show Flag profile option to hide the General
Preferences menu entry if you wish.

Figure 4: Example of "General" and "Application" preferences.




344
Oracle Application Framework Developer's Guide, Release 12.1.3




For Oracle's in-house E-Business Suite developers: If you think you have content to add to
the General Preferences menu, please contact the OA Framework team.

Note: If you do add pages to the General Preferences menu, you must create a global grant
to the function's direct parent menu (or permission set). For Oracle's in-house E-Business
Suite developers, you may package that grant to ship with the related page patch to enable
the rendering of the page in the General Preferences menu. Note that any other page
security requirements are fully honored, as the global grant simply ensures the menu gets
rendered with the valid page patch present and will not override more specific security rules.

Warning: You must retain the application module for all preference page menus and
transactions so that when a user returns to his or her original page (prior to selecting the
Preferences global button), the transactional context is not lost.

The following instructions assume you know how to create menus and functions. If not, please
read Tabs / Navigation first.

Step 1: Create a menu of type PREFERENCES ("App Pref Menu Container"), and add it to your
responsibility root menu. Be sure to leave the prompt null. For example:

FWK_TOOLBOX_TUTORIAL_APP (responsibility root menu)

   •   ICX_STANDARD_GLOBAL_MENU
   •   FWK_TOOLBOX_PREFERENCES (Application-specific Preferences container, prompt
       = "")
   •   FWK_TOOLBOX_HELLO_TAB (Tab menu, prompt = "Hello, World")
   •   FWK_TOOLBOX_SEARCH_TAB (Tab menu, prompt = "Search")

Step 2: Create one or more submenus (of any type; OA Framework ignores whatever value you
set here) and add them to the PREFERENCES menu with prompts. The submenu prompts



                                                                                               345
Oracle Application Framework Developer's Guide


render as peers to the General Preferences as shown for the Application link in Figure 4 above.
Add page-level functions to these submenus.

For example, to include an application-specific preferences menu entry called "ToolBox,", we
would create the following menu structure for the ToolBox Tutorial. Note that this example
creates two different preferences pages under the "ToolBox" menu entry.

FWK_TOOLBOX_TUTORIAL_APP (responsibility root menu)

   •   ICX_STANDARD_GLOBAL_MENU
   •   FWK_TOOLBOX_PREFS_CONTAINER (Application-specific Preferences container,
       prompt = "")
          o FWK_TOOLBOX_PREFERENCES (Peer to "General Preferences", prompt =
              "ToolBox")
                   FWK_TOOLBOX_PREF_FUNC1 (prompt = "Some Page")
                   FWK_TOOLBOX_PREF_FUNC2 (prompt = "Another Page")
   •   FWK_TOOLBOX_HELLO_TAB (Tab menu, prompt = "Hello, World!")
   •   FWK_TOOLBOX_SEARCH_TAB (Tab menu, prompt = "Search")

Note: Although you can have nested submenus in your PREFERENCES menu, the UI
Guidelines recommend that you create as flat a menu as possible. Furthermore, if you want
to display only a single page, you can add a function for this page directly to the
PREFERENCES menu. Specify a prompt in this case.

Note: All Application (product-specific) preferences (menu of Type PREFERENCES) in the
current responsibility are added to the side navigation menu. If there are no product-specific
PREFERENCES menu defined, and only one preference page exists, the side navigation
menu is not displayed.

Runtime Control
At runtime, OA Framework reads the global menu definition(s), reconciles the standard buttons
with your buttons, and instantiates an
oracle.apps.fnd.framework.webui.beans.layout.OAGlobalButtonBarBean, to
which it adds indvidual
oracle.apps.fnd.framework.webui.beans.layout.OAGlobalButtonBeans. OA
Framework then sets the OAGlobalButtonBarBean on the
oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean by calling its
setGlobalButtons(UINode globalButtonsNode) method.

Instantiate

You should not instantiate global buttons yourself; always create them declaratively.

Control Visual Properties




346
Oracle Application Framework Developer's Guide, Release 12.1.3


At runtime, there are rare occasions when you might need to do the following (we say "rare"
because, by definition, global buttons are universally applicable, so it is fairly uncommon to
disable or hide them if a user has function security access):

To hide or disable an individual global button, use the following processRequest code:



if (< condition >)

{



 OAPageLayoutBean page = pageContext.getPageLayoutBean();



 // You must call prepareForRendering() if the following code is

 // included in a pageLayout controller.                  If you add it further down

 // in the layout hierarchy, the menus will be fully processed so you

 // don't need to do this.



 page.prepareForRendering(pageContext);



 OAGlobalButtonBarBean buttons =
(OAGlobalButtonBarBean)page.getGlobalButtons();



 // Note OA Framework automatically assigns global buttons their
corresponding

 // function name, so this is how you find them.



 OAGlobalButtonBean button =


(OAGlobalButtonBarBean)buttons.findIndexedChildRecursive("<FUNCTION_NA
ME>");

                                                                                                 347
Oracle Application Framework Developer's Guide




 // Note that you wouldn't do both at the same time...



 button.setRendered(false); // Hide the global button, or

 button.setDisabled(true); // Disable the global button so it
renders, but is not selectable



}

To hide all the global buttons, use the following processRequest code:

Warning: Hiding all the global buttons is not recommended; you must get UI team approval
before doing this, and you must verify that there isn't a declarative alternative (for example,
you could create multiple "Home Page" menus for your application and alternate between
the one with and the one without global buttons).



if (< condition >)

{

 OAPageLayoutBean page = pageContext.getPageLayoutBean();

 page.prepareForRendering(pageContext);

 page.setGlobalButtons((UINode)null); // Must come after
prepareForRendering()



 // And, if for some reason, you don't want to display any tabs,

 // do the following.

 page.setTabs(null);

}

Tip: If you want to create a page with no "chrome" ( no tabs, global buttons and so forth --
typically required when you display content in a secondary browser window), it would be
better to create the page without a pageLayout region. In this case, simply create the page


348
Oracle Application Framework Developer's Guide, Release 12.1.3


starting with a stackLayout, a header with a messageComponentLayout, or whatever
other layout you need for your content. If the page has form elements, you must remember
to add a form to your page. For example, a typical layout might look like:



stackLayout // top region for the page
|-- form
    | -- everything else

Without a pageLayout region, OA Framework won't try to display any menu components, so
you don't need to programmatically hide them.

Handle Standard Global Button Selection

In some cases, you might need to incorporate custom processing when a user selects a
standard global button (the "Logout" button is a common case). Since there is no event point for
handling this (for example, selecting the standard "Logout" button forwards to the
OALogout.jsp), you should programmatically change the destination URL on the "Logout"
global button so you can intercept the selection as shown in the following sample code.

Note: The following code is provided to assist in cases when it's absolutely essential that
you intercept these standard button actions (and any UI deviations have been approved by
the UI Design and Usability team). As a rule, this should be avoided.

Warning: You must preserve the original destination URL of the standard logout JSP, and
your custom JSP should foward to this destination URL when it completes its processing. If
you don't preserve the correct URL, or you forget to forward to OALogout.jsp, you may
cause a memory leak (the application module will not be released) and a hung session (the
session will not be invalidated).



processRequest(...)

{



  // Assume you create a JSP called "MyLogout.jsp" to implement your
custom processing.



  String myLogoutDestination =
"MyLogout.jsp&<someParam>=...&<someOtherParam>=...";

  myLogoutDestination = new
OAUrl(myLogoutDestination).createURL(pageContext);

                                                                                            349
Oracle Application Framework Developer's Guide




    String oldLogoutDestination = null;



    // Find global logout button

    OAGlobalButtonBean logoutButton = findGlobalButton("ICX_LOGOUT");



    // Save old destination url

    oldLogoutDestination = logoutButton.getDestination();

    saveLogoutDestination(oldLogoutDestination);



    //Set the new destination url

    logoutButton.setDestination(myLogoutDestination);



...

...



}

In your custom MyLogout.jsp:



...




// do some custom processing



// Always redirect to OALogout.jsp when you're done

350
Oracle Application Framework Developer's Guide, Release 12.1.3


String finalDestination = getOldLogoutDestination();

<jsp:forward page="<%= finalDestination %>" />

Personalization Considerations
  •   See a summary of Buttons (Global) personalization considerations in the Oracle
      Application Framework Personalization Guide.

Known Issues
  •   None

Related Information
  •   BLAF UI Guideline(s):
         o Buttons (Global) [ OTN Version ]
  •   Developer's Guide
         o Tabs / Navigation
  •   Javadoc
         o oracle.apps.fnd.framework.webui.beans.layout.OAGlobalButton
            BarBean
         o oracle.apps.fnd.framework.webui.beans.layout.OAGlobalButton
            Bean
         o oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBe
            an
  •   OA Framework ToolBox Tutorial / Sample Library




                                                                                       351
Oracle Application Framework Developer's Guide



Charts and Graphs
Overview
The OA Framework provides a user interface (UI) web bean that allows for graphs and graphs
with tables. This UI bean is based on the Business Intelligence (BI) web bean, but does not
provide all the options and configurations allowable in the BI web bean. The Gantt chart is also
based on the BI web bean, but further aggregates functionality from the OA Hgrid component.

Contents

The following topics are covered in this document:

   •   Overview
   •   A Chart and Graph Primer
          o About Graphs
          o About Gantt Charts
          o Supported Chart and Graph Types
                   Bar Graphs
                   Line Graphs
                   Area Graphs
                   Pie Graphs
                   Combination Graphs
                   Secondary Graph Types
                          Scatter Graph
                          Stock Graph
                   Gantt Chart
   •   Graphs
          o Declarative Implementation
          o Runtime Control
          o Laying Out Graphs in a Matrix
          o Personalization Considerations
          o Known Issues
   •   Charts
          o Declarative Implementation
          o Usage Notes
          o Runtime Control
                   Adding Dependency Lines
                   Using FireAction on the Project Column
                   Using Save Model on the Hierarchy Column
                   Per Row Dynamic Poplist
                   Optimizing Child Row Retrieval
          o Personalization Considerations
          o Known Issues
   •   Related Information

A Chart and Graph Primer

352
Oracle Application Framework Developer's Guide, Release 12.1.3


About Graphs

The OA Framework Graph web bean is a complex object with numerous variations. It would be
impractical to provide examples of each of those variations. But, we can discuss the general
characteristics of the Graph web bean, and develop a common vocabulary to help with your
understanding.

Before looking at the different kinds of graphs you can create and the instructions for creating
them, familiarize yourself with the following graph vocabulary.

Figure 2: A Sample Graph with labeled components




About Gantt Charts

Gantt charts are used for visualizing project planning and scheduling information. A Gantt chart
is a matrix. Project tasks that make up the project are listed on the left vertical axis of the Gantt
chart, while the total time span of the project divided into increments is listed on the horizontal
axis of the Gantt chart.

A Gantt chart is based on the HGrid web bean (see Figure 1). An extra column is added to the
HGrid to display the graph area that contains the task bars and the calendar axis of the chart.
Because this requires a special HGrid configuration, the HGrid web bean is not
programmatically accessible. Instead, its properties are exposed at the Gantt web bean level.

Figure 1: Gantt Design Concepts




                                                                                                  353
Oracle Application Framework Developer's Guide




Familiarize yourself with the following Gantt chart vocabulary.

Figure 3: A Sample Gantt Chart with labeled components




In a Gantt chart:



354
Oracle Application Framework Developer's Guide, Release 12.1.3


•   The Project column is the tree component of the HGrid and lists the project(s) and
    project tasks.
•   The Resource column identifies additional information such as who is responsible for
    the task. This column is set as an indexed child of the Gantt web bean; you can add as
    many resource columns as needed.
•   The last column in the HGrid displays the graph area of the Gantt chart. A row in a Gantt
    chart HGrid provides the whole visual representation of a single task.
•   The Calendar axis is a date table appearing at the top of the last column of the HGrid.
    Horizontal bars, or markers, representing tasks, are positioned relative to this axis.
•   The Minor scale determines the calendar increments shown on the second row of the
    Calendar axis. Valid choices are: days, weeks, months, quarters, half years and years.
    In Figure 3 above, the Minor scale is months. For the minor scale, you can specify a
    Start Time and an End Time.
•   The Major scale determines the calendar increments shown on the first row of the
    Calendar axis. It has the same valid choices as the minor scale. In Figure 3 above, the
    Major scale is years.
•   A Start Time and an End Time define the time span of the chart.
•   A Primitive is a visual component defined by its geometric shape, color and pattern.
•   A Marker is a graphical representation of a task in the graph area. It is composed of up
    to three primitives representing the task's start, middle and end. A marker's start time
    and end time are bound to the task's DataObject keys. For example, the marker for a
    default "normal" task type spans the time returned by the GanttConstants.START key to
    the time returned by the GanttConstants.END key.
•   A Task Type is the type of graphical representation assigned to a task. It is represented
    by one or more combination of markers. For example, the default "milestone" task type
    is drawn with a single "milestone" marker that is defined as a black diamond primitive.

    There are 4 task types in the default set, they are: "normal"
    (TaskTypeMap.NORMAL_TASK), summary" (TaskTypeMap.SUMMARY_TASK),
    "milestone" (TaskTypeMap.MILESTONE_TASK) and "variance"
    (TaskTypeMap.VARIANCE_TASK).

       o   milestone
       o   normal without percentage complete specified
       o   normal with percentage complete specified
       o   summary
       o   variance

    You can also add customized Task Types to the TaskTypeMap. The customized
    Task Type may be constructed with a customized marker.

    For example, you can define a customized Marker called CRITICAL_MARKER,
    which is red in color, and use it in the customized Task Type, "criticalTask", as
    such:

    criticalTask




                                                                                         355
Oracle Application Framework Developer's Guide


       Primitive red_bar = new Primitive(Primitive.FULL_BAR,
       Primitive.SOLID, Color.red);

       Marker critical = new Marker(null, red_bar, null,
       CRITICAL_START, CRITICAL_FINISH);

       map.addMarker(CRITICAL_MARKER, critical);



       // get default set of Task types

       TaskTypeMap type_map = TaskTypeMap.getDefault();

       type_map.addType(CRITICAL_TASK, new
       Object[]{CRITICAL_MARKER, MarkerMap.PROGRESS_BAR});

   •   A Dependency Line is a black line that connects two or more tasks together to show a
       dependency between these tasks.

Supported Graph and Chart Types

The following list defines the graph types supported by the Graph bean.

   •   Primary Graph Types
           o absolute area
           o absolute line
           o combination graph
           o horizontal clustered bar
           o horizontal percent bar
           o horizontal stacked bar
           o percent area
           o percent line
           o pie
           o stacked area
           o stacked line
           o vertical clustered bar
           o vertical percent bar
           o vertical stacked bar
   •   Secondary Graph Types (Secondary graph types are special usage or less common
       graphs that are associated with particular data types or ways to display unique cases of
       data. Do not use secondary graph types if the data can be adequately represented by a
       primary graph type.)
           o point
           o scatter
           o vertical high-low-close stock
           o gantt (***see exception note below)

Note: This is a significantly smaller list than the graph types supported by the BI Bean.


356
Oracle Application Framework Developer's Guide, Release 12.1.3


Attention: All the above graphs are created with the graphTable region style, with the
exception of Gantt charts, which are created with the gantt region style.

The following section provides you with thumbnail examples of each graph type, including Gantt
charts.

Note: All images in this section are thumbnail images, and are only intended as sample
representations of real graphs. It is not recommended that graphs be this small.

Bar Graph

A standard graph with vertical and horizontal axes where data is represented as a series of
bars. Subtypes include: clustered bar graph, stacked percentage bar graph, absolute
percentage bar graph, and dual-Y graph.


Graph Thumbnail                Graph Type      Description         Usage Notes

                               Vertical and    Each cluster of     Trends over time.
                               Horizontal      bars represents a   Comparison of items at the
                               Cluster Bar     column of data,     same time.
                               Graph           for easy
                                               comparison of       Percentage or changes in
                                               the values in a     percentage.
                                               column.             Relationship of parts to the
                                                                   whole.
                                                                   Changes in all parts of a whole.
                               Vertical and    Bars always add See Cluster Bar Graph.
                               Horizontal      up to 100%.     Useful when viewing
                               Stacked                         proportions of a total
                               Percentage                      percentage.
                               Bar Graph
                               Vertical and    Bars always         See Cluster Bar Graph
                               Horizontal      show absolute
                                                                   Useful when showing
                               Stacked         values.
                                                                   accumulations or cumulative
                               Absolute Bar
                                                                   data.
                               Graph

Line Graph

A standard graph using vertical and horizontal axes where data is represented by a line, or by
series of data points connected by a line. It is optional to display the marker points. If the graph
contains only marker points (and no line), then it is a point graph. Subtypes include: stack line
graph, percentage line graph, absolute line graph, and dual-Y graph.


Graph Thumbnail       Graph Type        Description                   Usage Notes

                      Vertical Stacked A graph in which the lines     Shows trends over time.


                                                                                                  357
Oracle Application Framework Developer's Guide


                    Line Graph       are stacked. The values of Shows comparisons of items
                                     each series are added to at the same time.
                                     the values for previous
                                     series. The size of the
                                     stack represents a         Shows rate of data change
                                     cumulative total.
                                                                See Pie Graph for more
                                                                examples.
                    Vertical        Lines are stacked and          To show differences or
                    Percentage Line always add up to 100%.         trends in parts of a whole.
                    Graph                                          Shows cumulative
                                                                   relationship between the
                                                                   data (out of 100% or total
                                                                   data values) rather than
                                                                   exact data values.
                    Vertical         A graph in which each         See Vertical Stacked Line
                    Absolute Line    data marker reflects the      Graph
                    Graph            exact data values             Useful when showing
                                                                   accumulations or cumulative
                                                                   data.

Area Graph

A standard graph using vertical and horizontal axes where data is represented as a filled in
area. Subtypes include: stacked area graph, percentage area graph, absolute area graph, and
dual-Y graph.


Graph             Graph Type        Description                   Usage Notes
Thumbnail

                  Vertical Stacked Area markers are stacked.      Shows trends over time.
                  Area Graph       The values of each series      Shows rate of data change.
                                   are added to the values for
                                   previous series. The size of   Shows percentage or
                                   the stack represents a         changes in percentage.
                                   cumulative total.              Shows relationship of parts to
                                                                  the whole.
                                                                  Shows changes in all parts of
                                                                  a whole.
                  Vertical          Area markers show the         Useful when viewing
                  Percentage        series percentage and         proportions of a total
                  Stacked Area      always add up to 100%.        percentage.
                  Graph




358
Oracle Application Framework Developer's Guide, Release 12.1.3


                    Vertical          Each area marker reflects       Useful when showing
                    Absolute          exact data values.              accumulations or cumulative
                    Stacked Area                                      data.
                    Graph


Pie Graph

A graph in which data is represented as sections of one or more circles, making the circles look
like sliced pies. Subtypes include: pie, multiple-pie graph, pie bar, ring, multiple-ring, and ring
bar graph.


Graph               Graph Type        Description                     Usage Notes
Thumbnail

                    Pie Graph         Graph in which one group        Shows relationship of parts to
                                      of data is represented as       a whole.
                                      sections of a circle, making    Shows percentage or change
                                      the circle look like a sliced   in percentage.
                                      pie.
                                                                      Shows changes in all parts of
                                                                      a whole

Combination Graph

A graph in which data is represented in a combination of two graph types against a single Y
axis. Subtype includes: dual-Y graph.


Graph               Graph Type        Description                     Usage Notes
Thumbnail

                    Combination       Emphasizes one or more          A single graph with one or
                    graph             series of data. Must have at    more graph types.
                                      least two series to use this    You can have a combination
                                      graph type. Shows the           of one or more graph types,
                                      relationship of one series to   where each series plotted as
                                      another.                        "data" is assigned a
                                                                      combination graph type (bar,
                                                                      line or area). For example,
                                                                      with two series plotted as
                                                                      "data", the first series can be
                                                                      set as bar graph type and the
                                                                      second series can be
                                                                      assigned a "line" type.
                                                                      Most often used as a Dual-Y
                                                                      graph, where not only do
                                                                      different series correspond to
                                                                      a different graph type, but
                                                                      also to different Y axes.

                                                                                                   359
Oracle Application Framework Developer's Guide


Scatter Graph

A graph in which data is represented by the location of markers in an area bound by horizontal
and vertical axes, where one measure is plotted against another to show correlation.


Graph Thumbnail Graph Type              Description             Usage Notes

                    Scatter Graph       Data is represented     Shows correlation between two
                                        by the location of data different measures, or two
                                        markers.                dimension members in the same
                                                                measure.

                                                                Especially useful with a number
                                                                of data items to show the
                                                                general relationship between
                                                                them.


Stock Graph

A graph specifically designed to show, at a minimum, 3 values for each stock (high low close)
during a certain time period. A stock graph may additionally show opening stock value and
volume. For displaying stock prices over long time periods, it may be preferable to use a line
graph, alone or in combination with a stock graph.


Graph           Graph Type             Description                   Usage Notes
Thumbnail

                High-Low-Close         Data shows the high, low       Use to show the high, low
                Stock Graph            and closing prices of a stock. and closing prices of a
                                       Each stock marker displays stock.
                                       three separate values.


Gantt Chart

A graph used extensively in project management applications to track individual events and the
overall progress of a complex project.


Graph Thumbnail          Graph Type         Description           Usage Notes

                         Gantt Chart        Data is represented Useful for visualizing project
                                            by the location and planning and scheduling
                                            size of data        information.
                                            markers. Location
                                            indicating a date,
                                            and size indicating
                                            duration.


360
Oracle Application Framework Developer's Guide, Release 12.1.3


Graphs

Declarative Implementation

To add a Graph web bean to your page, follow these general instructions.

Note: All code that you write (and declare) must comply with the OA Framework Standards
and Guidelines in Chapter 8. Please pay special attention to the performance standards.

Step 1: Create an application module for your Graph web bean, if a root UI application module
does not already exist. If a root UI application module exists, your work can be done there, or
you can create a new application module and nest it within your root UI application module.

Step 2: Create a view object for your Graph web bean, and add it to the application module
defined in Step 1. Note that the graph and the data table (if used) must be based on the same
view object. All graph columns must also be based on the same view object. As an example, the
following query could be used for a graph-related view object.



       SELECT position_code, count(position_code)

       FROM fwk_tbx_employees

       GROUP BY position_code

In this example, position_code defines the column to plot on the X-axis, and
count(position_code) defines the column to plot on the Y-axis.

Note: A graph does not have to plot all columns specified for the graphTable. When you
want to render multiple graphs, you can specify each graph to pick a different subset of
columns to plot.

Step 3: Add your graph to a page. Select the parent region in the OA Extension Structure pane,
then choose New > Region from the context menu. (You can alternatively create this as a
reusable region).

Note: OA Framework does not support graphs under the Detail Disclosure region of a table,
under a table or Advanced table region or under a layout region beneath a table or
Advanced table region.

Set the following properties on the new region:

   •   Give the region a standards-compliant ID.
   •   Set the Region Style property to graphTable.
   •   Set the Graph Render Style property to one of the following:
          o graph - to display only a graph. If you define multiple graphs, the graphs render
              one below the other.

                                                                                             361
Oracle Application Framework Developer's Guide


              o both - to display a data table as well as a graph, with the graph rendering below
                the table. If you define multiple graphs, a poplist of graph titles below the table
                lets you choose the graph to display. The first graph defined is displayed by
                default under the graph table.
    •    Create a controller and specify it in the Controller Class property. (See the Runtime
         Control section.)

A default graphs container is automatically created.

Figure 4: Sample structure panel after creating a graphTable region




Step 4: OA Extension automatically adds a graph to the graphs container. You can also add
other graphs to the graphs container by selecting the graphs container in the Structure pane,
and choosing New > Graph from the context menu. Set the following properties on the graph.
Required properties are marked with an asterisk (*).

    •    Give the graph a standards-compliant *ID.
    •    Set the *Title property to the title you want to display for the graph. Long titles are
         truncated and appended with an ellipse (...).
    •    Set the Size property to the graph size you wish to display:
             o very-small - generates a graph of 200 x 125 pixels (width x height).
             o small - generates a graph of 295 x 250 pixels. (The default size.)
             o medium - generates a graph of 375 x 295 pixels.
             o large - generates a graph of 450 x 325 pixels.
             o custom - generates a graph of custom size, based on the values, in pixels, that
                you must specify for the width and height properties.
    •    Set the *Graph Type property to the graph type you wish to define. Valid values are:
             o absolute area
             o absolute line
             o horizontal clustered bar
             o horizontal percent bar
             o horizontal stacked bar
             o percent area
             o percent line
             o pie
             o point
             o scatter
             o stacked area
             o stacked line
             o vertical clustered bar - default
             o vertical high-low-close stock
             o vertical percent bar
             o vertical stacked bar
    •    Set the *Y Axis Label and the X Axis Label properties as appropriate.

362
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   You can optionally set the Aggregate Function property to apply an aggregate
       function on all columns defined as data, after they are grouped by the specified
       groupLabels. Valid values are:
           o none
           o avg
           o max
           o min
           o sum
   •   Set the Display Data Markers property to True if you wish to plot the data markers
       on the graph. The default is False.
   •   Set the Display Data Bubble Text property to True if you wish to display bubble
       text when a user moves the mouse over a data point on the graph. When this property is
       set to True, the image map for the graph is generated. The bubble text for each data
       point includes the following: Group, Series, and Value. The default is True.
   •   For a combination graph with multiple series of data plotted as a combination of graph
       types against a single Y axis, also set the Allow Combination Graph property to
       True. For non-combination graphs, set this property to False. Note that you can only set
       the Graph Type property to one of the following for a combination graph:
           o horizontal clustered bar
           o vertical clustered bar
           o horizontal stacked bar
           o vertical stacked bar
           o absolute line
           o stacked line
           o absolute area
           o stacked area graph

       Attention: If the Allow Combination Graph property is set to True on a graph with a
       Graph Type other than the ones listed above, OA Extension displays a warning at design
       time and you will also get a run time Exception.

   •   For a dual-Y combination graph with multiple series of data plotted as a combination of
       graph types against two Y axes, also set the Allow Combination Graph property to
       True and the Display Secondary Axis property to True. For non-combination
       graphs, set this property to False. Note also that you can only set the Graph Type
       property to one of the allowed graph types for a combination graph.
   •   For a dual-Y (non-combination) graph with multiple series of data plotted as one graph
       type against two Y axes, also set the Display Secondary Axis property to True and
       enter a value for the Secondary Y Axis Label property. Note also that you can only
       set the Graph Type property to one of the following for a dual-Y (non-combination)
       graph:
           o horizontal clustered bar
           o vertical clustered bar
           o horizontal stacked bar
           o vertical stacked bar
           o absolute line
           o stacked line

Step 5: Define the columns of the graphTable (graphData) by expanding the default dataMap
container beneath the graph in the Structure pane. OA Extension automatically creates two

                                                                                                363
Oracle Application Framework Developer's Guide


default graphData columns for you and labels them graphDataN. Select a graphData column
and in the Property Inspector:

   •   Give the column a standards-compliant ID.
   •   Set the View Instance and View Attribute properties to the appropriate view
       object and view object attribute from which this column gets its data.
   •   Set the Purpose in Graph property to one of the following valid values:
           o data - indicates that this column is to be plotted on the Y-axis. You must define
               one or more data columns. If you define a column as data, you can optionally
               enter a value for the Prompt property. The value of the Prompt property is used
               for the legend when multiple data columns are defined or when no seriesLabels
               column is defined. See the Notes About Graph Columns for more details.
           o groupLabels - indicates that this column is to be plotted on the X-axis as the
               group labels. When there are many groupLabels, the graph attempts the
               following options in the order listed to prevent the labels from overlapping:
                    1. Stagger labels.
                    2. Rotate labels.
                    3. Skip labels.
           o seriesLabels - indicates that this column determines the Series in the graph.
               The View Attribute property for this column defines the values for the
               legend.

   •   For high-low-close stock graphs, set the Stock Value Type property to high, low, or
       close as appropriate. For all other graph types, set the Stock Value Type property to
       none.
   •   For a combination graph with multiple series of data plotted as a combination of graph
       types against a single Y axis, you must map at least two data columns. Set the
       Combination Graph Type property to bar, line or area and optionally specify a value
       for the Prompt property. Then set the Combination Graph Type property to bar, line
       or area for the second data column and optionally specify a value for the Prompt
       property. Repeat the latter step for other data columns that you may have.
   •   For a dual-Y combination graph with multiple series of data plotted as a combination of
       graph types against two Y axes, you must map at least two data columns:
            o For the first data column, set the Combination Graph Type property to bar,
               line or area, optionally specify a value for the Prompt property and set the
               Secondary Axis property to True or False.
            o For the second data column, set the Combination Graph Type property to
               bar, line or area, optionally specify a value for the Prompt property and set the
               Secondary Axis property to True or False. Just be sure that at least one
               column has the Secondary Axis property to True.
            o Repeat the latter step for other data columns that you may have.
   •   For a dual-Y (non-combination) graph with multiple series of data plotted as a a single
       graph types against two Y axes, you must map at least two data columns:
            o For the first data column, set the Secondary Axis property to True or False
               and specify an optional value for the Prompt property.
            o For the second data column, specify an optional value for the Prompt property
               and set the Secondary Axis property to True or False. Just be sure that at
               least one column has the Secondary Axis property to True.
            o Repeat the latter step for other data columns that you may have.

364
Oracle Application Framework Developer's Guide, Release 12.1.3


Make certain you have at least one column defined as data, and only one column defined as
groupLabels. If you need to define another column as seriesLabels, select the dataMap
container and choose New > graphData from the context menu. Set the properties as
described above.

Figure 5: Sample structure panel after creating a graph




Notes About Graph Columns

     •    Pie Graphs - Only two columns are required to plot a pie graph: data and groupLabels.
          Values returned by the groupLabels column are plotted as pie slices.
     •    Combination Graphs and Dual-Y Graphs - No column can be mapped as seriesLabel
          since the series have to be derived from the explicitly defined multiple data columns for
          the combination graph, rather than the resulting rows of any view object attribute.
     •    Scatter Graphs - By definition, the two columns, data and groupLabels, required for the
          scatter graph must be number columns.
     •    Legend Labels - The space that a legend area can occupy is one-fourth the size of the
          graph. If there are too many legends, the legend text is truncated and appended with an
          ellipse (...). The legend displayed for a graph is dependent on its graph column
          definitions. There are three possible scenarios from which legend labels can be derived:
               o From static data - If no seriesLabels column is defined for the graph and a
                   column is defined as data, then the value specified in that data column's Prompt
                   property appears as the legend label. Note that if no value is specified for the
                   Prompt property, then the value returned from the data column's View
                   Attribute property is used as the legend label.
               o From query data - If a column is defined as seriesLabels, the values returned
                   from the View Attribute property of this column is used as the legend. If a
                   single data column is also defined, it's Prompt property value, if defined, is
                   ignored.
               o From both query and static data - If a seriesLabels column and multiple data
                   columns, with Prompt property values are defined for a graph, the legend label
                   is a concatenation of the values specified in the Prompt property and the view
                   attribute value returned by the seriesLabels column. For example, if you have 2
                   data columns with Prompt set to Salary and Commission, and one seriesLabels
                   column, returning view attr values of slvaN the concatenation looks like:

                    "Salary, slva1", "Salary, slva2", "Commission, slva1" and "Commission, slva2"




                                                                                                   365
Oracle Application Framework Developer's Guide


Step 6: If you want to add a data table to your graph, select your graphTable region in the
Structure pane, and choose New > tabularFormat from the context menu. OA Extension
automatically creates a table region for you under the tabularFormat container.

Figure 6: Sample structure panel after creating a tabularFormat showing the table created




Step 7: For the data table, you can define new columns in the table or extend from an existing
table. To extend from an existing table, select the table region in the Structure pane, and in the
Property Inspector, set the Extends property to the table you want to reference.

To create a new table, add columns to the table region by selecting the table region and
choosing New > Item from the context menu for each column you wish to create. For each item
(or table column), set the following properties:

     •    Give the item a standards-compliant ID.
     •    Set the Item Style property to messageStyledText.
     •    Set the Prompt property.
     •    Set the View Instance and View Attribute properties.

These table columns should be a superset of the information shown in your graph. For more
information about tables, see Tables - Classic.

Figure 8: Sample structure panel with items in table




Runtime Control

To complete your graph implementation:

Step 1: Create a controller and associate it to your graphTable region in the Property Inspector
by specifying the controller name in the Controller Class property.



366
Oracle Application Framework Developer's Guide, Release 12.1.3


Warning: It is mandatory for the view object associated with the graph to be executed. If it is
not executed, a runtime exception is thrown.

Step 2: In the processRequest method of this controller class, add an initQuery method for
the view object you defined for the graph. Any parameters that are set must be bound before
executing the query.

Step 3: Add an initGraphQuery() method (you may name this whatever you would like) to
the application module you defined for your Graph web bean. In this method, call your view
object's initQuery() method. For example:



public void initGraphQuery()

  {

    PositionGraphVOImpl vo = getPositionGraphVO1();



      if (vo == null)

        {

       MessageToken[] tokens = { new
MessageToken("OBJECT_NAME","PositionGraphVO1")};

        throw new OAException("ICX",
"FWK_TBX_OBJECT_NOT_FOUND",tokens);

        }



    // Per Back Button guidelines, never do a blind query without
first checking

      // to see if it's necessary.



      if (!vo.isPreparedForExecution())

        {

         vo.initQuery();

        }

                                                                                           367
Oracle Application Framework Developer's Guide


  } // end initGraphQuery()

Step 4: In your controller's processRequest method, invoke the AM's initGraphQuery()
method.

Destination URI

You can programmatically define a destination URI on a graph, that allows users to drill down to
additional information. If the Destination URI property is defined on a graph, the URI
specified is used as the drill-down URL. The Destination URI can be an absolute URL or a
relative URL to an OA Framework page. The group and series values for each data point are
appended to the specified destination URI, so that the resulting URL is specifically associated to
a particular data point plotted in the graph. The group and series values can be obtained by the
destination page using the parameters OAGgroup and OAGseries.

For the drill down feature to work, you must also set the Display Data Bubble Text
property on the graph to True. Enabling this property generates an image map, which is
required for the drill-down feature to work. When a user selects any data point in the graph, the
specified URL is launched.

The following sample code can be added to the processRequest method in your controller if
you wish to programmatically set the drill-down property:

       //for FWK_TEST_GRAPHSERVLET -Programmatic test for drill
       down and image map
       if(webBean.getUINodeName().equals("region2"))
       {
         OAGraphTableBean g1 = (OAGraphTableBean)webBean;
         //Test -If image map is disabled, drill down should not
       work
         g1.setDisplayToolTip(0,false);
         g1.setDrillDownUrl(0,"http://www.oracle.com");
       }

       //Test image map and drill down
       if(webBean.getUINodeName().equals("region3"))
       {
         OAGraphTableBean g2 =(OAGraphTableBean)webBean;
         g2.setDisplayDataMarkers(0, true);
         g2.setDrillDownUrl(0,
       "OA.jsp?page=/oracle/apps/ak/pages/FWK_TEST_AGR_SUM&akRegio
       nApplicationId=601&sal={@Salary}");
         //Test line graph with data markers and drill-down
         g2.setDisplayToolTip(1,true);
         g2.setDisplayDataMarkers(1, true);
         g2.setDrillDownUrl(1,"http://www.oracle.com");
       }

Laying Out Graphs in a Matrix


368
Oracle Application Framework Developer's Guide, Release 12.1.3


A matrix layout for graphs provides you with better layout control when you need to display
multiple graphs on a page. Rather than lay out multiple graphs one below the other, you can
better utilize the layout of the page by displaying the graphs in a matrix. Although the number of
graphs that can be displayed in a row can be set to any valid number, you should follow the
BLAF UI guidelines carefully to avoid creating pages that require too much horizontal scrolling.
To lay out your graphs in a matrix:

Step 1: Follow the instructions described in the Declarative Implementation and Runtime Control
sections to define more than one graph.

Step 2: In OA Extension, select your graphTable region and set the following properties on this
region:

    •    Graph Render Style - set to graph.
    •    Graphs per Row - set to the number of graphs you wish to display in each row of the
         matrix.

Example

Suppose you define five graphs in your graphTable region and you set Graph Render Style
to graph and Graphs per Row to 2 on the region. When the region renders, it will display two
graphs in the first row, two graphs in the second row, and one graph in the third row.

Note The matrix layout for graphs is not applicable if Graph Render Style is set to
both. When this property is set to both, only one graph displays beneath the data table,
along with a poplist of available graphs.

Personalization Considerations

    •    See a summary of Charts and Graphs personalization considerations in the Oracle
         Application Framework Personalization Guide.

Known Issues

    •    None

Charts

Declarative Implementation

To add a Gantt chart to your page, follow these instructions.

Figure 9: Sample of completed Gantt chart




                                                                                                 369
Oracle Application Framework Developer's Guide




Note: All code that you write (and declare) must comply with the OA Framework Standards
and Guidelines in Chapter 8. Please pay special attention to the performance standards.

Step 1: Create an application module for your Gantt chart web bean, if a root UI application
module does not already exist. If a root UI application module exists, your work can be done
there, or you can create a new application module and nest it within your root UI application
module.

Step 2: Create 2 view objects and 1 view link for your Gantt chart, and then add them to the
application module discussed in Step 1. The first view object should query the Project/Task
Name list. For example, it may look like this:



       SELECT project_id, name, start_date, completion_date,

          start_date start_from, 'summary' task_type,

          completion_date end_to, '' text_right

       FROM pa_projects_all

       WHERE project_id in (2667, 2225)

The second view object should query the details of each task. For example, it may look like this:

370
Oracle Application Framework Developer's Guide, Release 12.1.3




        SELECT project_id, top_task_id, task_id,

            task_number, task_name, scheduled_start_date start_from,

          scheduled_finish_date end_to, task_manager_name
        text_right,

          decode(scheduled_start_date, scheduled_finish_date,
        'milestone',

          decode(top_task_id, task_id, 'summary', 'normal'))
        task_type

        FROM pa_tasks_v

The view link should link the tasks (first view object) with the task details (second view object),
as shown in the example below:

Figure 10: Example of View Link SQL




Step 3: Add your Gantt chart to a page. Select the parent region in the JDeveloper Structure
panel, then choose New > Region from the context menu (note that you can alternatively create
this as a reusable region). Set the following properties on the new region:

    •   Give the region a standards-compliant ID.
    •   Set the Region Style property to gantt.
    •   The following property values are examples, and are set based on values from our
        sample view objects shown above.
           o Set the Task Start Date View Attribute property to the attribute that
                returns the start date for the marker. In the example shown in Step 2, this would
                be the StartFrom view attribute.


                                                                                                 371
Oracle Application Framework Developer's Guide


          o   Set the Task End Date View Attribute property to the attribute that
              returns the end date for the marker. In the example shown in Step 2, this would
              be the EndTo view attribute.
          o   Set the Axis Start Date View Attribute property to the attribute that
              returns the start date for the axis. In the example shown in Step 2, this would be
              the StartDate view attribute.
          o   Set the Axis End Date View Attribute property to the attribute that
              returns the end date for the axis. In the example shown in Step 2, this would be
              the CompletionDate view attribute.
          o   Set the Bar Type View Attribute property to the attribute that returns the
              task type for the chart. In the example shown in Step 2, this would be the
              TaskType view attribute. This is from the standard task types, or any additional
              custom task types you have added.
          o   Set the Right Text View Attribute property to the attribute that returns
              the text shown to the right of the marker. In the example shown in Step 2, this
              would be the TextRight view attribute.
          o   There are additional properties we don't use in this example, they are:
                   Left Text View Attribute property is for any text added to the left
                      of the marker.
                   Completed Through View Attribute property is the date that
                      designates how much progress has been completed on a task.
                   Percent Complete View Attribute property is the percentage of
                      task complete. Ignored if non-null value is returned for the Completed
                      Through View Attribute property. If null is returned for both
                      properties, the progress bar will not be shown.
                   Actual Start Date View Attribute property is used for variance
                      task types, and is the start date for the actual bar.
                   Actual End Date View Attribute property is used for variance
                      task types, and is the end date for the actual bar.
                   Baseline Start Date View Attribute property is used for
                      variance task types, and is the start date for the baseline bar.
                   Baseline End Date View Attribute property is used for variance
                      task types, and is the end date for the baseline bar.
                   These following properties are not used in this example but allow you to
                      define dependency lines in the Gantt chart. In order to draw dependency
                      lines, a unique ID needs to be assigned to every task in the Gantt chart.
                      For each task that has a dependency on other tasks, the task IDs of those
                      other tasks must be set as predecessors of the original task. This
                      relationship is defined as a view link.
                           Show Dependency Lines - set to True to render dependency
                              lines. The default is False.
                           Task ID View Attribute - specify the view attribute name
                              that returns a unique task ID.
                           Predecessor Accessor - specify the acessor name in the view
                              link for getting the rowset which contains predecessors.
                           Predecessor View Attribute - specify the view attribute in
                              the predecessor rowset for getting the task ID of a predecessor.




372
Oracle Application Framework Developer's Guide, Release 12.1.3


                       Note You must have a working Gantt chart before you add
                       dependency lines to the Gantt chart.

   •   Set the Auto Scale property to true or false. false is recommended as you set your
       own scaling with the Axis Major and Axis Minor properties. When set to true, the
       Axis Major and Axis Minor properties are ignored.
   •   Set the Axis Major property to days, weeks, months, quarters, half-years, or years.
   •   Set the Axis Minor property to days, weeks, months, quarters, half-years, or years.
   •   Set the Show Current Date property to true or false.
   •   Set the Show Bubble Text property to true or false.

Step 4: At this point, it is important to refer back to Figure 1, and reacquaint yourself with the
fact that a Gantt chart is essentially composed of 2 components. The timeline side of the Gantt
chart is driven off of the Gantt web bean. The project/task list side of the chart is a HGrid
component. You have just created the timeline side, now you must create the HGrid for the
project/task list side.

Select the gantt region in the Structure pane, and choose New > Tree from the context menu to
create a HGrid tree component. For more information, refer to the HGrid tree component
documentation.

   •   Give the region a standards-compliant ID.
   •   Set the Text property to an appropriate value for the column header of your project/task
       list. For example, use Project/Task Name.
   •   Beneath your tree component, a member category is created, along with an initial item in
       that category labeled as nodeDef1. Set the properties for nodeDef1. This node is going
       to be the first column you want to add to your HGrid side. In our example, this is the
       Project/Task Name data from the first view object.
   •   Set the View Instance property to your first view object.
   •   Set the View Attribute property to the appropriate attribute from your first view
       object. For example, in our example, this would be Name.
   •   Set the Text property to an appropriate value for the column header of your project/task
       list. For example, use Project/Task Name.
   •   Add a new item to the member category. Right-click on members, and select New >
       childNode. The childNode is going to provide the means to link the tasks with the task
       details through the view link you created. The childNode is labeled as childNode1.
   •   Set the View Link Instance property of childNode1 to your view link instance. Be
       sure to use the instance, not just the view link name.
   •   Add a new item to the childNode1 category. Right-click on childNode1, and select New
       > members. There are 2 items created, nodeDef2 and childDef2. For our example, set
       nodeDef2, and ignore childDef2 as it is not needed.
   •   Set the View Instance property to your second view object's second instance. This
       sounds a bit confusing, however, when you add your view link to your application
       module, both a view link instance (usually VLname1), and a second instance of your
       base view object (usually VOname2) is created. Since we are tying the data together
       through the view link, the view object Instance that you must use in this reference is the
       one used by the view link.
   •   Set the View Attribute property to the appropriate attribute from your first view
       object. In our example, you would set it to TaskName.

                                                                                               373
Oracle Application Framework Developer's Guide


    •    Finally, because the test data for the Gantt chart resides in another database, change
         your project settings. Select your project, choose Project Settings from the context
         menu, then navigate to Common > Oracle Applications > Runtime Connection.
         Change the following settings to reflect the location of your test data:
            o DBC File Name
            o Username
            o Password
            o Responsibility Key

Attention: If you intend to support the Export feature on a Gantt chart, then different
viewAttributeNames cannot be used at different levels in the hierarchy column (Project). All
levels of the hierarchy column (that is, all nodeDefs) should have the same
viewAttributeName. This is analogous to the definition of all other columns of a HGrid or
Gantt. This restriction does not apply if the Export feature is not being used.

Step 5: To define table actions, select your gantt region in the Structure pane of OA Extension.
Display the context menu and under New, choose the tableActions. This automatically creates
a tableActions named child consisting of a flowLayout region.

Step 6: Specify a standards-compliant ID for the region and leave the Region Style as
flowLayout or set it to rowLayout.

Suggestion If you have only buttons to add to the table actions area, then you can use
either layout styles, flowLayout being preferrable. However, if you are adding message web
beans such as messageChoice or messageTextInput, along with buttons to the table action
area, then you should use the rowLayout style. Using a flowLayout instead of a rowLayout
in this case may cause alignment problems.

Step 7: Under the Layout region, layout the children you want to render as table actions, such
as submitButton or messageChoice. Select the Layout region, and choose New > Item from the
context menu. Select the new Item that is created and set the item style as appropriate.

Enabling Search on a Gantt Chart

You can enable the ability to search the HGrid component of the Gantt chart. Refer to the
Enabling Search on an HGrid section of the Chapter 4: HGrid topic for detailed steps on how to
accomplish this.

Usage Notes

Usage in Non-screen reader mode

There is a named child under the gantt component, and it is called descriptionColumns.

Figure 11: Example of descriptionColumns named child




374
Oracle Application Framework Developer's Guide, Release 12.1.3




This named child allows developers to specify information to be displayed for replacing the
graphical component in screen reader mode.

Developers can specify as many messageStyledText items as they need beneath it.

There is an additional property, Render Description Columns, on the gantt component.
Developers can set it to true for rendering Description columns. This can be useful even in non-
screen reader mode for people with poor vision.

Figure 12: Example of 1 description column and Render Description Columns set to true.




If the Render Description Columns property is set to true, and there are no description
columns defined, the gantt bean generates a default description for you.

Figure 13: Example of a default generated description




                                                                                                  375
Oracle Application Framework Developer's Guide




Partial Page Rendering (PPR) in a Gantt Chart

If you map an updateable column in a Gantt chart to a view attribute that is used for drawing the
Gantt chart, PPR can be enabled so that you can automatically refresh the Gantt chart. For
example, suppose you add a messageTextInput item to a gantt region and its view attribute is
also the "start date" view attribute for drawing the Gantt chart. When a user changes the date in
the column, the Gantt chart is automatically re-drawn to reflect that date.

Adjusting the Width of the Gantt Chart

OA Framework does not support adjusting the width of a Gantt chart by any means. Even
though the Gantt chart is based on the HGrid component (which does allow you to set the
width), you should not attempt to alter the width of a Gantt chart by any programmatic means as
this may cause distortion of the right image column. For example, if you alter the width of the
Gantt chart to 100%, which ties it to the width of the browser, the Gantt chart time line gets
distorted when you start to alter the dimensions of the browser window.

Runtime Control

To complete your Gantt chart implementation:

Step 1: Create a controller and associate it with your Gantt chart's parent region.

Step 2: Add an initQuery() method to the first view object you used for your Gantt chart.

Step 3: Add an initGanttQuery() method (you may name this whatever you would like) to
the application module you used for your graph. In this method, call your view object's
initQuery() method. For example:



376
Oracle Application Framework Developer's Guide, Release 12.1.3


public void initGraphQuery()

    {

        TaskListVOImpl vo = getTaskListVO1();

        if (vo == null)

        {

      MessageToken[] tokens = { new
MessageToken("OBJECT_NAME","TaskListVO1")};

        throw new OAException("ICX", "FWK_TBX_OBJECT_NOT_FOUND",tokens);

        }



     // Per Back Button guidelines, never do a blind query without
first checking

        // to see if it's necessary.



        if (!vo.isPreparedForExecution())

        {

            vo.initQuery();

        }



    } // end initGanttQuery()



Step 4: In your controller's processRequest method, invoke the application module's
initGraphQuery() method.

Adding Dependency Lines

If you wish to add dependency lines to your Gantt chart, you should add them declaratively. If
you must add them programmatically, you can do so by adding similar lines of code to the
processRequest method of your controller:


                                                                                             377
Oracle Application Framework Developer's Guide




myGanttChart.setDependencyLinesVisible(true);

myGanttChart.setPredecessorsAccessorName("ParentPredecessorsVO");

myGanttChart.setTaskIdViewAttributeName("TaskId");

myGanttChart.setPredecessorsViewAttributeName("TaskId");

Using FireAction on the Project Column

If you want to configure the hierarchy (Project) column of a Gantt chart to perform a form submit
when selected, see the Using FireAction on the Hierarchy Column section of the Chapter 4:
HGrid topic.

Using Save Model on the Hierarchy Column

If you wish to implement a Save Model ("Warn About Changes" dialog with links), on the
hierarchy column of the Gantt chart, you must code it manually, by including the following code
example:



OATreeDefinitionBean webBean = ...
webBean.setAttributeValue(WARN_ABOUT_CHANGES, Boolean.TRUE);

Per Row Dynamic Poplist

OA Framework provides programmatic support for the implementation of a choice list (poplist or
pulldown) in an updatable Gantt chart, such that its poplist values can vary on a row-by-row
basis.

Refer to Dynamic Poplists in Standard Web Widgets for programmatic instructions.

Optimizing Child Row Retrieval

When any given level of a Gantt chart is rendered, the rendering engine must first determine
whether the node is expandable so that it can render the Expand icon if necessary. To do this,
the rendering engine checks whether the node has children by using the Gantt chart's BC4J
view links. This translates to firing the detail view object query just to check for the presence of
children, which for large Gantt charts, can be a serious performance drain.

Using treeChildPresentVOAttr

Since data models in Oracle E-Business Suite often have a master row level attribute that keeps
track of the presence or absence of children, you can optimize performance in this case. You
can instruct the Gantt chart to use this attribute instead of firing a detail view object query to
determine whether the expansion icon needs to be rendered. In order to do this, set the

378
Oracle Application Framework Developer's Guide, Release 12.1.3


treeChildPresentVOAttr attribute on the <oa:childNode> in the metadata.
Unfortunately, since this attribute is currently not supported in metadata, you must set this
attribute programatically on the
oracle.apps.fnd.framework.webui.beans.nav.OATreeChildBean, which is the
runtime web bean corresponding to <oa:childNode>. For example:



OATreeChildBean.setChildPresentVOAttr(String childPresentVOAttr)

The String parameter in this case is the name of a master view object row attribute that returns
"Y" or "N" to indicate whether there are any children.

Important: All Applications should use this feature to avoid unnecessary queries against
the database.

Using treeLevelChildCountAttr

Some Oracle E-Business Suite data models also maintain information about the number of
children of a master row, at the master row itself. If you have such an attribute available, you
may use it instead of treeChildPresentVOAttr. The treeLevelChildCountAttr has
two advantages:

   •   You can use this attribute to determine whether a node has children and hence, whether
       an expansion icon needs to be rendered for a node.
   •   For a Gantt chart that uses record navigation, when a node is expanded, you can use
       this attribute to properly adjust the record navigation links ("Previous" and "Next") without
       triggering the fetch of all rows being displayed.

In order to do use this attribute, set the treeLevelChildCountAttr attribute on the
<oa:nodeDef> in the metadata. Unfortunately, since this attribute is currently not supported in
metadata, you must set this attribute programatically on the OATreeDefinitionBean, which
is the runtime web bean corresponding to <oa:nodeDef>. For example:



OATreeDefinitionBean.setChildCountVOAttr(String childCountVOAttr)

The String parameter in this case is the name of a master view object row attribute that returns
an oracle.jbo.domain.Number indicating the number of children. Note that this number
must match the number of rows actually returned by the detail view object query.

Personalization Considerations

   •   See a summary of Charts and Graphs personalization considerations in the Oracle
       Application Framework Personalization Guide. Also, see a summary of Standard Web
       Widgets personalization considerations if you plan to implement a dynamic poplist in a
       Gantt chart.


                                                                                                379
Oracle Application Framework Developer's Guide


Known Issues

   •   None

Related Information
   •   BLAF UI Guideline(s)
   •   Javadoc
          o oracle.apps.fnd.framework.webui.beans.layout.OAGraphTableBe
             an
   •   ToolBox Tutorial Lessons
   •   ToolBox Tutorial Sample Library




380
Oracle Application Framework Developer's Guide, Release 12.1.3



Dynamic User Interface
Overview
OA Framework allows you to implement dynamic pages using declarative techniques. This
document describes the following in response to user actions, security grants and data state.

    •    Partial Page Rendering (PPR)
    •    Component-Based Function Security
    •    Table Content Switchers

Partial Page Rendering
As described in the Oracle Browser Look-and-Feel (BLAF) UI Guideline: Partial Page Rendering
(PPR) [ OTN Version ], Partial Page Rendering (PPR) is a means by which designated parts of
a page -- as opposed to the whole page -- are refreshed when the user performs certain
actions. When PPR is enabled, UIX issues requests including the list of any partial page refresh
targets. The response includes only these nodes, which are then redisplayed on the page. PPR
technology doesn't require any Javascript to achieve the dynamism; it is built in to the
components that support it.

For example, when the user selects a Show More Search Options Hide/Show link, the
associated content refreshes using PPR as illustrated in Figure 1:

Figure 1: example of PPR refresh behavior for the Hide/Show component.




In OA Framework, PPR technology is automatically implemented for the following components
and actions. Assuming the prerequisites listed later in this document are satisfied, the targets of
these actions are rendered using PPR.


                                                                                                381
Oracle Application Framework Developer's Guide


   •   Table (data set navigation, sorting, totaling, row insertion, row and cell-level Hide/Show
       toggling)
   •   Hide/Show (toggling)
   •   HideShowHeader (toggling)
   •   List of Values field (populating LOV input)

You can also declaratively define your own PPR events for selected components. For example,
you can:

   •   Configure the selection of a poplist to cause related fields to render, be updateable, be
       required, or be disabled based on the selected value.
   •   Configure the value change of a text field to set related field values. For example, set a
       Supplier value and tab out, the dependent Supplier Site defaults automatically.
   •   Configure the selection of a master table's singleSelection radio button to automatically
       query and display related rows in a detail table.

Contents

   •   Implementing Partial Page Rendering Events
   •   Back Button Behavior
   •   Programming Alternatives to PPR
   •   Changing UI Properties
   •   PPR and Tables
   •   Cascading Data Changes
   •   Coordinating Master/Detail Tables
   •   PPR Event Queuing
   •   PPR Auto-Tabbing
   •   PPR Debugging

Implementing Partial Page Rendering Events

You can declaratively enable PPR events for the following item styles:

   •   resetButton
   •   link
   •   singleSelection
   •   messageCheckBox
   •   messageTextInput
   •   messageChoice
   •   button
   •   selectionButton
   •   submitButton
   •   radioSet
   •   radioGroup
   •   radioButton
   •   updateable Gantt chart columns mapped to a view attribute used for drawing the Gantt
       (see Charts and Graphs for additional information after you read this document)
   •   subtabs (see Sub Tab Navigation for additional information after you read this
       document)


382
Oracle Application Framework Developer's Guide, Release 12.1.3




When the user selects a PPR enabled clickable source item (and the item's internal ON-CLICK
event is fired), or changes the data value in a messageTextInput (its internal ON-CHANGE
event fires), OA Framework sets the PPR event name for the request parameter named "event."

Prerequisites

For partial page rendering to work, the following prerequisites must be satisfied:

   •   Any bean to be partially refreshed must have an associated ID, either set declaratively
       in JDeveloper or specified when calling createWebBean() programmatically). This ID
       must be unique on the page.

       Tip: UIX does not render IDs for rawText (OARawTextBean) items. To refresh the content
       in a rawText item, first add it to a stack layout or other region, then make this containing
       region the refresh target.

   •   Your web bean hierarchy must remain unchanged for the life of the page. In other words,
       build the page to include all conditionally displayed components, then use the technique
       described below to map the Rendered property to a special "application properties"
       view object. Do not programmatically add or remove components from the hierarchy.
   •   The user's browser must support iFrame (currently, Microsoft Internet Explorer 5.5+,
       Netscape 6+, Mozilla and so on). For other browsers, full page rendering is used.
   •   The user must not use browser-based autocomplete mechanisms (such as Google
       Suggest), as these interfere with PPR and cause the user to see error messages.
   •   The FND: Disable Partial Page Rendering profile option must be set to No. If this profile
       value is set to Yes, a Go button renders next to each item you configure to raise a PPR
       event.
   •   Note: PPR is not supported on the mobile platform.

Back Button Behavior

When using the browser Back button, PPR behavior varies according to the browser's cache
setup as well as the sequence of user actions. For example, a user navigates from Page A to
Page B. On Page B, they perform an action which generates a PPR refresh (this page is now in
a "B1" state). They then perform "n" number of PPR actions so the page renders in a "Bn" state.

   •   If the user navigates from Bn to Page C and then selects the browser Back button, they
       should return to Page Bn. This is assuming that the application module was retained and
       the page is regenerated from the server. If the page is regenerated locally from the
       browser's cache, the behavior is undefined.
   •   If the user is on page Bn (after performing "n" PPR actions) and selects the browser
       Back button, the behavior is undefined. In all likelihood, it will take the user "n" back-
       button clicks, (amount equal to the number of PPR actions performed), to return to the
       last page they visited before the PPR page -- in this case, Page A.




                                                                                               383
Oracle Application Framework Developer's Guide


       Note: The user can access only one state of the previous page. Although they cannot go
       back to the intermediate PPR states, the user may need to click the browser Back button
       more than once to go back to the previous page.

Programmatic Alternatives to PPR

Previously, if a page needed to change in response to user actions, such as executing a search
or pressing a button, you typically handled the initiating event in a processFormRequest()
method, then issued a JSP forward back to the same page so that web bean hierarchy changes
in processRequest() could be made.

With PPR, this is no longer necessary for most UI changes. Whenever possible, leverage the
declarative PPR features instead of the programmatic solution.

Javascript remains a prohibited technology for Oracle's internal E-Business Suite developers
(see Implementing the Controller: Javascript).

Changing UI Properties

Assuming you've added an item to your page with a style in the list above, the following
instructions describe how to configure it to generate PPR events to control the properties of
related items. For example, hide or show appropriate fields when a poplist value changes. You
can use the industry-standard Simplest Possible Expression Language (SPEL) binding () to
declaratively bind the values of certain properties to view object attributes.

Tip: Rendered, Read Only, Disabled, and Required are the only properties for which
SPEL bindings can be defined. To control other properties, use bound values. For example,
use an oracle.apps.fnd.framework.webui.OADataBoundValueViewObject to bind a
property to a view object attribute.

Note: To change page properties based on a user's List of Values selection, follow a
different procedure. See Use the LOV as a Context Switcher in the List of Values document
for specific instructions after you read this document.

Step 1: Select your item in the JDeveloper Structure pane and set the following properties:

   •   Action Type - set to firePartialAction to enable a PPR event. (The default value
       is none).
   •   Event - set to the name of the event that OA Framework puts on the request when a
       PPR action occurs. (The default value is update).
   •   Note: OA Framework doesn't impose any restrictions on the event name.
   •   Parameters - To pass parameters for firePartialAction, select the ... button in
       the Parameter property to open a Parameters window, then in the Parameters window,
       specify the name and value of each parameter that you want to pass. The values can be
       static text or bound values using SPEL syntax, such as:




384
Oracle Application Framework Developer's Guide, Release 12.1.3


       ${oa<viewInstanceName>.viewAttributeName>}

   •   Submit - set to True for the PPR action to submit the form; or False for the PPR action
       to perform an HTTP GET request. In both instances the event is handled in your
       processFormRequest() method.
   •   Note: False is not a supported value. However, you may experiment with it.
   •   Disable Client Side Validation - set to True if you don't want client side
       validation to be performed when the PPR event is fired.
   •   Note: This applies only if the PPR item is configured to perform a form submit. See
       Implementing the Controller: Disabling Validation for additional information.
   •   Disable Server Side Validation - set to True if you don't want server-side
       validation errors to be displayed. See Implementing the Controller: Disabling Validation
       for additional information.

Step 2: Create the items whose property values should be set in response to the PPR event.
For example, assume you have several text fields whose Rendered and Read Only
properties are determined by a poplist value. Create these messageTextInput items and
configure their standard properties.

Note: UIX currently does not support the ability to hide components whose direct parent
region is a cellFormat or a rowLayout. As a workaround, to hide a component such as a
button in a cellFormat, add flowLayout to your cellFormat region first, then add the button
to the flowLayout.

Additionally, if the target component that you want to effect with the PPR event is a table
content switcher, you must add a flowLayout to your table, then add the switcher region to the
flowLayout region. Configure the flowLayout region's properties as described in Step 4 below,
and not the switcher's properties.

Step 3: In the same package where you created the page's root UI Application Module and any
UI-specific view objects, create a special application properties view object. Add this view object
to your page's root UI application module or, if you're implementing PPR in a shared region,
associate this view object with the shared region's application module.

Note: This view object should follow the naming convention of: ApplicationModuleName
PVO. Therefore, an application properties view object created for an EmployeeAM should
be named EmployeePVO. Furthermore, each application module should have no more than
one application properties VO.

   •   Add a Number primary key transient attribute named RowKey. (A default value of 1 will
       be set in Step 7 below). Select the Key Attribute checkbox.
   •   Add one or more transient attributes for the properties that you want to set in response
       to PPR events.
   •   Configure the view object so that all the transient attributes are passivated. (This is the
       default configuration). See OA Framework State Persistence Model (Passivation) for
       additional information about passivation.
   •   Verify that all the attributes are designated as Updateable Always.



                                                                                               385
Oracle Application Framework Developer's Guide


The transient attributes should be of the following types based on the properties to be set in
response to PPR events. Note the list of corresponding valid values for reference when you
write code to set these attribute values.

Property             Attribute Data       Valid Values
                     Type
Required             String                   •   yes
                                              •   no
                                              •   uiOnly
                                              •   validatorOnly

Read Only            Boolean                  •   Boolean.TRUE
                                              •   Boolean.FALSE

Rendered             Boolean                  •   Boolean.TRUE
                                              •   Boolean.FALSE

Disabled             Boolean                  •   Boolean.TRUE
                                              •   Boolean.FALSE


For example, in the ToolBox Sample Library, we created a SampleBrowserPVO (associated
with the SampleBrowserAM) with the following transient attributes:

   •   PoApproveReadOnly
   •   PoApproveRequired
   •   PoApproveRender
   •   PoApproveReject

Although these transient attributes serve a specific purpose, they should be as abstract as
possible to allow use by several different components within a page or shared region. For
example, the PoApproveReadOnly property listed above is intended to be referenced by
several different components when the PO approval status changes. This approach is more
abstract than creating a VO property specifically intended to control the updateable property of
"component X."

Note: Individual attributes should not be set and referenced by multiple pages; each
attribute should be used exclusively within a single page. Since each application module
has only one application property view object, and a single root UI application module can
be associated with many pages, your application property VO may include attributes for
several pages.

Step 4: Open the JDeveloper property inspector for each of the PPR event target items you
created in Step 2. Set the Rendered, Read Only, Disabled and/or Required property
values to bind to the view object attributes you created in Step 3 using the following SPEL
syntax:



386
Oracle Application Framework Developer's Guide, Release 12.1.3


${oa.<ViewInstanceName>.<ViewAttributeName>}

For example, in the ToolBox Tutorial Sample Library, a text field has its Rendered property
configured to:

${oa.EmployeePVO1.PoApproveRender)

Step 5: In the application module that contains your application properties view object, add a
method to set the application property values. For example, in the ToolBox Tutorial Sample
Library we have a method called handlePoApprovaChangeEvent() that reads the current
value of the PPR event source poplist from the page's underlying entity object, and sets the
appropriate property values as shown:



public void handlePoApproveChangeEvent()

{

  // Get the special, single-row application properties and make the
first

    // (only) row current.

    OAViewObject vo = (OAViewObject)findViewObject("SampleBrowserPVO1");

    OARow row = (OARow)vo.first();



  // Get the value of the view object attribute with the PO Approval
status.

  OAViewObject poVO =
(OAViewObject)findViewObject("PurchaseOrderHeadersVO1");

    OARow poRow = (OARow)poVO.getCurrentRow();

    String status = (String)poRow.getAttribute("StatusCode");



  // Set the application property values based on the PO Approval
status value.

    if ("APPROVED".equals(status))

    {


                                                                                              387
Oracle Application Framework Developer's Guide


      row.setAttribute("PoApproveRender", Boolean.TRUE);

      row.setAttribute("PoRejectRender", Boolean.FALSE);

      row.setAttribute("PoApproveReadOnly", Boolean.TRUE);

      row.setAttribute("PoApproveRequired", "yes");

  }

  else if ("REJECTED".equals(status))

  {

      row.setAttribute("PoApproveRender", Boolean.FALSE);

      row.setAttribute("PoRejectRender", Boolean.TRUE);

  }

  else

  {

      row.setAttribute("PoApproveRender", Boolean.TRUE);

      row.setAttribute("PoRejectRender", Boolean.TRUE);

      row.setAttribute("PoApproveReadOnly", Boolean.TRUE);

      row.setAttribute("PoApproveRequired", "no");

  }

} // end handlePoApproveChangeEvent()

Step 6: In an appropriate controller for handling the PPR event source item's actions, add code
to the processFormRequest() method to detect the PPR event and invoke the application
module method you created in Step 4. The ToolBox Sample Library's controller for the purchase
order approval poplist includes the following code.

Note: This example is checking for two different PPR events. The second is described
below in Coordinating Master/Detail Tables.



public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)


388
Oracle Application Framework Developer's Guide, Release 12.1.3


{

    super.processFormRequest(pageContext, webBean);

    OAApplicationModule am =

        (OAApplicationModule)pageContext.getApplicationModule(webBean);



    String event = pageContext.getParameter("event");



  // If the user changes the value of the po approval poplist, call
the

    // event handler in the AM to set the appropriate SampleBrowserPVO

    // values.



    if ("poApproveChange".equals(event))

    {

        am.invokeMethod("handlePoApproveChangeEvent");

    }

    else if ("supplierSelect".equals(event))

    {

        am.invokeMethod("handleSupplierSelectionEvent");

    }

} // end processFormRequest()

Tip: If PPR is disabled (the FND: Disable Partial Page Rendering profile value is Yes),
this same code executes when the user selects the PPR event source item's Go button.

Step 7: In the application module that contains your application properties view object, add a
method to initialize this view object (if this application module already has a page initialization
method, simply add this code to it). For example, in the ToolBox Sample Library we have a
method called initializePPRExamplePage() that automatically creates a purchase order
header EO and initializes the application properties VO:

                                                                                                 389
Oracle Application Framework Developer's Guide




public void initializePPRExamplePage()

{

    // Create purchase order header

    ...



    OAViewObject appPropsVO =

        (OAViewObject)findViewObject("SampleBrowserPVO1");



    if (appPropsVO != null)

    {

    // If the VO already has a row, skip its initialization.           Note
that

    // calling getFetchedRowCount() won't perform a DB hit on a VO
with

        // no SELECT and only transient attributes.



        if (appPropsVO.getFetchedRowCount() == 0)

        {

            // Setting the match fetch size to 0 for an in-memory VO

            // prevents it from trying to query rows.

            // Calling executeQuery() is a small workaround to a known

            // BC4J issue that ensures that modified rows in this

            // transient view object are not lost after commit.   See

            // View Objects in Detail for additional information about

            // both of these calls.

390
Oracle Application Framework Developer's Guide, Release 12.1.3




          appPropsVO.setMaxFetchSize(0);

          appPropsVO.executeQuery();



          // You must create and insert a row in the VO before you can
start

          // setting properties.



          Row row = appProposVO.createRow();

          appPropsVO.insertRow(row);



          // Set the primary key value for this single-row VO.

          row = (OARow)appPropsVO.first();

          row.setAttribute("RowKey", new Number(1));



      }



      // Initialize the application properties VO (and the UI) based on
the

      // default PO approval value set on the underlying object.

      handlePoApproveChangeEvent();

 }

 else

 {

      // throw exception

 }

                                                                                     391
Oracle Application Framework Developer's Guide


} // end initializePPRExamplePage()

Step 8: In your page's processRequest() method, invoke the application module page
initialization method you created in Step 7. For example:



public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

{

    super.processRequest(pageContext, webBean);



    OAApplicationModule am =

      (OAApplicationModule)pageContext.getApplicationModule(webBean);

    am.invokeMethod("initializePPRExamplePage");



} // end processRequest()

PPR and Tables

You can also fire row-level PPR events for items in a table, including advanced tables and table-
in-table. First and foremost, configure the items as described above.

Note: If you are working with a table-in-table or HGrid that uses view links, you need to
modify your SPEL syntax as shown: ${oa.current.viewAttrName}. The inclusion of
current keyword lets you say "get the value from whatever row BC4J is using to render the
current row" since you won't know how to access the view objects and row sets created
dynamically for these complex components.

To ascertain in which row the column's PPR event was fired, add the following code to your
processFormRequest method:



public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)

{

    super.processFormRequest(pageContext, webBean);


392
Oracle Application Framework Developer's Guide, Release 12.1.3




    OAApplicationModule am =

        (OAApplicationModule)pageContext.getApplicationModule(webBean);



    String event = pageContext.getParameter("event");



    if ("<ItemPPREventName>").equals(event))

    {

        // Get the identifier of the PPR event source row



        String rowReference =


pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE
);



        Serializable[] parameters = { rowReference };



    // Pass the rowReference to a "handler" method in the application
module.



        am.invokeMethod("<handleSomeEvent>", parameters);

    }

}

In your application module's "handler" method, add the following code to access the source row:



OARow row = (OARow)findRowByRef(rowReference);


                                                                                           393
Oracle Application Framework Developer's Guide


if (row != null)

{

    ...

}

Cascading Data Changes

Use one of the following recommendations when managing cascading data changes during a
PPR request:

    •     If the cascaded data change is dependent on more than one EO attribute, then this
          validation/resolution and final setting of the dependent attributes should be in the
          validateEntitiy() method. This is because BC4J does not guarantee the order in
          which the EO attributes are set. See the Update/Validate section of the Java Entity
          Objects document for more information.
    •     Perform the necessary validation/resolution of dependent attributes in the
          setAttribute() method and set the dependent attributes. See the following example.

          Note: If this attribute is an editable field, this newly set value may be overwritten by the form
          data that is being processed.

To update data values when the user changes the value in a given field, such as if the user
specifies a supplier value you want to set the default supplier site, follow these instructions:

Step 1: Configure a messageTextInput item to issue a PPR event (see Step 1 in Changing UI
Properties above). When the data value changes and a PPR event is fired, OA Framework sets
the selected data on the underlying view object.

Step 2: Assuming the underlying view object is based on an entity object, the entity object setter
associated with the PPR source item should implement the logic to call the setters on the
associated target entity object attributes. For example, in a purchase order header the
setSupplierID() method calls the SupplierEOImpl's Entity Expert to obtain the ID for its
default supplier site, which it then passes to the setSupplierSiteID() method.

Note: In some circumstances, you may want to suppress this behavior in your entity object.
For example, when loading data from an XML file and both the supplier and site IDs are
specified. This is currently an open design issue; contact the OA Framework team if you
need assistance.

To cascade data in a region whose items have no data source, such as (a search criteria
region, set the downstream item values directly in your controller. You can still invoke a custom
method on the application module that asks a static Entity Expert for information on what value
to set, and returns this value to the controller. Whenever possible, all data-related logic should
be consolidated in the entity objects and their experts.



394
Oracle Application Framework Developer's Guide, Release 12.1.3


See the OA Framework ToolBox Tutorial for a complete, working example of cascading data
changes.

Note: If you want a poplist to automatically reflect changes to its data as a consequence of
a PPR event, you must specify the Picklist View Instance when you define it (also set
by calling setPicklistViewUsageName()) and not the Picklist View Definition
(also set by calling setPicklistViewObjectDefinitionName()). This will not work if
you choose to create a poplist that is cached in the JVM.

Coordinating Master/Detail Tables

To automatically display rows in a detail table based on the selection of a row in a master table,
and the tables are displayed on the same page, follow these instructions to comply with the
BLAF Master/Detail Page Template [ OTN Version ]:

Step 1: If you have not already done so, create an application properties view object as
described above.

Step 2: Add a String attribute to your application properties view object. Give it a name like
DETAIL_TABLE_TEXT. Set this value dynamically to display a contextual title for the details
table as shown in Figure 2. In this example from the ToolBox Sample Library, when the user
selects a supplier from the master table, the contextual title for the details table indicates that it
is displaying supplier sites for the selected supplier.

Figure 2: Example of Master / Detail Tables




Step 3: Create a message in Message Dictionary to be used for the details table title. It should
include a token for the master table unique (user) identifier. For example: &SUPPLIER_NAME:
Supplier Sites. Also, create a generic message to display when no master rows are
selected. (In this case, we want to display Supplier Sites).

Step 4: Create the master and detail view objects, then configure a view link between them as
described in Implementing the Model: View Objects and View Links. Add the master and detail
view objects (with the detail view object accessed via the view link) to the page's application



                                                                                                   395
Oracle Application Framework Developer's Guide


module. Finally, add an updateable, transient "SelectFlag" column to the master view object to
use as a data source for the table's singleSelection radio button item.

Step 5: Create the master table as you normally would (see the Advanced Tables
documentation for additional information) and include a singleSelection component. Bind the
items to the master view object you created in Step 4, and configure the singleSelection item to
issue a PPR event (see Step 1 in Changing UI Properties above).

Step 6: Create the detail table and bind it to the detail view object that you created in Step 4.

Step 7: Add a method to the page's application module to handle the singleSelection choice.
This code must find a selected row in master view object's data set and simply mark it as the
current row. Because of the view link configuration, BC4J automatically queries the detail view
objects. This logic also updates the application properties DetailTableText attribute value
based on the current master row.

For example:



import oracle.apps.fnd.common.MessageToken;

import oracle.apps.fnd.framework.OAViewObject;

import oracle.apps.fnd.framework.server.OADBTransaction;

...



public void handleSupplierSelectionEvent()

{

    OADBTransaction txn = getOADBTransaction();

    String detailTableText = null;



    // Find the selected radio button so we can mark the current row

    OAViewObject vo = (OAViewObject)findViewObject("SuppliersVO1");



    Row row = vo.getFirstFilteredRow("SelectFlag", "Y");



396
Oracle Application Framework Developer's Guide, Release 12.1.3


  // This check assumes getFirstFilteredRow returns null if

  // it finds no matches.

  if (row != null)

  {

      // Set the master row and get the unique identifier.

      Row masterRow = row;

      vo.setCurrentRow(masterRow);

      String supplierName = (String)masterRow.getAttribute("Name");



    MessageToken[] tokens = { new MessageToken("SUPPLIER_NAME",
supplierName)};



      detailTableText =

       txn.getMessage("AK", "FWK_TBX_SITES_FOR_SUPPLIER", tokens);

  }

  else

  {

      // If there is no selected row, display a default generic message.

      detailTableText =

       txn.getMessage("AK", "FWK_TBX_SUPPLIER_SITES", null);

   }



  // Now set the text message on the DETAIL_TABLE_TEXT attribute in

  // the application properties VO.




                                                                                    397
Oracle Application Framework Developer's Guide


  SampleBrowserPVOImpl appPropsVo = getSampleBrowserPVO1();

  Row appPropsRow = appPropsVo.getCurrentRow();



  if (appPropsRow != null)

  {

      appPropsRow.setAttribute("DetailTableText", detailTableText);

  }

} // handleSupplierSelectionEvent()

Step 8: In your root application module's initialization method where you configured your
application properties view object, call the event handler you created in Step 7. This ensures
that the header text renders properly when the page first displays before the user makes a
selection. For example, in the ToolBox Sample Library, we have the following initialization logic
that calls the handleSupplierSelectionEvent() method.



...

  OAViewObject appPropsVO =
(OAViewObject)findViewObject("SampleBrowserPVO1");



  if (appPropsVO != null)

  {

  // This checks the in-memory cache (doesn't cause a database hit).

  // If the VO doesn't include a row yet, create and insert one.



  if (appPropsVO.getFetchedRowCount() == 0)

      {

          // Calling executeQuery() is a small workaround to a known

          // BC4J issue that ensures that modified rows in this


398
Oracle Application Framework Developer's Guide, Release 12.1.3


          // transient view object are not lost after commit.                 See

          // View Objects in Detail for additional information about

          // both of these calls.



          appPropsVO.setMaxFetchSize(0);
           appPropsVO.executeQuery();



          appPropsVO.insertRow(appPropsVO.createRow());



          // Set the primary key value for this single-row VO.

          OARow row = (OARow)appPropsVO.first();

          row.setAttribute("RowKey", new Number(1));

      }



  ...



  // Initialize the header text for the supplier sites detail table.

  handleSupplierSelectionEvent();



...

Step 9: In an appropriate controller for your master table, add code to
processFormRequest() to detect the radio button selection and invoke the application
module method that marks the current row in the master data set.

Step 10: Add the following processRequest() logic to your controller to bind the child table
header's Text property to a specially created attribute in the application properties VO.




                                                                                           399
Oracle Application Framework Developer's Guide


import oracle.apps.fnd.framework.webui.OADataBoundValueViewObject;

import oracle.apps.fnd.framework.webui.OAWebBeanConstants;

import oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean;

...



public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

{

    ...



    // This also works with an advanced table.

    OAHeaderBean header =

      (OAHeaderBean) webBean.findIndexedChildRecursive("<RegionName>");

    header.setAttributeValue(OAWebBeanConstants.TEXT_ATTR,

           new OADataBoundValueViewObject(header, "<AttributeName>",


"<AppPropertiesViewInstanceName>");

    ...

}

PPR Event Queuing

By default, when a PPR event fires, all subsequent events on the page are queued and
processed. For example, a page has a text input field configured to fire a PPR event when the
user leaves and also has a Submit button. The user makes a change to the data in the text
input field and then selects the Submit button. In this case, the text field's PPR event fires and
the button click is queued. After receiving the PPR response, the Submit action is performed.

Note: To disable this feature, set the value of the profile
FND_PPR_EVENT_QUEUE_DISABLED to Y. In this case, when a PPR event fires, all
subsequent events on the page are ignored.



400
Oracle Application Framework Developer's Guide, Release 12.1.3


To implement event queuing on a specific page, add the following code to the
processRequest() of that page. The default behavior is then enabled for only that page:



import oracle.apps.fnd.framework.webui.beans.OABodyBean;



...



public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

{

    super.processRequest(pageContext, webBean);



    OAWebBean body = pageContext.getRootWebBean();



    if (body instanceof OABodyBean)

    {



    body.setFirstClickPassed(true);

    }

    ...

    ...

}

PPR Auto-Tabbing

By default, when you tab out of a text input field that triggers a partial page rendering event, the
focus moves to the next field on the page. If the profile option
FND_PPR_DISABLE_AUTOTABBING is set to 'Y', the focus will not be saved during ppr and
the focus handling is left to browser. Currently, tabbing out of a PPR enabled field in Mozilla


                                                                                                 401
Oracle Application Framework Developer's Guide


takes the focus to next focusable item but in Internet Explorer (IE) it remains in the same field.
The default for this profile option is 'N'.

PPR Debugging

The PPR Debugging feature is used to see the changes in the partial targets. By default, the
PPR Debugging is disabled. This feature can be enabled by setting the value of the profile
option FND_ENABLE_PPR_DEBUGGING to Y. (See the PPR section of the Profile Options
document for more information about this option). When the PPR debugging feature is enabled,
the partial targets are displayed at the top of the screen as the page renders.

Known Issues

   •   None

Personalization Considerations

   •   None

Component-Based Function Security
You can also configure item properties using function security and the same SPEL syntax that
you use to bind item properties to the "application properties" view object. Read Implementing
Partial Page Rendering Events before reading this section.

Currently, you can control the following item properties using this approach:

   •   Rendered
   •   Read Only
   •   Disabled
   •   Required

Note: This section does not describe how to create menus, functions, or grants; it assumes
you know what they are and how to create them. For additional information about these
topics, see Tabs / Navigation and Page Security.

Step 1: Create a function with a name that describes the rule you want to implement. For
example, you have a text field whose Read Only property should be True if the user does not
have access to the SUPPLIER_READ_ONLY function when logged in using the BUYER
responsibility.

Step 2: Create a grant for this function. In this example, we would create a function grant for
SUPPLIER_READ_ONLY in the context of the responsibility BUYER.

Step 3: Create the items whose Read Only property should be set based on the state of this
security grant. Set the Read Only property using the following SPEL syntax:

${oa.FunctionSecurity.<FunctionName>}

402
Oracle Application Framework Developer's Guide, Release 12.1.3


The test will return False if <FunctionName> is granted to the current user/responsibility;
otherwise True.

In this example, we would set the Read Only property to:

${oa.FunctionSecurity.SUPPLIER_READ_ONLY}

If the user is logged in to the BUYER responsibility and has been granted access to this
function, OA Framework returns False in the function security test. When the Read Only
property is set to False, the item is updateable.

Expressions and Test Results

The following table summarizes the properties you can set and the corresponding results that
OA Framework sets as the property's value.

Propert Property Internal Expression                       Test Result
y        Name
Rendere RENDERED_ATT ${oa.FunctionSecurity.<myFunctionNa Returns True if
d        R                me>}                             <myFunctionNam
                                                           e> is granted,
                                                           otherwise False.
Read     READ_ONLY_AT ${oa.FunctionSecurity.<myFunctionNa Returns False if
Only     TR               me>}                             <myFunctionNam
                                                           e> is granted,
                                                           otherwise True.
Disabled DISABLED_ATTR ${oa.FunctionSecurity.<myFunctionNa Returns False if
                          me>}                             <myFunctionNam
                                                           e> is granted,
                                                           otherwise True.
Require REQUIRED_ATT ${oa.FunctionSecurity.<myFunctionNa Returns no if
d        R                me>}                             <myFunctionNam
                                                           e> is granted,
                                                           otherwise yes. *

* To set one of the other two Required property values (uiOnly or validatorOnly), you must
configure the Required property to bind to a String attribute in the application properties VO,
and in this attribute's getter, call function security and return the desired property based on the
security test result.

Table Content Switchers
Unlike an Application or Context Switcher, which is a UI control that allows a user to switch the
application or page context to display, a table content Switcher is a region with two or more
display alternatives. The display alternatives are predefined items of which only one is
selectively rendered at any given time.


                                                                                               403
Oracle Application Framework Developer's Guide


If your table column is a Switcher, then you can:

   •   Assign a header label for the column by setting the OA Extension Prompt property for
       each Switcher nested region item.
   •   Enable sorting for the item by setting the OA Extension Initial Sort Sequence
       property for each Switcher nested region item. OA Framework determines the view
       attribute to sort by using the following list, in order of precedence:
            1. Sort By View Attribute of the Switcher nested region item.
            2. Sort By View Attribute of the selected child region item, that is, the
               named child of the switcher that is selected by the decode SELECT statement.
            3. View Attribute of the selected child region item.

       Note: Do not use the View Attribute of the Switcher Nested Region item for sorting
       because it simply determines which named child is selected.

Switcher Usage

Limit the use of Switchers to within tables, advanced tables, or HGrids, particularly when you
want to switch between different kinds of web beans, such as a poplist or a checkbox, or when
you want to switch between different images. Although you can technically use a Switcher
(OASwitcherBean) outside a table, instead use SPEL binding for the Rendered property of
the content that you want to conditionally display.

The image switching case is demonstrated in the ToolBox Tutorial Delete Lab. The tutorial
example creates an employee table that contains a Delete column. The Delete column allows
you to delete employees from the table, depending on the status of the employee - if the
employee is active, the Delete icon is enabled, otherwise it is disabled. However, to meet
accessibility standards, ALT text is associated with the enabled icon as well as the disabled
icon. At runtime, to be able to display the enabled Delete icon, with its ALT text, or the disabled
Delete icon with its appropriate ALT text, the tutorial uses the convenience of a table content
Switcher to switch between the two distinct sets of attribute values for the same web bean type.

Using bound values instead of a Switcher in this case, would bind the image source of the
Delete icon to a view object attribute to get the image file name, and bind the ALT text to
another view object attribute to get the ALT text for the image.

You can implement a Switcher declaratively by defining two or more items representing your
display alternatives and adding these to a Switcher region within your parent table.

When exportByViewAttr is set on a switcher level, instead of depending on the datatype of
the component rendered, OA Framework exports the value based on the sqldatatype
(database). For example, the datatype of a component can be either DATE or DATETIME. If the
datatype is DATE, only the date is exported and if the datatype is DATETIME, both the date and
the time are exported. However, when basing values on the database, the sqldatatype can be
either DATE or TIMESTAMP and both contain date and timestamps, (such as DD-MM-YYYY
hh:mm:ss). In either case, both the date and the time are exported.

Declarative Implementation


404
Oracle Application Framework Developer's Guide, Release 12.1.3


Step 1: To add a Switcher to a table region, update the SQL query for the table region's view
object to include a "Switcher" column or attribute. The Switcher attribute must return the name
of the conditionally displayed item or region to render. Remember that a Switcher region can
contain two or more nested region items as display alternatives. You can add this "Switcher"
attribute to your view object by including a DECODE statement in your SELECT statement. The
DECODE statement determines which child item name to return.

For example, in the ToolBox Tutorial Delete Lab, a Delete column is added to a results table in
the Employee search page. The Delete column is a Switcher region that can either display the
enabled Delete icon and its ALT text or the disabled Delete icon and its ALT text. The
underlying EmployeeSummaryVO query includes the following DECODE statement to
determine whether the employee can be deleted based on the employee's status:



decode(nvl(to_char(EmployeeEO.END_DATE), 'N'), 'N','DeleteDisabled',

  'DeleteEnabled') AS DELETE_SWITCHER

Step 2: Create a Switcher region, by right-clicking your table region in the Structure pane and
selecting New > switcher from the context menu. Select the Switcher region and update the
following properties in the Property Inspector with these values:

   •   ID - <the name of the Switcher region>. Set in accordance with the OA Framework File
       naming standards
   •   Item Style - switcher
   •   Prompt - <the label that appears in the table column>
   •   Rendered - True
   •   View Instance - <name of the underlying the view instance>
   •   View Attribute - <name of the "Switcher" attribute that you added to the view object
       in Step 1>

Step 3: Right-click the default Switcher case that JDeveloper created for you and select New >
Item or New > Region from the context menu.

   •   Select the item/region and update the ID property with the OA Framework File
       Standards.

       Note: The ID must match the corresponding SQL DECODE function return value that
       determines when this item or region should be displayed. For example, if you are creating a
       Switcher for the ToolBox SQL snippet shown above, the image item that you define for the
       disabled Delete icon will have its ID set to DeleteDisabled.

   •   Configure other properties as needed for your item or region.

Step 4: Add additional cases to represent display alternative for the Switcher region. Right-click
the Switcher region in the Structure pane and select New > case from the context menu.
Configure your item or region as described in Step 3, and repeat as necessary until all display
alternatives are defined.

                                                                                               405
Oracle Application Framework Developer's Guide


Step 5: (Required only if you add images to a Switcher in a classic table) You must manually
center align the images as shown in the code example below:



import oracle.cabo.ui.data.DictionaryData;

import oracle.cabo.ui.data.DataObjectList;

import oracle.apps.fnd.framework.webui.beans.table.OATableBean;

...



public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

{

    // Always call this first.

    super.processRequest(pageContext, webBean);



    // This controller is associated with the table.

    OATableBean table = (OATableBean)webBean;



  // We need to format the Switcher image column so the image is
centered

    // (this isn't done automatically for Switchers as it is for

    // plain image columns). We start by getting the table's

    // column formats.



  // NOTE!!! You must call the prepareForRendering() method on the
table *before*

  // formatting columns. Furthermore, this call must be sequenced
*after* the


406
Oracle Application Framework Developer's Guide, Release 12.1.3


  // table is queried, and *after* you do any control bar
manipulation.

  // We need to get a handle to the table so we can set it's width to
100%.



    table.prepareForRendering(pageContext);



    DataObjectList columnFormats = table.getColumnFormats();

    DictionaryData columnFormat = null;

  int childIndex = pageContext.findChildIndex(table,
"DeleteSwitcher");

    columnFormat =(DictionaryData)columnFormats.getItem(childIndex);

    columnFormat.put(COLUMN_DATA_FORMAT_KEY, ICON_BUTTON_FORMAT);

}

Runtime Control

There are no programmatic steps necessary to implement a Switcher region. However, if you
wish to set a default case for a Switcher region, you can do so programmatically by calling the
following oracle.cabo.ui.beans.SwitcherBean API:



public static void setDefaultCase(MutableUINode bean,

    java.lang.String defaultCase)

Usage Notes

    •   If the view object associated with a switcher returns a value for a case that does not
        match any of the existing cases, then:
             o If a default case is defined, the default case renders. See the Runtime Control
                 section for more information.
             o If a default case is not defined, a developer mode error is thrown.
    •   For a table or HGrid web bean, you can display a named child under a switcher.
        However, if the switcher's view attribute returns a value that does not match the named
        child's name, nothing renders (that is, the switcher region is blank). You can use this
        behavior to your advantage, such that you do not need to define any additional spacer
        bean if you purposely do not want anything to display for a case.

                                                                                             407
Oracle Application Framework Developer's Guide


   •   If ExportByViewAttr is set on the switcher level, the datatype of the exported value
       will depend on the sqldatatype and not the datatype of the component rendered.

Personalization Considerations

   •   See a summary of Dynamic User Interface personalization considerations in the Oracle
       Application Framework Personalization Guide.

Related Information
   •   BLAF UI Guidelines
          o Partial Page Rendering (PPR) [ OTN Version ]
          o Master / Detail Page Template [ OTN Version ]
   •   Javadoc Files
          o oracle.cabo.ui.beans.SwitcherBean
          o oracle.apps.fnd.framework.webui.beans.OASwitcherBean
   •   OA Framework Developer's Guide
          o OA Framework State Persistence Model (Passivation)
          o OA Framework File Standards
          o Classic Tables
          o Advanced Tables
          o Tabs / Navigation
   •   OA Framework ToolBox Tutorial / Sample Library
          o ToolBox Tutorial Partial Page Rendering (PPR) Lab
          o ToolBox Tutorial Delete Lab (table switcher)
          o oracle/apps/fnd/framework/toolbox/sampleLib/webui/PartialPa
             geExamplePG.xml
          o oracle/apps/fnd/framework/toolbox/sampleLib/webui/PartialPa
             geExampleCO.java
          o oracle/apps/fnd/framework/toolbox/sampleLib/server/SampleBr
             owserAMImp.java
          o oracle/apps/fnd/framework/toolbox/sampleLib/server/SampleBr
             owserPVO.xml




408
Oracle Application Framework Developer's Guide, Release 12.1.3



Concurrent Processing: Request Submission
and Monitoring
Overview
The Concurrent Processing Request Submission and Monitoring user interfaces are available
as OA Framework-based pages. The Request Submission flow includes multiple pages that
steps the user through submitting a specific program or allowed programs (based on their
responsibility) to run. The Request Monitoring (Viewing) flow includes pages that allow users to
search for and view their concurrent requests.

Oracle Application Object Library provides a seeded menu that contains the standard functions
for Request Submission and Monitoring. The internal name for this menu is FND_REQUESTS
(user menu name is "Requests"), and contains the standard seeded functions
FNDCPSRSSSWA and FNDCPVIEWREQUEST. You can add this menu to your application if
you want to utilize these functions. Alternatively, as this document describes, you can create
your own functions to launch Request Submission and Monitoring from your application.

Note: This document assumes you are familiar with the Concurrent Processing feature.
Refer to the Oracle E-Business Suite User's Guide or Oracle E-Business Suite System
Administrator's Guide if you need further information.

Contents

   •   Adding Request Submission to Your Product
          o Declarative Implementation
                   Configuring Request Submission with Optional URL Parameters
   •   Adding Request Monitoring to Your Product
          o Declarative Implementation
                   Configuring Request Monitoring with Optional URL Parameters
          o Runtime Control
   •   Personalization Considerations
   •   Known Issues
   •   Related Information

Adding Request Submission to Your Product
The Standard Concurrent Request Submission flow takes place across the following six pages
with a train implementation:

   •   Program Name - allows the user to select the program to submit. It contains a required
       field called Program Name.
   •   Parameters - if the program has required parameters, this page is displayed, otherwise,
       it is skipped.
   •   Schedule - allows the user to schedule when the program runs. It contains the default
       scheduling of "As Soon As Possible".


                                                                                             409
Oracle Application Framework Developer's Guide


   •   Notifications - allows the user to optionally send notifications to designated users when
       the request completes.
   •   Printer - allows the user to optionally specify printing options with the configured
       request.
   •   Summary - displays a summary of submitted requests.

With Oracle E-Business Suite, you can restrict some of the train steps that a user must navigate
through to submit a concurrent request. You can configure request submission within your
application such that some of the information required for a request is pre-entered. End-users
need only enter a limited amount of data specific to a current request. As a result, you can hide
some of the pages described above from the end-user, because they are no longer necessary.

Declarative Implementation

To call the first page of Request Submission from your application, registering your function in
the Form Functions form with the following URL parameters in the HTML Call field:

akRegionCode=FNDCPPROGRAMPAGE

akRegionApplicationId=0

Note: The FND seeded function name that contains these parameters is
FNDCPSRSSSWA.

Configuring Request Submission with Optional URL Parameters

If you wish to restrict some of the pages in the Request Submission flow, you can do so by
specifying the following parameters in the URL that you specify in the HTML Call field of the
Form Functions form:

   •   requestURL = <URL value>

       URL Value is the page to which you want the user to be redirected to when the user
       selects Cancel or when the request is submitted. If this parameter is not specified, the
       user is redirected to the View Requests page.

   •   programApplName =<program application short name>&
       programName=<program short name>

       Use these parameters to allow your users to submit a specific program from your
       application without having to enter a program name. If these parameters are specified by
       the calling application, the Request Submission Program Name page will render without
       the Program Name LOV. The Program Name field will instead display as a text-only
       item showing the program specified.

   •   programDesc=<program description>




410
Oracle Application Framework Developer's Guide, Release 12.1.3


      Use this parameter to provide a description to your request. The description appears as
      Request Name on the Request Submission Program Name page. You can later
      search for requests based on the supplied request name (description).

  •   programRegion=Hide

      Use this parameter to hide the Program Name page during request submission. Note
      that if you specify this parameter, you must also indicate the program name to submit by
      coding the calling application to provide the programApplName and programName
      parameters.

  •   parameterRegion=Hide

      If the program you are configuring to submit does not require any parameters, you can
      specify this parameter with the value 'Hide'. This parameter hides the Parameters page
      during request submission.

  •   scheduleRegion=Hide

      If you do not want to allow users the option of scheduling the request submission,
      specify this parameter with the value 'Hide' to hide the Schedule page. By default, if the
      Schedule page is hidden, the request is submitted with the schedule, "As Soon As
      Possible".

  •   notifyRegion=Hide

      Specify this parameter with the value 'Hide' to hide the Notification page during request
      submission.

  •   printRegion=Hide

      Specify this parameter with the value 'Hide' to hide the Printer page during request
      submission.

  •   pageTitle=<page title>

      Specify this parameter to set the page title for the Request Submission flow.

Examples

  1. To launch the full Request Submission flow:




      HashMap parameters = new HashMap();
      String url = "OA.jsp";
      parameters.put("akRegionApplicationId", "0");
      parameters.put("akRegionCode", "FNDCPPROGRAMPAGE");


                                                                                             411
Oracle Application Framework Developer's Guide


   2. To launch the Request Submission flow specifically for the Active Users program
      (program short name=FNDSCURS):




      HashMap parameters = new HashMap();
      String url = "OA.jsp";
      parameters.put("akRegionApplicationId", "0");
      parameters.put("programApplName", "FND");
      parameters.put("programName", "FNDSCURS");
      parameters.put("programDesc", "Some Description");

   3. To launch the Request Submission flow specifically for the Active Users program
      (FNDSCURS), such that the program is submitted with default values only (that is, you
      do not want the user to provide any information in the request submission):




      HashMap parameters = new HashMap();
      String url = "OA.jsp";
      parameters.put("akRegionApplicationId", "0");
      parameters.put("akRegionCode", "FNDCPPROGRAMPAGE");
      parameters.put("programApplName", "FND");
      parameters.put("programName", "FNDSCURS");
      parameters.put("programDesc", "Some Description");
      parameters.put("programRegion", "Hide");
      parameters.put("parameterRegion", "Hide");
      parameters.put("scheduleRegion", "Hide");
      parameters.put("notifyRegion", "Hide");
      parameters.put("printRegion", "Hide");




parameters.put("requestMode", "DEFERRED");
parameters.put("requestId", <req id>);



if (pageContext.getParameter("uploadCat") != null)
  {
    try
      {
        // get the JDBC connection
        Connection conn = (Connection)

            ((RequestAMImpl)pageContext.

             getApplicationModule(webBean)).getDBConnection();
          ConcurrentRequest cr = new ConcurrentRequest();

412
Oracle Application Framework Developer's Guide, Release 12.1.3


         // set it as deferred request mode.
         cr.setDeferred();
         // call submit request
         int reqId = cr.submitRequest(progAppl, progName, desc,

          scRSTime, false, para);

         dbTran.commit();



         // redirect page to Request Scheduling page



        com.sun.java.util.collections.HashMap parameters = new
HashMap();



         String url = "OA.jsp";
         parameters.put("akRegionApplicationId", "0");
         parameters.put("akRegionCode", "FNDCPPROGRAMPAGE");
         String id = "" + requestId + "";
         parameters.put("requestMode", "DEFERRED");
         parameters.put("requestId", id);



         pageContext.setForwardURL(url,

                                     null,

OAWebBeanConstants.KEEP_MENU_CONTEXT,

                                     null,
                                     parameters,

                                     true,

OAWebBeanConstants.ADD_BREAD_CRUMB_NO,

                                     OAWebBeanConstants.IGNORE_MESSAGES);

     }

     catch { ...}
 }



                                                                                 413
Oracle Application Framework Developer's Guide


Adding Request Monitoring to Your Product
The Request Monitoring user interface provides the ability to search for a current user's
requests based on three categories: all requests, completed requests and running requests. It
also allows a user to specify criteria to search for a request based on a specific request ID,
requests for a specific program or a range of scheduled requests.

Using the search results list, a user can select a request to see the details of that request or
view its output file. From the Details page for a request, a user can place a hold on a pending
request, cancel a pending request or view the request's log file.

Declarative Implementation

To call the first page of Request Monitoring from your application, registering your function in
the Form Functions form with the following URL parameters in the HTML Call field:

akRegionCode=FNDCPREQUESTVIEWPAGE

akRegionApplicationId=0

Note: The FND seeded function name that contains these parameters is
FNDCPVIEWREQUEST.

Example

To launch the View Requests page:



OA.jsp?akRegionCode=FNDCPREQUESTVIEWREGION&akRegionApplicationId=0

Configuring Request Monitoring with Optional URL Parameters

If you wish to restrict some of the pages in the Request Monitoring flow, you can do so by
specifying the following parameters in the URL that you specify in the HTML Call field of the
Form Functions form:

   •   printRegion = Hide

       Specify this parameter with the value 'Hide' to hide the Print region in the Request
       Details page, so that users do not see the print information for a request.

   •   requestID =<request id>

       Specify this parameter, to search for a specific request based on the supplied request id.

   •   requestDesc =<request description>


414
Oracle Application Framework Developer's Guide, Release 12.1.3


       Specify this parameter, to search for request(s) based on the supplied request
       description.

   •   startDate =<startdate>

       Specify this parameter, to search for request(s) based on the supplied startdate.

   •   endDate =<enddate>

       Specify this parameter, to search for request(s) based on the supplied enddate.

   •   progApplShortName =<program application short
       name>&progShortName=<program short name>

       Use these parameters to search for requests for a specific program.

Runtime Control

There are no runtime control steps necessary to add request monitoring to your product.

Personalization Considerations
   •   See a summary of Concurrent Processing personalization considerations in the Oracle
       Application Framework Personalization Guide.

Known Issues
   •   None.

Related Information
   •   BLAF UI Guideline(s)
   •   Javadoc File(s)
   •   Lesson(s)
   •   Sample Code




                                                                                           415
Oracle Application Framework Developer's Guide



Content Containers
Overview
Per the Oracle Browser Look-and-Feel (BLAF) UI Guideline Content Containers in Page [ OTN
Version ], content containers are regions with special graphical characteristics (border, shape
and background color) that help set off the information they contain from the rest of the page.
They are often used to hold related information or shortcuts as shown in Figure 1.

Figure 1: Example of content containers used for related information and shortcuts.




Implementation
Content containers can be added to the side of the page in a dedicated column as shown in
Figure 1 (so the page content renders beside them), or within the page content as just another
region. The implementation instructions differ somewhat in each case.

Within Page Content

To add a content container to a region within your page contents:

Step 1: In the JDeveloper structure pane, select the region to which you want to add your
content container, right-click and select New > Region.

Step 2: Specify an ID in accordance with the OA Framework Naming Standards and set the
Region Style to contentContainer.

416
Oracle Application Framework Developer's Guide, Release 12.1.3


Step 3: Set the Text property to the title that you want to display in the content container, and
optionally set the Image URI to the name of the BLAF image you want to display (for example:
bullseyeicon_cctitle.gif).

Tip: See Images in Your Pages for information on using the BLAF icon repository.

Step 4 (optional): By default, content containers render with a light background as shown above.
If you want a different color scheme, set the Background Shade accordingly (valid options are
presented in a list).

Step 5: Set the Width to 100% to ensure that the content container renders fully within the
space allowed.

Step 6: Add regions and items to the contentContainer region as you normally would. For
example, to create the Related Information and Shortcuts content containers shown in Figure 1,
you would first add a bulletedList region to the contentContainer, and then add link items to
the bulletedList.

At runtime, the OA Framework instantiates an
oracle.apps.fnd.framework.webui.beans.layout.OAContentContainerBean.

Beside Page Content

To add a content container to the side of your page:

Step 1: Create a shared region for your content container (see the Shared Regions instructions
in Implementing the View if you need help).

Step 2: Configure your content container region as described above.

Step 3: Instantiate your content container programmatically and add it to the page in the named
"end" area as shown:



public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

{



    // Always call this first.



    super.processRequest(pageContext, webBean);



                                                                                              417
Oracle Application Framework Developer's Guide




    // Instantiate the content container that you defined declaratively.



    OAContentContainerBean content =

        (OAContentContainerBean)createWebBean(pageContext,


"/oracle/apps/fnd/framework/toolbox/samplelib/webui/ContentContainRN",
                            null, // ignore item for regions
                            true); // using OAExtension
  // Get the page layout bean, and specify the content container as
the

    // end content.



    OAPageLayoutBean pageLayoutBean = pageContext.getPageLayoutBean();
    pageLayoutBean.setEnd(content);



}

Note: For information about the "start" and "end" areas in a page (including ensuring that you
have the correct amount of horizontal space between your primary page content and anything
that you render in the start and end areas), see Page Layout (How to Place Content).

Tip: If you want to add multiple content containers to the "end" area, see the Home Page
example in the ToolBox Tutorial / Sample Library. Even though the content containers are fully
constructed programmatically in the example, it will show you how to place them on a stack
layout with vertical space between them. You would follow the same example even if you
instantiated declaratively defined content containers as shown above.

Personalization Considerations
    •    None

Known Issues

418
Oracle Application Framework Developer's Guide, Release 12.1.3


  •   None

Related Information
  •   BLAF UI Guidelines
         o Content Containers in a Page [ OTN Version ]
  •   Javadoc
         o oracle.apps.fnd.framework.webui.beans.layout.OAContentConta
            inerBean
  •   Developer's Guide
         o Bulleted List
         o Related Links / Shortcuts
         o Images in Your Pages
         o Page Layout (How to Place Content)
  •   OA Framework ToolBox Tutorial / Sample Library
         o Home Page Lab
         o oracle.apps.fnd.framework.toolbox.samplelib.webui.BasicStru
            ctPG.xml
         o oracle.apps.fnd.framework.toolbox.tutorial.webui.HomePageCO
            .java




                                                                                419
Oracle Application Framework Developer's Guide



Contextual Information
Overview
In a multipage task flow, it is often helpful to remind users of selection(s) made in previous
pages by displaying static, contextual information at the top of the page. As described in the
Oracle Browser Look-and-Feel (BLAF) UI Guideline: Contextual Information [ OTN Version ] this
standard layout appears as follows:

Figure 1: Double Column Layout Contextual Information Example




Note that, if page-level action/navigation buttons are present, the contextual information should
render in parallel with the top-level buttons (not below them). Furthermore, if page-level
instruction text and/or keys are also present, they should render below the blue separator line
that indicates the end of the contextual information.

Declarative Implementation
To add a contextual information region to your page:

Note: All package, region and item names must comply with the OA Framework Package / File /
Directory standards.

Step 1: Create your pageLayout region as you normally would; be sure to specify the Title
property (represented by the "Page Title" text value in Figure 1).

Step 2: Select your pageLayout region in the Structure pane, right-click and select New >
pageStatus.

    •    JDeveloper automatically creates a pageStatus node and adds a flowLayout default
         region beneath it. Change this region's Style to messageComponentLayout.

Step 3: Set the messageComponentLayout region's Rows and Columns properties as
described in the Page Layout (How to Place Content) document.

    •    For example, for the double column layout shown in Figure 1 above, set both the Rows
         and Columns property values to 2.



420
Oracle Application Framework Developer's Guide, Release 12.1.3


    •    If you want to display two items next to one another, set the Rows property value to 1
         and the Columns property value to 2.

Step 4: Add the items that you want to display in the appropriate sequence. For example, to
achieve the layout shown in Figure 1 above, you would need to add the corresponding items as
shown in Figure 2 below.

Select the messageComponentLayout region, right-click and select New >
messageStyledText. For each messageStyledText item:

    •    Specify an Attribute Set in accordance with the attribute set usage guidelines (see
         Implementing the View for general information about attribute sets, and the OA
         Framework View Coding Standards). This should set the Prompt and Data Type
         values correctly; verify that they are correct.
    •    Set the CSS Class to OraDataText (for display-only data that should render in bold).
    •    Set the View Instance and View Attribute names for the underlying data source.
         Note that you can use a view object that you explicitly query when this page renders, or
         you might bind to a cached row if this page shares a retained application module with a
         previous page.

Figure 2: Contextual Information Item Sequence for the Layout in Figure 1




Step 5: Select your pageLayout region again, right-click and select New > Item. Set this Item
Style to separator.

Step 6: Add remaining items and regions to the pageLayout region as needed for your design.

Runtime Control
There are no particular runtime actions associated with these standard components used in this
particular context, however, remember to execute the underlying query in a
processRequest() method if these fields bind to a task-specific view object (see
Implementing the Model and Implementing the Controller for examples of this).

Also see the Standard Web Widgets documentation for additional information about working
with OAMessageStyledTextBeans, and Page Layout (How to Place Content) for information
about using different layout components.

                                                                                                  421
Oracle Application Framework Developer's Guide


Related Information
   •   BLAF UI Guidelines:
          o Contextual Information [ OTN Version ]
   •   Developer's Guide:
          o Separator
          o Standard Web Widgets
          o Page Layout (How to Place Content)
   •   Javadoc
          o oracle.apps.fnd.framework.webui.beans.layout.OAMessageCompo
             nentLayoutBean
          o oracle.apps.fnd.framework.webui.beans.message.OAMessageStyl
             edTextBean
   •   OA Framework ToolBox Tutorial / Sample Library
          o See the
             /oracle/apps/fnd/framework/toolbox/samplelib/webui/ContextI
             nfoPG in the SampleLibrary.jpr.




422
Oracle Application Framework Developer's Guide, Release 12.1.3



Controlling UIX Rendering Output
Overview
This document describes how to control the look-and-feel and/or facet used to render to your
pages.

   •   A Look-and-Feel (LAF) controls the appearance of an OA Framework application. An
       LAF provides the rendering logic for each component along with a Look-and-Feel-
       specific style sheet. This means that the LAF controls both the content that is generated
       for each component and the visual properties (colors, fonts, borders, etc...) used to style
       the component.
   •   You can also implement optimized variations of the LAF for a specific output medium by
       setting a facet. Facets typically modify the implementation of a small set of components,
       but in general share the bulk of the LAF's rendering code. For example, the printable
       version of a general browser page excludes superfluous navigation and personalization
       controls that would consume space and clutter the printed output. The printable version
       of a page is implemented as a facet.

Contents

   •   Controlling the Look-and-Feel
   •   Controlling the Facet

Controlling the Look-and-Feel
The OA Framework supports three LAFs (note that the first two are standard UIX LAFs while
the third is provided exclusively in the OA Framework):

   •   Oracle BLAF -- implements the Oracle Browser Look-and-Feel (BLAF) UI Guidelines.
   •   Minimum LAF (MLAF) -- generates "minimal" content to reduce the size of HTML
       pages and overall network overhead (for example, this LAF uses fewer images than the
       BLAF version)
   •   Plain Text -- produces a plain text version of the page (typically used to send a plain text
       version of a page to an e-mail client). Note that the plain text LAF does not support all
       the existing component styles.

       Note: In the text rendering mode, the content will be displayed in 'Table Style Layout' if
       the table width is less than page width (the maximum number of characters it can fit)
       else it will be displayed in 'Form Style Layout'.
       The page width in text rendering mode is 80 ,as scrolling and user interaction is not
       allowed in this mode.


The Look-and-Feel of Oracle E-Business Suite application pages is controlled by the Oracle E-
Business Suite Look and Feel profile option. By setting this centrally, customers can choose
which seeded LAF is most appropriate for their uses cases, and they can quickly adopt a new,


                                                                                               423
Oracle Application Framework Developer's Guide


custom LAF. To create a custom LAF or modify an existing custom LAF, use the Customizing
Look and Feel UI.

If you need to control the LAF of a single page, you may do so by setting the
LafConstants.OA_RENDER_LAF (or "OALAF") request parameter using one of the following
values as shown in the example below (note that the OA Framework simply ignores any invalid
values for this and defers in this case to the profile option value, or the default if no profile option
value is specified).

Note: The LafConstants class is in the oracle.apps.fnd.framework.webui.laf
package.

Constant                               Constant       Description
                                       Value
LafConstants.LAF_BLAF                  blaf           Enables Oracle BLAF rendering.

                                                      Note: This is the default LAF.

LafConstants.LAF_MLAF                  minimal        Enables minimal LAF rendering.
LafConstants.LAF_TEXT                  oaText         Enables plain text rendering. The plain text
                                                      renderer should be used primarily to generate
                                                      context suitable for e-mailing to a plain text e-
                                                      mail client. As such, it supports only a very
                                                      small subset of the available UI regions and
                                                      items. These are:

                                                          •   flowLayout
                                                          •   column
                                                          •   header (and all the default* header
                                                              styles)
                                                          •   labeledFieldLayout
                                                          •   messageStyledText
                                                          •   pageLayout
                                                          •   separator
                                                          •   stackLayout
                                                          •   staticStyledText
                                                          •   table

                                                      Note: Any unsupported UI components on
                                                      the page will not be rendered, however,
                                                      warnings will be registered in the log.

Example

This example illustrates how to set the minimal look-and-feel when defining a function's Web
HTML Call.




424
Oracle Application Framework Developer's Guide, Release 12.1.3


OA.jsp?page=/oracle/apps/fnd/framework/toolbox/webui/HelloWorldPG&OALA
F=minimal

Controlling the Facet
UIX (and the OA Framework) supports the following four facets for the HTML LAFs (when you
use the plain text LAF, facets do not apply and are ignored if set).

   •   Default - renders HTML designed for a general purpose browser.
   •   Email - renders HTML suitable for a HTML-capable email client (it makes changes like
       deactivating JavaScript and inlining CSS styles as much as possible).
   •   Portlet - optimizes the imports of CSS style sheets and (where possible) Javascript
       libraries to improve performance when multiple portlets try to load the same style sheets
       and libraries in a single portal page.
   •   Printable - optimizes content for printing.

To enable these facets, set the LafConstants.OA_RENDER_FACET (or "OARF") to one of the
following values as shown in the example below. The OA Framework ignores any invalid values
for this parameter and uses the default facet for HTML LAFs.

Note: The LafConstants class is in the oracle.apps.fnd.framework.webui.laf
package.

Constant                                        Constant        Description
                                                Value
LafConstants.FACET_DEFAULT                      default         The default facet.

                                                                Note: This is the default facet
                                                                that is applied if no parameter
                                                                value is specified, and the LAF
                                                                renders HTML.
LafConstants.FACET_EMAIL                        email           The email facet.

                                                                Use this facet if you want to
                                                                send HTML email (for example,
                                                                the Oracle Workflow Mailer
                                                                uses this facet for
                                                                notifications).
LafConstants.FACET_PORTLET                      portlet         The portlet facet.

                                                                Warning: Do not use this
                                                                facet. The OA Framework Web
                                                                Portlet Provider will enable this
                                                                facet for all OA Framework-
                                                                based portlets.




                                                                                             425
Oracle Application Framework Developer's Guide


LafConstants.FACET_PRINTABLE                 printable    The printable facet.

                                                          Set this parameter to identify a
                                                          printable page.

                                                          Note: The earlier approach of
                                                          naming a "Printable Page"
                                                          button
                                                          "IcxPrintablePageButton" is still
                                                          supported, but setting the facet
                                                          is the preferred approach.

Example

See the Printable Page document for a complete example.




426
Oracle Application Framework Developer's Guide, Release 12.1.3



Custom HTML
Overview
In general, you should avoid using custom HTML and design pages using OA Framework
components if you can, as they meet the NLS, accessibility, security, and Oracle Browser Look-
and-Feel (BLAF) UI guidelines and standards. If you need to write custom HTML, UIX provides
two alternatives that you should use instead of the OARawText bean:

   •   oracle.apps.fnd.framework.webui.beans.OAHTMLWebBean - helps you create
       HTML tags to output text. Although HTMLWebBean creates only one tag, and you would
       have to create a hierarchy of OAHTMLWebBeans to duplicate the HTML achievable with
       oracle.apps.fnd.framework.webui.beans.OARawTextBean, OAHTMLWebBean
       does provide the following added features:
          o Automatic escaping
          o Pretty printing
          o XHTML syntax support
          o Debugging assistance
   •   oracle.apps.fnd.framework.webui.beans.OAFormattedTextBean - helps
       you format text using the generic HTML formatting tags. Note that
       OAFormattedTextBean intentionally cannot accomplish everything that
       OARawTextBean does because it is designed to block cross-site scripting attacks and to
       provide only tags for formatting (and links).

For Oracle's in-house E-Business Suite developers who have to use the RawText bean, you
must get approval from the Oracle BLAF UI team to ensure that your implementation meets UI
standards. Your use of the RawText web bean must also conform to the accessibility, NLS, and
Oracle Application security guidelines.

Displaying PDF Content Inline on Pages

Tip: If you need to display some pdf content that's generated dynamically, we generally
recommend that you use OAMessageDownloadBean instead of displaying the pdf content
inline on a page.

The following sample code, which you should add to your Controller, shows how to display pdf
content inline on a page using OAHTMLWebBean.

Note: You need to cache the generated pdf content in the session in advance. In
DisplayPdf.jsp, retrieve the pdf content from the session, stream it out to the response,
and then remove the cached pdf content from the session.



 OAHTMLWebBean pdfElement =



                                                                                          427
Oracle Application Framework Developer's Guide


  (OAHTMLWebBean)createWebBean(pageContext, HTML_WEB_BEAN, null,
"IFRAME");



//use IFRAME or EMBED

pdfElement.setHTMLAttributeValue("src", "/OA_HTML/DisplayPdf.jsp");



//pdfBlob

// p_output

pdfElement.setHTMLAttributeValue("width", "100%");

pdfElement.setHTMLAttributeValue("height", "500");

Using HTML Tags in Messages

You can insert HTML tags in messages displayed in a message box, inline tip, and dialog page,
and in messages associated with tip region items
(oracle.apps.fnd.framework.webui.beans.OATipBean). You can also create your
own styled text region item with HTML tags in the message text using the formattedText region
item style (oracle.apps.fnd.framework.webui.beans.OAFormattedTextBean).

Internally, all these messages utilize the UIX
oracle.cabo.ui.beans.FormattedTextBean to incorporate the HTML tags.

To see which HTML tags are allowed in FormattedTextBean, refer to the UIX
FormattedTextBean Javadoc. Some notes regarding the FormattedTextBean:

   •   The FormattedTextBean also allows HTML links through the "<a href ...>" HTML
       tag.

       Note: If the HTML link references an OA Framework page, you need to first
       process its URL to retain the session values associated with the current
       transaction so that breadcrumbs can be retained. For example:



       String Url = "OA.jsp?..";

       OAUrl url = new OAUrl(Url);

       Url = OAUrl.createURL(renderingContext);



428
Oracle Application Framework Developer's Guide, Release 12.1.3


       MessageToken [] tokens = {new MessageToken("TOKEN_NAME",
       Url)};

       formattedTextBean.setText(pageContext.getMessage("FND",
       msgName, tokens );

   •   For messages in a message box, inline tip, and dialog page, and for messages
       associated with tip region items, UIX takes care of rendering the message text with the
       proper CSS style. However, if you create a formattedText region item yourself, you also
       need to specify the CSS style yourself. You can do so declaratively by setting the CSS
       Class property in OA Extension or programmatically through the
       OAFormattedTextBean setCSSClass method.

For Messages in a Message Box or Inline Tip:

When you seed your message in the FND_NEW_MESSAGES table, enclose your text in
<html>...</html>.

Example:




<html>User authentication failed.<br>Cause: Invalid password.</html>

Note The inline messages that appear in a rendered table do not reflect HTML tags
properly. Also inline messages displayed in the Netscape browser do not reflect bold text
properly. According to the UIX team, these are known limitations coming from the browser
and operating system. UIX is generating the correct HTML syntax in the html output.

For Messages in a Dialog Page:

Seed your message in the FND_NEW_MESSAGES table with <html>...</html> to enable
HTML tags in the dialog page message.

The dialog page uses OAFormattedTextBean for the description and instruction messages to
enable HTML tags as long as the message text is enclosed in <html>...</html>. The
description message still appears in bold text and the instruction message still appears in plain
text even when HTML tags are enabled. To have better control over what appears as bold, you
can set a null value for the description message and just use the instruction message.

Note The OAFormattedTextBean text itself does not require <html></html> enclosing
tags, but the HTML-enabled messages in the message box and dialog page do. UIX
automatically drops the extra <html></html> upon rendering the formatted text.

Personalization Considerations
   •   See a summary of Custom HTML personalization considerations in the Oracle
       Application Framework Personalization Guide.

                                                                                             429
Oracle Application Framework Developer's Guide


Known Issues
   •   None

Related Information
   •   BLAF UI Guidelines
   •   Javadoc
          o oracle.apps.fnd.framework.webui.beans.OARawTextBean
          o oracle.apps.fnd.framework.webui.beans.OAHTMLWebBean
          o oracle.apps.fnd.framework.webui.beans.OAFormattedTextBean




430
Oracle Application Framework Developer's Guide, Release 12.1.3



Daily Business Intelligence / OA Framework
Integration
Overview
OA Framework and Daily Business Intelligence (DBI) provide support for integration with OA
Framework-based pages.

Launching DBI Dashboards from OA Framework Pages
To launch a DBI Dashboard from OA Framework, parameters must be passed from the OA
Framework-based page to the DBI Dashboard. The instructions in this section describe how to
invoke the DBI Dashboard and map the OA Framework parameters to a corresponding
dimension and dimension level that DBI can interpret.

Declarative Implementation

Create a link in your OA Framework-based page that a user can select to invoke a DBI
Dashboard. Refer to the Buttons (Links) topic in Chapter 4 for information on how to implement
the link.

Runtime Control

Step 1: Programmatically update the controller class of the calling OA Framework-based
transaction page to call the DBI Dashboard. Invoke bisviewp.jsp from the link, with the
following parameters:

   •   pFunction - fnd_form_function.function_name of the PMV function that you
       are invoking. The available DBI dashboard functions are listed below.
   •   pPreFunction - fnd_form_function.function_name of the OA Framework page.
   •   dbc - the dbc file name required by bisviewp to validate the context.

The following sample code illustrates how the controller of an OA Framework-based page is
updated to invoke a DBI Dashboard:



processRequest(OAPageContext pageContext, OAWebBean webBean)

{
 super.processRequest(pageContext, webBean);
 OAApplicationModule am = pageContext.getApplicationModule(webBean);

 StringBuffer link = new StringBuffer(50);



                                                                                             431
Oracle Application Framework Developer's Guide


 //     Please contact your DBI counterpart for details

 //       of a specific DBI dashboard function.
 //     To invoke DBI Dashboards, you must pass the following parameters
to

 //    bisviewp.jsp (the jsp to call):
 // pFunction - fnd_form_function.function_name of the DBI Dashboard
function

 //       that you are invoking.

 // pPreFunction - fnd_form_function.function_name of the OA
Framework

 //       page from which you are calling the DBI Dashboard.

 //     dbc - bisviewp validates the context and this requires the dbc

 //       file name to be sent.



 Link.append("bisviewp.jsp?dbc=").append(am.getDbc)".

      append("pFunction=<DBI Dashboard function>

      &pPreFunction=<Current Page Function>");

 OALinkBean dbiLink =(OALinkBean)createWebBean(pageContext,

      OAWebBeanConstants.LINK_BEAN, null, "dbiLink");



 dbiLink.setDestination(link.toString());
 // Retrieve and set the translated link text.

 String linkText = pageContext.getMessage("ISC", "ISC_FULFILLMENT",

  null);
 dbiLink.setText(linkText);
}

Step 2: Map the parameters from the OA Framework function that is calling the DBI Dashboard
to a dimension and dimension level that DBI can understand. You can create the mappings by
inserting new rows into the BIS_PARAM_DIMENSION_MAP table. The table columns are as
follows:


432
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   function_name - this is the fnd_form_function.function_name for the OA
       Framework function calling the DBI Dashboard.
   •   param_name - this is the name of the parameter that is being mapped.
   •   dimension_level - this is the bis_levels.short_name to which the parameter is
       being mapped. This provides the mapping to the dimension and dimension level.
   •   Application_id - your product Application ID.

For example, to create a mapping entry for the function BIS_TEST_FUNC1 whose parameter
ATTR3 maps to the ORGANIZATION dimension, and the ORGANIZATION dimension level, you
would insert a record into BIS_PARAM_DIMENSION_MAP as follows:



INSERT INTO bis_param_dimension_map ( function_name,

  param_name, dimension_level, application_id )

VALUES ( 'BIS_TEST_FUNC1', 'ATTR3', 'ORGANIZATION', 191);

DBI provides the file BISDIMAP.lct to seed and ship records in this table. Instructions to use this
file are within the first few lines of the file itself.

DBI Dashboard Functions

The following table lists the DBI dashboard functions in DBI Release 7.0.1.

          FUNCTION_NAME                                 USER_FUNCTION_NAME
BIV_DBI_SERV_MGMT_PAGE                    Customer Support Management
ENI_DBI_PMS_PAGE                          Product Management
FII_EXP_MGMT_PAGE_P                       Expense Management
FII_GL_PROFIT_AND_LOSS_PAGE               Profit and Loss
FII_PL_BY_MGR_PAGE                        Profit and Loss by Manager
PJI_OPERATIONS_MGT_PAGE                   Projects Operations Management
PJI_PROFITABILITY_MGT_PAGE                Projects Profitability Management
BIL_BI_SLSMGMT_L                          Sales Management
BIL_BI_OPPTYMGMT_L                        Opportunity Management
BIX_DBI_EMC_PAGE                          Email Center Management
ASO_BI_QUOTE_PORTAL_MAIN                  Quote Management
IBE_BI_STORE_MGMT_LINK                    Store Management
IBE_BI_TOP_ACTIVITY                       Store Top Activity
BIM_I_MKTG_TOP_LEADS                      Top Campaigns and Events by Won Opportunities
                                          Amount

                                                                                               433
Oracle Application Framework Developer's Guide


BIM_I_MKT_TOP_LEAD                   Top Campaigns and Events by Leads
HRI_DBI_OA_LINE_MGR                  HR Management
BIM_I_LEAD_MGMT                      Lead Management
BIM_I_MKTG_MGMT                      Marketing Management
ENI_DBI_PME_PAGE                     Product Management - Engineering
ISC_DBI_CUST_FULF_MGMT_PAGE Customer Fulfillment Management
ISC_DBI_SHIP_MGMT_PAGE               Shipping Management
ISC_DBI_PLAN_MGMT_PAGE               Plan Management
BIL_BI_FRCSTMGMT_L                   Sales Forecast Management
OKI_DBI_SRM_PAGE                     Service Renewals Management
FII_AP_PAY_MGT_OA_PAGE               Payables Management
FII_AP_PAY_STATUS_OA_PAGE            Payables Status
POA_DBI_CSP_OA_MGMT                  Commodity Spend Management
POA_DBI_CS_OA_MGMT                   Commodity Supplier Management
PJI_CAPITAL_COST_MGT_PAGE            Capital Projects Cost Management
POA_DBI_PM_OA_PAGE                   Procurement Management
POA_DBI_P2P_OA_PAGE                  Procure-to-Pay Management
PJI_CONTRACT_COST_MGT_PAGE Contract Projects Cost Management
OPI_DBI_INV_MGMT_PAGE                Inventory Management
OPI_DBI_MFG_MGMT_PAGE                Manufacturing Management
OPI_DBI_PRD_CST_MGMT                 Product Cost Management
OKI_DBI_SCM70_PAGE                   Service Contracts Management
ISC_DBI_REV_BACKLOG_PAGE             Product Revenue Bookings and Backlog
BIX_PMV_AI_PAGE                      Inbound Telephony Management


Personalization Considerations
   •   None

Known Issues
   •   None

Related Information
   •   BLAF UI Guideline(s)
   •   Javadoc File(s)

434
Oracle Application Framework Developer's Guide, Release 12.1.3


•   Lesson(s)
•   Sample Code




                                                                            435
Oracle Application Framework Developer's Guide



Data Export
Overview
As described in the Oracle Browser Look-and-Feel (BLAF) UI Guideline: Export/Import Page
Templates [OTN version], you can implement an Export button that exports data displayed in
one or more regions of an OA Framework page to a file. Export saves the data to a .csv
(comma separated values) file or a .txt (tab separated values) file that you can view in Microsoft
Excel. When you select the Export button, Microsoft Windows opens a dialog box that lets you
view the file either by opening it directly in Microsoft Excel, or by saving it to a designated
directory to open later.

The export file format and encoding is determined by these three profiles:

   •   Export MIME type
   •   FND: NATIVE CLIENT ENCODING
   •   FND: Unicode in Export

Note: The program that is launched while saving exported data is dependent on each
user's PC's setting. To launch a .csv file in Microsoft Excel, the .csv file type needs to be
mapped to open with Microsoft Excel. If you try to open a .csv file that is not mapped to any
program, Microsoft Windows will ask you to choose a program with which to open the file. A
user can easily determine the file to program mapping on their PC by first selecting a .csv
file in Windows Explorer, and then choosing Properties from the right mouse button context
menu for that file. In the General tab of the Properties window, Opens With: lists the
program that can open the selected file.

Only web beans that are rendered on the page are ever exported. If you export data from
multiple regions in a page, each region appears in the export file in a tabular format, with a row
of column names for that region, followed by rows of corresponding values.

Note: Data Import functionality is currently not supported.

Contents

   •   Exporting Data From All Regions On A Page
   •   Exporting Data From a Specific Region On A Page
   •   Personalization Considerations
   •   Known Issues
   •   Related Information

Exporting Data From All Regions On A Page

Declarative Implementation

You can declaratively enable data export for all regions in a page by creating a page-level
Export button. Page-level action buttons, such as Export, render below both the page title and

436
Oracle Application Framework Developer's Guide, Release 12.1.3


the page contents bottom line (the "ski"). If a page title is not specified for the pageLayout
region, the Export button only renders below the page contents bottom line. For more
information, see the Page-Level Buttons discussion in the topic for implementing Buttons
(Action/Navigation).

Step 1: Select your pageLayout region and create a region with the style pageButtonBar
beneath it.

Step 2: Add an item of item style exportButton to the pageButtonBar region to automatically
expose an Export button on the page. If you have more than one button to add to the
pageButtonBar, be sure to add all the buttons in ascending sequence as you want them to
appear from left to right.

When a user selects the Export button, OA Framework exports the data from all the rendered
regions on that page to a .csv file.

Step 3: Generally, when you export data from a page, OA Framework exports the data from the
view object attribute associated with each item in each region. In some cases, when you do not
want to export the data from the view attribute associated with an item, you can specify a
different view attribute to export from, by setting the Export View Attribute property for
that item. If you don't set or set the Export View Attribute property to null, OA Framework
exports data from the view attribute name associated with the item.

An example of using the Export View Attribute is when you have a composite column in
a table. You may have a composite column that consist of a flowLayout region that displays an
image and some text. If you do not want to export the image file name from the composite
column, you can set the Export Attribute Name property for that image item to some other
view attribute from which you want to export data.

Note: When exporting data from a table or advanced table, the data exported may be
different from the data that is displayed in the leaf item of the table column. This may occur
if the leaf item's Export View Attribute property is declaratively set to a different view
attribute than the attribute whose data is displayed.

Note: OA Framework provides limited support for exporting data from a switcher column
under a table or advanced table. If the direct named children of the switcher web bean are
leaf nodes that contain data, then OA Framework can export the data from the appropriate
leaf node. If, however, the direct named children under the switcher web bean are
containers, you must use the Export View Attribute property and add a transient
view attribute to your view object as described in the Runtime Control section in order to
export the data from the appropriate child container.

Attention: If you intend to support the Export feature on a Gantt chart or HGrid, you cannot
use different viewAttributeNames at different levels in the hierarchy column. All levels of the
hierarchy column (that is, all nodeDefs) should have the same viewAttributeName. This is
analogous to the definition of all other columns of a HGrid or Gantt. This restriction does not
apply if the Export feature is not being used.



                                                                                                 437
Oracle Application Framework Developer's Guide


Note: When exporting data from a page, data from hidden fields (FormValue items) or from
the undisplayed child of a switcher region, cannot be exported.

Step 4: Set the Export All Rows property on the exportButton item to True to export all rows
from a table's view object regardless of the view object's setMaxFetchSize value. If the Export
All Rows property is set to False, the total number of rows that can be exported from a table is
defined by its view object's setMaxFetchsize. The default value for this property is False for
existing Export buttons and True for any new Export button.

Runtime Control

There are no general runtime control steps necessary to enable the export of data from a page.

Exporting Data from a Switcher Column in a Table

OA Framework can successfully export data from a switcher column in a table only if the direct
named children of the switcher column are leaf nodes (nodes that consist of data).

If the named children of the switcher column are container web beans (for example, flowLayout
web bean), then you must also perform the following steps to export the data from the child
container:

Step 1: Create a transient view attribute in the view object used for the switcher region. For
example, ExportSwitcherViewAttr in MyVO.

Step 2: In Jdeveloper, set the Export View Attribute property on the switcher region to
the transient view attribute you created in Step 1.

Continuing with the example in Step 1, suppose you have a switcher column in a table that
switches between containers child1 and child2 and you would like to export data from the
CustomerName or CustomerID view attributes under these containers, respectively. The
general XML structure would look similar to the following, with the Export View Attribute
property set to ExportSwitcherViewAttr:



- table region
  - switcher region

      (View Instance = "MyVO1", View Attribute Name =
"SwitcherViewAttr",

         Export View Attribute ="ExportSwitcherViewAttr")
        - header region (case "child1")
          - messageStyledText item

           (View Instance = "MyVO1", View Attribute Name =
"CustomerName")


438
Oracle Application Framework Developer's Guide, Release 12.1.3


        - flowLayout region (case "child2")
          - messageStyledText item

            (View Instance = "MyVO1", View Attribute Name =
"CustomerId")
  - etc.

Step 3: Add code in the getter of your view object row accessor to return the data from the leaf
items of the switcher column's child containers, based on the value of the switcher view
attribute. Following the example in Steps 1 and 2, you would add the following code in the getter
of MyVORowImpl.java:



public String getExportSwitcherViewAttr()
{
  if ("child1".equals(getSwitcherViewAttr()))
    return getCustomerName();
  else if ( "child2".equals(getSwitcherViewAttr()) )
    return getCustomerId();
  return null;
}

Exporting Data From a Specific Region On A Page

Declarative Implementation

To export data from a specific region on a page:

Step 1: Refer to the Oracle BLAF UI Guideline: Export/Import Page Templates [OTN version] for
the placement of the Export button appropriate for the region for which you want to enable
export. For example, if you are enabling export for a table region, the Export button should
render as a right-justified global table button, above the table control bar, but beneath the table
header.

Step 2: In the OA Extension xml Structure pane, determine where you want to position the
Export button for your region and create a new region item of item style exportButton.

Step 3: Set the View Instance name for the exportButton region item to the same view object
associated with the region for which you are enabling export. This ties the Export button to the
correct data source.

Attention: Make sure you do not associate the same view instance to multiple regions
within the page that you want to export. If you do, you get a "NoDefException" if the region
you try to export is an HGrid region. For all other region types within the page, data
displayed across all the regions that share the same view instance will be exported rather
than just the data displayed in the intended region for which the "Export" button is selected.
To work around this issue, you can assign different view instances of the same view to the
different regions of the page.

                                                                                               439
Oracle Application Framework Developer's Guide


Step 4: Generally, when you export data from a region, OA Framework exports the data from
the view object attribute associated with each item in that region. In some cases, when you do
not want to export the data from the view attribute associated with an item, you can specify a
different view attribute to export from, by setting the Export View Attribute property for
that item. If you don't set or set the Export View Attribute property to null, OA Framework
exports data from the view attribute name associated with the item.

Note: When exporting data from a table or advanced table, the data that is exported from
the leaf item of the table column may be from a different view attribute than the data
displayed. This occurs when the declarative definition of the table column's leaf item has a
value specified for its Export View Attribute property.

Note: OA Framework provides limited support for exporting data from a switcher column
under a table or advanced table. If the direct named children of the switcher web bean are
leaf nodes that contain data, then OA Framework can export the data from the appropriate
leaf node. If, however, the direct named children under the switcher web bean are
containers, you must use the Export View Attribute property and add a transient
view attribute to your view object as described in the Runtime Control section in order to
export the data from the appropriate child container.

Attention: If you intend to support the Export feature on a Gantt chart or HGrid, you cannot
use different viewAttributeNames at different levels in the hierarchy column. All levels of the
hierarchy column (that is, all nodeDefs) should have the same viewAttributeName. This is
analogous to the definition of all other columns of a HGrid or Gantt. This restriction does not
apply if the Export feature is not being used.

Note: When exporting data from a page, data from hidden fields (FormValue items) or from
the undisplayed child of a switcher region, cannot be exported.

Step 5: Set the Export All Rows property on the exportButton item to True to export all rows
from a table's view object regardless of the view object's setMaxFetchSize value. If the Export
All Rows property is set to False, the total number of rows that can be exported from a table is
defined by its view object's setMaxFetchsize. The default value for this property is False for
existing Export buttons and True for any new Export button.

Runtime Control

In the general case, there are no runtime control steps necessary to enable the export of data
from a region. However, if you wish to export data from a Master/Detail region or a switcher
column within a table, there are specific programmatic steps you need to consider.

Exporting Data From Master/Detail Regions

If you have a page that contains both a Master region and a corresponding Detail region and
you want to export all the data from these two regions regardless of which Master row is
selected, you must do so programmatically. There is no declarative support for this.




440
Oracle Application Framework Developer's Guide, Release 12.1.3


First refer to the Coordinating Master/Detail Tables discussion for details on how to create such
a region. Then add code, as shown in the following example, to the processRequest method
of your controller:



OAExportBean expBean =

  (OAExportBean)webBean.findChildRecursive("Export");
// set the exportDetails for this Master/Detail region.
expBean.setExportDetails(oaPageContext,"masterRegionName",

  "detailRegionName", "masterVuName", " detailVuName");

Note: This type of Master/Detail export is supported only when you implement a region-
level export and not a page-level export (where all the regions on a page are exported).

Exporting Data from a Switcher Column in a Table

OA Framework can successfully export data from a switcher column in a table only if the direct
named children of the switcher column are leaf nodes (nodes that consist of data).

If the named children of the switcher column are container web beans (for example, flowLayout
web bean), then you must also perform the following steps to export the data from the child
container:

Step 1: Create a transient view attribute in the view object used for the switcher region. For
example, ExportSwitcherViewAttr in MyVO.

Step 2: In Jdeveloper, set the Export View Attribute property on the switcher region to
the transient view attribute you created in Step 1.

Continuing with the example in Step 1, suppose you have a switcher column in a table that
switches between containers child1 and child2 and you would like to export data from the
CustomerName or CustomerID view attributes under these containers, respectively. The
general XML structure would look similar to the following, with the Export View Attribute
property set to ExportSwitcherViewAttr:



- table region
  - switcher region

      (View Instance = "MyVO1", View Attribute Name =
"SwitcherViewAttr",

         Export View Attribute ="ExportSwitcherViewAttr")
        - header region (case "child1")
          - messageStyledText item

                                                                                                 441
Oracle Application Framework Developer's Guide


           (View Instance = "MyVO1", View Attribute Name =
"CustomerName")
      - flowLayout region (case "child2")
        - messageStyledText item

            (View Instance = "MyVO1", View Attribute Name =
"CustomerId")
  - etc.

Step 3: Add code in the getter of your view object row accessor to return the data from the leaf
items of the switcher column's child containers, based on the value of the switcher view
attribute. Following the example in Steps 1 and 2, you would add the following code in the getter
of MyVORowImpl.java:



public String getExportSwitcherViewAttr()
{
  if ("child1".equals(getSwitcherViewAttr()))
    return getCustomerName();
  else if ( "child2".equals(getSwitcherViewAttr()) )
    return getCustomerId();
  return null;
}

Personalization Considerations
There are no personalization restrictions.

Known Issues
   •   See a summary of key data export/import issues with suggested workarounds if
       available.

Related Information
   •   BLAF UI Guideline(s)
          o Export/Import Page Templates [OTN version]
          o Export/Import Flows [OTN version]
   •   Javadoc File(s)
          o oracle.apps.fnd.framework.webui.beans.form.OAExportBean
   •   Lesson(s)
   •   Sample Code




442
Oracle Application Framework Developer's Guide, Release 12.1.3



Date Picker
Overview
Users of Oracle E-Business Suite can enter a date for a date field by using a Date Picker. A
Date Picker, as fully described in the Oracle Browser Look-and-Feel (BLAF) UI Guidelines: Date
Picker [OTN version] is a feature that displays a graphical calendar from which a user can select
a date to populate a date field on a page. The benefits of including a Date Picker in a page are
that users can graphically select a date and visible restrictions of available dates can be
enforced for specific application contexts. A Date Picker can be implemented inline, as shown in
Figure 1 or in a secondary window, as shown in Figure 2.

Figure 1: An example of a page with a date field and an Inline Date Picker.




Figure 2: An example of a page with a date field and Date Picker icon. Selecting the Date Picker icon displays the Date Picker in
a secondary
window.




Figure 3: Date Picker in a secondary window.




                                                                                                                            443
Oracle Application Framework Developer's Guide




Icon Access to Secondary Window
OA Framework automatically renders a Date Picker icon when you define a date field in a page.
Selecting the Date Picker icon next to the date field displays the Date Picker in a secondary
window as shown in Figure 3.

Note OA Framework only supports the month and year as separate pulldown lists in the
Date Picker.

Declarative Implementation

To implement a Date Picker on your page so that it displays in a secondary window, simply
create a messageTextInput item on your page and set its Data Type property to Date.

Runtime Control

Although there are no programmatic steps necessary to implement a Date Picker in a
secondary window for a date field, if you wish to restrict the Date Picker to a range of dates, you
must include the following code in the processRequest method of your controller:



OAMessageDateFieldBean dateField = (OAMessageDateFieldBean)

  webBean.findIndexedChildRecursive("Date1");
  dateField.setMinValue(minDate);
  dateField.setMaxValue(maxValue);

Personalization Considerations

   •   See a summary of Date Picker personalization considerations in the Oracle Application
       Framework Personalization Guide.


444
Oracle Application Framework Developer's Guide, Release 12.1.3


Inline Datepicker
When one or more date fields appear on a page, an Inline Date Picker can be associated with
those date fields programmatically, allowing users to quickly select dates for those fields. An
Inline Date Picker is displayed inline in the page contents. A user populates a date field by
setting the focus on the desired date field and selecting a date from the Inline Date Picker.

Note There should be ONLY one Inline Date Picker on a page even if multiple date fields
exist on the page.

Note OA Framework only supports the month and year as separate pulldown lists in the
Date Picker.

Declarative Implementation

There is currently no declarative support for implementing an Inline Date Picker, however, you
must define a date field on your page first by creating a messageTextInput item on your page
and setting its Data Type property to Date.

Runtime Control

Creating an Inline Date Picker

Once you declaratively define one or more date fields on your page, you can programmatically
create an Inline Date Picker and associate the Inline Date Picker ID with these date fields. You
can also programmatically determine the placement of the Inline Date Picker on the page. To
create an Inline Date Picker, include the following code in the processRequest method of your
controller.



import
oracle.apps.fnd.framework.webui.beans.form.OAInlineDatePickerBean;

import
oracle.apps.fnd.framework.webui.beans.message.OAMessageDateFieldBean;

public void processRequest(OAPageContext pageContext, OAWebBean
webBean)




{

    :


                                                                                             445
Oracle Application Framework Developer's Guide


      OAInlineDatePickerBean inlineDatePicker = (OAInlineDatePickerBean)

          createWebBean(pageContext, INLINE_DATEPICKER_BEAN);

      inlineDatePicker.setId("DatePicker");

      OAMessageDateFieldBean dateField = (OAMessageDateFieldBean)webBean.

          findIndexedChildRecursive("Date1");

      dateField.setPickerID("DatePicker");

      // Set the same inlineDatePicker to another date field.

   dateField =
(OAMessageDateFieldBean)webBean.findIndexedChildRecursive("Date2");

      dateField.setPickerID("DatePicker");

      WebBean.addIndexedChild(inlineDatePicker);

}

Creating an Inline Date Picker with Max and Min Values

To display an Inline Date Picker in a page with a restricted range of dates, include the following
code in the processRequest method of your controller.



import
oracle.apps.fnd.framework.webui.beans.form.OAInlineDatePickerBean;

import
oracle.apps.fnd.framework.webui.beans.message.OAMessageDateFieldBean

import java.util.Date;




public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

{

      :


446
Oracle Application Framework Developer's Guide, Release 12.1.3


    Date minDate = new Date(100, 06, 04); // 4th July 2000

    Date maxDate = new Date(104, 11, 17); // 17th December 2004




    OAInlineDatePickerBean inlineDatePicker = (OAInlineDatePickerBean)

        createWebBean(pageContext,INLINE_DATEPICKER_BEAN);

    inlineDatePicker.setId("DatePicker");

    inlineDatePicker.setMinValue(minDate);

    inlineDatePicker.setMaxValue(maxDate);

    OAMessageDateFieldBean dateField = (OAMessageDateFieldBean)

        webBean.findIndexedChildRecursive("Date1");

    dateField.setPickerID("DatePicker");

    // Should be set on the date field also.

    dateField.setMinValue(minDate);

    dateField.setMaxValue(maxValue);



    webBean.addIndexedChild(inlineDatePicker);

}

Personalization Considerations

    •   See a summary of Date Picker personalization considerations in the Oracle Application
        Framework Personalization Guide.

Known Issues
    •   None

Related Information


                                                                                           447
Oracle Application Framework Developer's Guide


   •   BLAF UI Guideline
          o Date Picker [OTN version]
   •   Javadoc
          o oracle.apps.fnd.framework.webui.beans.form.OAInlineDatePick
             erBean
          o oracle.apps.fnd.framework.webui.beans.form.OADateFieldBean




448
Oracle Application Framework Developer's Guide, Release 12.1.3



Declarative Page Flow
Overview
With the OA Framework you can declaratively define navigation relationships between pages
using the following techniques. You can either:

   •   Specify the personalizable Destination Function property for select UI components in a
       page or
   •   Use Oracle Workflow to define a workflow that describes your navigation rules for a
       page flow, and then leverage this workflow at runtime to dynamically ascertain the target
       page for each navigation action

With the "Destination Function" technique, you can associate a target navigation page with a UI
component at design time. So, for example, if the user selects a particular link or button, you
can navigate to the page whose UI function is associated with that link or button. Since the
Destination Function UI property is personalizable, this approach lets customers easily
change the target page for a given action. This technique is best used for simple, point-to-point
navigation that can be statically defined.

With the Workflow technique, you can model a complex page flow including forward/back
navigation, looping and conditional branching. Each time the user tries to perform a navigation
action, the workflow determines what the target page should be. Generally, the workflow
technique is best suited to multistep transactions. In this case, customers can't simply change
the logic that interrogates the workflow to obtain the destination page, but they can change the
workflow definition itself if necessary.

Destination Function Page Flow
To define a navigation action that can be personalized by administrators, you simply need to set
the Destination Function property value to the name of a UI function whose Web HTML
call points to the target page (see the Tabs/Navigation document for information about creating
functions). Customers can then create a function-based personalization for this page, for
example, and substitute their new function for the one that you seed.

The Destination Function property is supported for a select list of components. The
corresponding behavior differs slightly based on whether the component renders as a link or a
form submit item.

Note: The Destination Function property is not yet supported on the navigationBar
(oracle.apps.fnd.framework.webui.beans.nav.OANavigationBarBean) so it
cannot be used with this component for step-by-step transaction flows.

GET Implementation

If you set the Destination Function property on a bean that normally renders as a link, the
Destination URI property is ignored (if specified). When the user selects the link, a GET

                                                                                              449
Oracle Application Framework Developer's Guide


request is issued and the page associated with the target function displays. The list of beans in
this category include:

Note that this functionality existed previously for some beans.

    •   button
    •   image
    •   link
    •   nodeDef (in a tree)
    •   staticStyledText
    •   messageStyledText

Tip: If you want to add parameters to the URL generated for the GET request, you can use the
setInvokeFunctionParams(String functionParam) method on your bean. For
example, you could add the following processRequest() logic to add the request parameter
foo=bar to the URL when a button with a Destination Function is selected:



public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

{

    super.processRequest(pageContext, webBean);




    OAButtonBean button =

        (OAButtonBean)webBean.findIndexedChildRecursive("<myButton>");



    button.setInvokeFunctionParams("foo=bar");



}

POST Implementation

If you set the Destination Function property on a bean that normally submits the form
when selected (a submitButton, for example, or another component configured to submit the
form with a fireAction), setting this property does not change this behavior. You must handle the
form submission event as you normally would with the code shown below.


450
Oracle Application Framework Developer's Guide, Release 12.1.3


The list of beans in this category include:

    •    button
    •    image
    •    link
    •    nodeDef (in a tree)
    •    staticStyledText
    •    messageStyledText
    •    singleSelection
    •    messageRadioGroup
    •    messageCheckBox
    •    messageTextInput
    •    messageChoice
    •    messageLovChoice
    •    messageRadioButton
    •    submitButton

If you set the Destination Function for one of these beans, you must code
processFormRequest() logic to obtain the function name so you can pass it to a
setForward*URL() method call. This is illustrated in the following example that handles the
fireAction event for a messageChoice bean.



public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)

{

 super.processFormRequest(pageContext, webBean);
 String event = pageContext.getParameter(EVENT_PARAM);
 String source = pageContext.getParameter(SOURCE_PARAM);



 if ( "<myEventName>".equals(event) && "<myPoplist>".equals(source) )
 {
    OAMessageChoiceBean poplistBean =

(OAMessageChoiceBean)webBean.findIndexedChildRecursive("<myPoplist>");


        String invokeFunc = poplistBean.getInvokeFunctionName();

        pageContext.setForwardURL(invokeFunc,...);
    }
}

Personalization Considerations

                                                                                         451
Oracle Application Framework Developer's Guide


    •    See a summary of Page Flow personalization considerations in the Oracle Application
         Framework Personalization Guide.

Known Issues

    •    None

Workflow Page Flow
Instead of adding complex, static logic to your page controllers to handle different navigation
scenarios, this technique lets you leverage Oracle Workflow to handle all the conditional
navigation rules. This section describes how to create an appropriate workflow definition for this
purpose, and how to interact with it as the user navigates through the transaction.

For additional information about the Workflow product, see the Oracle Workflow Developer's
Guide, the Oracle Workflow Administrator's Guide, the Oracle Workflow User's Guide and the
Oracle Workflow API Reference at the Oracle Applications Documentation Library. These
instructions assume that you understand how to create, test and deploy Workflow process
definitions; it focuses exclusively on the characteristics of a workflow that are important to this
particular use case.

Figure 1: Example of the first page in a multistep flow (this is the Multistep Create flow in the OA Framework ToolBox Tutorial
which uses Workflow).




Implementation

To create a multistep page flow using Workflow, follow these steps:



452
Oracle Application Framework Developer's Guide, Release 12.1.3


Step 1: Create Your Transaction Pages

Create all the pages that need to participate in a multipage transaction, as you would create any
OA Framework page.

Step 2: Define the Page Flow Workflow

Use Oracle's Workflow Builder to define your page flow in accordance with the rules and
guidelines described below.

Note that this document assumes that you know how to use the Workflow Builder. For general
information on defining workflow processes refer to the Oracle Workflow Developer's Guide.

Figure 2: Example of a Page Flow in Oracle Workflow Builder.




To configure a workflow as a page flow:

    1. Add a function activity for each page in the transaction. For each activity, decide whether
       to:
           o Associate a result with this activity (if appropriate for conditional navigation), or
           o Explicitly mark the activity as blocked by associating the wf_standard.block
              PL/SQL function with it.

                  When the Workflow Engine encounters a blocking activity it stops and waits for
                  some sub-process or external entity to provide the information it needs to
                  proceed. So, with the mapping between transaction pages and the blocking
                  activities in the Workflow, you can query the activity data to find out what page
                  ought to be rendered.


                                                                                                 453
Oracle Application Framework Developer's Guide


     2. Add FORM attribute to each page-related blocking activity. You will use this for page
        information as shown in Figure 4 below.

Figure 3: Function definition in Oracle Workflow




Figure 6: Function activity attribute with page information.




You can also add blocking activities that do not correspond to a page for the following use
cases:

     •    You send a notification at the end of the transaction.

454
Oracle Application Framework Developer's Guide, Release 12.1.3


         For example, a Create Expense Report flow might send out a notification asking for
         manager approval. Once the manager responds, you want to send an FYI notification to
         the user who submitted the expense report. In this case, the blocking notification activity
         comes after the multiple page part of the transaction has concluded.

    •    The workflow is comprised of two discrete transactions as described in this user flow:
                    1. User selects a "Create Expense Report" action.
                    2. User fills out Page 1, Page 2, Page 3 to create and submit an expense
                       report (transaction #1)
                    3. Report submission causes a notification to the user's manager.
                    4. The manager can approve or reject the expense request.
                    5. If the manager rejects the expense, an FYI Notification is sent to the user
                       asking him to update the expense report.
                    6. User selects an "Update Expense Report" action.
                    7. This time user steps through Page 4 and Page 5 to update and resubmit
                       the expense report (transaction #2)

         In the corresponding workflow process definition, the two transactions are
         separated by a notification that requires a user response. The second part of the
         create expense report transaction is optional and is executed only if the expense
         report is rejected. The point here is that blocking activities that do not correspond
         to pages should only be inserted at appropriate points in the flow, otherwise the
         user won't able to finish the transaction.

         Note that in this second scenario your application has to do all the work to make
         sure that when the user returns to update the expense report, he is in the right
         context. Your application is also responsible for calling the correct OA
         Framework API to indicate that the page flow depends on a previously started
         workflow process

Workflow activities that denote pages in a flow should not have OR joins. The following scenario
won't work. In this flow, Page 1 can go to Page 2 or Page 3. Since there is no result type
associated with Page 1, the Workflow Engine will randomly decide between Page 2 or Page 3.
You can change this into a valid flow by attaching a result type to Page 2.

Figure 7: Invalid workflow with an OR.




                                                                                                   455
Oracle Application Framework Developer's Guide




Step 3: Start the Page Flow

There are two ways you can start a Workflow process for a page flow based on whether your
page flow is launched from an originating page or not (for example, the originating page might
be a read-only summary with a "Create Object" button that launched the page flow).

In the scenario where you have a launching page, your processFormRequest() logic for the
button that launches the page flow should appear as follows:



public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)

{



    ...



    if (OANavigation.isWorkflowInProgress(pageContext))

    {

        String oldKey = OANavigation.getItemKey(pageContext);

456
Oracle Application Framework Developer's Guide, Release 12.1.3




    if (!OANavigation.abortProcess(pageContext,
"FWKTBX2","FWKTBXPFLOW", oldKey, null, null))

     {

         ...throw exception

     }

 }



 OAApplicationModule am = pageContext.getRootApplicationModule();



 String wfKey = null;
 String nextPage = null;



 // Initialize the Workflow pageflow.



 Serializable[] parameters = { "fwk_tbx_wf_seq" };

 wfKey = (String)am.invokeMethod("getWfKey", parameters);



  OANavigation.createProcess(pageContext, "FWKTBX2","FWKTBXPFLOW",
wfKey);

  OANavigation.startProcess(pageContext, "FWKTBX2",
"FWKTBXPFLOW",wfKey);



  // This is the correct signature for initializing a new workflow
when you're going

 // to transition to the first activity.

  nextPage = OANavigation.getNextPage(pageContext, "FWKTBX2",
wfKey,null, false);

                                                                                  457
Oracle Application Framework Developer's Guide




    HashMap params = new HashMap(1);



    params.put("poStep", "1");



  pageContext.setForwardURL(pageContext.getApplicationJSP() + "?" +
nextPage, // target page

            null,

            KEEP_MENU_CONTEXT,

            "", // No need to specify since we're keeping menu context

            params, // Page parameters

            true, // Be sure to retain the AM!

            ADD_BREAD_CRUMB_NO, // Do not display breadcrumbs

            OAException.ERROR); // Do not forward w/ errors



} // end processFormRequest()



If you don't want to display a generic page and instead would like to start with the first page
defined in the Workflow, your page controller must instantiate the workflow, query it for page
information, and then redirect the request to this page as shown:



public void processRequest(OAPageContext                  pageContext, OAWebBean
webBean)

{

      ...




458
Oracle Application Framework Developer's Guide, Release 12.1.3


  String wfKey = null;

  String nextPage = null;



  if (!OANavigation.isWorkflowInProgress(pageContext))

  {

      OAApplicationModule am = pageContext.getRootApplicationModule();



      // Initialize the Workflow pageflow.

      Serializable[] parameters = { "fwk_tbx_wf_seq" };

      wfKey = (String)am.invokeMethod("getWfKey", parameters);



     OANavigation.createProcess(pageContext, "FWKTBX2", "FWKTBXPFLOW",
wfKey);

     OANavigation.startProcess(pageContext, "FWKTBX2", "FWKTBXPFLOW",
wfKey);



  }



   nextPage = OANavigation.getNextPage(pageContext, "FWKTBX2", wfKey,
null, false);



  HashMap params = new HashMap(1);



  params.put("poStep", "1");



   pageContext.setForwardURL(pageContext.getApplicationJSP() + "?" +
nextPage, // target page

                                                                                 459
Oracle Application Framework Developer's Guide


          null,

          KEEP_MENU_CONTEXT,

        "", // No need to specify since we're keeping menu context

        params, // Page parameters

        true, // Be sure to retain the AM!

        ADD_BREAD_CRUMB_NO, // Do not display breadcrumbs

        OAException.ERROR); // Do not forward w/ errors



    }
}

Step 4: Transition Between Pages

Note: Please see the Multistep Create flow in the OA Framework ToolBox Tutorial for a
complete code example.

The OANavigation API provides three getNextPage() methods for transitioning the
workflow.

    •    getNextPage(OAPageContext pageContext) - transitions to the next page of the
         workflow.
    •    getNextPage(OAPageContext pageContext, String resultCode) -
         transitions to the next page of the workflow based on the result type determined in your
         controller.
    •    getNextPage(OAPageContext pageContext, String wfItemType, String
         wfItemKey, String wfProcess, boolean initialize) - used to resume a
         saved transaction.

Figure 8: Second step of the purchase order.




460
Oracle Application Framework Developer's Guide, Release 12.1.3




To transition to the next page of an active transaction of the workflow, use
OANavigation.getNextPage(OAPageContext pageContext) in your
proceessFormRequest() method. The getNextPage() completes the blocking activity
corresponding to the current page and advances the workflow until it encounters the next
blocking activity. The workflow transitions to a waiting state and control is transferred back to
the calling getNextPage().

nextPage = OANavigation.getNextPage(pageContext);

The method then queries the blocking activity and retrieves the page information associated
with the activity's FORM type attribute and returns it to the processFormRequest() of the
calling controller. You should write a setForwardURL to redirect the request to next page in
flow.

HashMap params = .....;
params.put(.....);
pageContext.setForwardURL(........);

To transition to the next page as per the result type returned by the OA Framework controller
use getNextPage(OAPageContext pageContext, String resultcode).



public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)
{
  ...

  String workflowResultCode = null;



  if (pageContext.getParameter("Next") != null)
  {

                                                                                                461
Oracle Application Framework Developer's Guide


        workflowResultCode = "Next";

    }

    else if (pageContext.getParameter("Previous") != null)

    {

        workflowResultCode = "Previous";

    }



    nextPage = OANavigation.getNextPage(pageContext,workflowResultCode);

    HashMap params = ....

    params.put(....);

    pageContext.setForwardURL(.........);
}

Step 5: Clear the Workflow Context

Since the Workflow transaction holds an independent local JDBC connection, you must override
the OADBTransaction.beforePoolCheckin() method in your root UI application module
and call getDBTransaction.clearWorkflowInfo() to release the connection.



public void beforePoolCheckin()

{

      // Always call this first.

      super.beforePoolCheckin(...);

      getDBTransaction.clearWorkflowInfo();



}

Saving the Transaction and Continuing Later



462
Oracle Application Framework Developer's Guide, Release 12.1.3


OA Framework does not provide built-in support for "Save for Later" transactions. If you want to
provide this feature, you must implement all the state management yourself. To resume a saved
transaction, you must query a blocked workflow to retrieve the current page information by
calling getNextPage(OAPageContext pageContext, String wfItemType, String
wfItemKey, String wfProcess, Boolean initialize).

Browser Back Button Support

Workflow-based page flows automatically support browser Back button navigation at the
Workflow technology layer. Whenever user moves between the pages using browser Back
button and resubmits, the workflow rewinds itself to the appropriate blocking activity so it stays
in synch with the user's current navigation position.

See Supporting the Browser Back Button for additional information as it relates to the explicit
Back button support required at the OA Framework layer.

Page Flows with Train and Navigation Bar

If the number of page flow steps is known, it is appropriate to use a train and associated
navigation bar as shown in Figure 1 above (if the number of steps is indeterminate, this is not an
appropriate UI design). For implementation instructions, see Locator Element: Train and Locator
Element: Page Navigation in Chapter 4.

Error Handling

For the most part, you handle application errors in your Workflow-based page flows the same
way that you do in any other context. That said, however, you need to consider the possibility
that the user might fix mistakes and resubmit the form whenever you introduce workflow code.

Known Issues

   •   Parallel flows are not supported when using Workflow page flows.

Related Information
   •   BLAF UI Guideline(s)
          o Step-by-Step Page Flows [OTN Version]
          o Step-by-Step (3+ Step) Page Template [OTN Version]
   •   Javadoc
          o oracle.apps.fnd.framework.webui.beans.nav.OANavigationBarBe
             an
   •   OA Framework Developer's Guide
          o Tabs / Navigation
          o Submitting the Form
          o Locator Element: Train
          o Locator Element: Page / Record Navigation
   •   OA Framework ToolBox Tutorial / Sample Library


                                                                                                463
Oracle Application Framework Developer's Guide


          o   See the Create (Multistep) example in the Tutorial.jpr (run the
              test_fwktutorial.jsp to try it)
   •   Oracle Workflow Documentation
          o Oracle Workflow Developer's Guide
          o Oracle Workflow Administrator's Guide
          o Oracle Workflow User's Guide
          o Oracle Workflow API Reference




464
Oracle Application Framework Developer's Guide, Release 12.1.3



Dialog Pages
Overview
As described in the BLAF UI Guideline: Message Flows [OTN Version] specification, messaging
can be introduced into application flows when an Error, Information, Warning, Confirmation, or
Processing Message needs to be displayed. There are two basic kinds of messaging flows:

    •    Inline Message - The message appears inline on a page around the region item that
         requires attention. The inline message is also repeated in the message box on top of the
         page.
    •    Dialog Page - The message appears on it's own dialog page in the flow.

The inline message is described in detail in Chapter 4: Implementing Message Boxes. This
document focuses on how to implement an Error, Information, Warning, or Confirmation
message in a dialog page. The following figure shows an example of a Warning message
displayed in a dialog page.

Figure 1: Warning dialog page.




Contents

    •    Declarative Implementation
    •    Runtime Control
            o New Dialog Page APIs
            o Using HTML Tags in Messages
    •    Personalization Considerations
    •    Known Issues
    •    Related Information

Declarative Implementation
Since a dialog page is displayed in the context of runtime events and circumstances, there is no
corresponding declarative implementation.

Runtime Control
You can display an exception as a message in a dialog page using the APIs in the
oracle.apps.fnd.framework.webui.OADialogPage class and
oracle.apps.fnd.framework.webui.OAPageContext interface.

                                                                                             465
Oracle Application Framework Developer's Guide


The OADialogPage class holds properties for the generic dialog page. To create a dialog page
object, first use the constructors to instantiate the basic properties, then use the setter methods
provided in the class to set additional properties. Please refer to the OADialogPage Javadoc
for an explanation of basic usage and additional examples.

To navigate (redirect) to a dialog page, use the OAPageContext.redirectToDialogPage
methods. The OAPageContext interface contains the context and state information specific for
a client request. The following redirectToDialogPage methods are provided in
OAPageContext:



// Redirects to a dialog message page.

public void redirectToDialogPage(OADialogPage dialogPage);
// Convenience method to create and redirect to a dialog page with
basic properties set.

Public void redirectToDialogPage(byte messageType,
OAException    descriptionMessage,
OAException instructionMessage,
String okButtonUrl,
String    noButtonUrl)

Please refer to the OAPageContext Javadoc for further information on these methods.

Example: Redirect to a Basic Warning Page

You can include the following code example in your controller processFormRequest method
to redirect to a basic warning page:



OAException descMesg = new OAException("FND", "FND_CANCEL_WARNING");

OAException instrMesg = new OAException("FND", "FND_CANCEL_ALERT");

String okUrl = APPS_HTML_DIRECTORY +
"OA.jsp?OAFunc=FND_REQUISITIONS_PAGE";

String noUrl = APPS_HTML_DIRECTORY +
"OA.jsp?OAFunc=FND_REQUISITIONS_PAGE&retainAM=Y";

pageContext.redirectToDialogPage(OAException.WARNING, descMesg,
instrMesg, okUrl, noUrl);

Example: Make Dialog Page Action Buttons Submit Back to the Calling Page



466
Oracle Application Framework Developer's Guide, Release 12.1.3


Refer to the setPostToCallingPage method, documented in the OADialogPage Javadoc
for a code example of how to make the dialog page action buttons submit back to the calling
page. In the example, the OK button commits the changes on the dialog page and the NO
button rolls back the changes.

Example: Display a Warning Page When a Delete Icon is Selected.

Refer to Task 4 of the Delete exercise in the Oracle Application Framework Toolbox Tutorial for
another example of how to create a Warning dialog page. The specific example is implemented
in controller class EmployeeResultsCO in LabSolutions.jpr of the Toolbox. This example
displays a Warning page when a user selects the Delete icon from an Employees Search page.
The Warning page displays Yes and No submit buttons, as shown in Figure 1.

Using HTML Tags in Messages

You may insert HTML tags in the messages displayed in a dialog page. Please refer to the
Chapter 4 topic: Custom HTML for further details.

Handling Messages that Reference Web Beans Without Prompts

If your page contains a web bean that does not have a prompt value associated with it and a
user enters an invalid value for the web bean, the error message that results will be malformed.
For example, if you have a messageTextInput field with no prompt and you enter an invalid
value, the error message may display as:

Value "A" in "" is not a number.

To avoid these malformed messages, use
oracle.apps.fnd.framework.webui.beans.message.OAMessagePromptBean.

Create an OAMessagePromptBean and set:

   •   Prompt - to the alternate prompt that is going to be displayed for the web bean.
   •   LabeledNodeId - to those set of web bean ID's that you want associated with this
       alternate prompt. (These are the web beans without a current prompt associated with
       them).

You can associate multiple web bean ID's to the LabeledNodeId of this
OAMessagePromptBean. As a result, all those web beans will be associated with the prompt of
the OAMessagePromptBean.

The following code example illustrates this:



...
OAMessagePromptBean bean = new OAMessagePromptBean();
bean.setID("someID");
bean.setPrompt("Alternative");

                                                                                             467
Oracle Application Framework Developer's Guide


bean.setLabeledNodeID("RequiredBeanID");
webBean.addIndexedChild(bean);
...

RequiredBeanID is the ID of the web bean with which this alternate Prompt is to be
associated.

New Dialog Page APIs

The setFooterNestedRegionCode and setFooterNestedRegionApplicationID
methods in the OADialogPage class have been deprecated.

If you use the standard OK/NO buttons provided on the dialog page, you do not need to make
any changes.

However, if you are using the OADialogPage.setFooterNestedRegionCode and
OADialogPage.setFooterNestedRegionApplicationID methods to render customized
buttons under the footer region, you must update your code to use the new method
OADialogPage.setPageButtonBarRegionRefName instead. This new method lets you set
a reference to a page button bar region, built declaratively with OA Extension. You can add any
number of custom buttons to the page button bar region. OA Framework renders the page
button bar region under the footer. Adding your custom content to a page button bar region
allows the page buttons to be rendered and positioned in the proper places specified by the
latest UI standards. To render the Return To navigation link under the footer, use the existing
setReturnToLinkLabel and setReturnToLinkURL methods in OADialogPage.

To render a nested region, created with OA Extension, under a dialog page header, use the
new OADialogPage.setHeaderNestedRegionRefName method.

Personalization Considerations
   •   See a summary of Dialog Pages personalization considerations in the Oracle Application
       Framework Personalization Guide.

Known Issues
   •   None

Related Information
   •   BLAF UI Guidelines
          o Messaging Flows [OTN Version]
          o Messaging Templates [OTN Version]
   •   Javadoc File
          o oracle.apps.fnd.framework.webui.OADialogPage
          o oracle.apps.fnd.framework.webui.OAPageContext
          o oracle.apps.fnd.framework.webui.beans.OAFormattedTextBean


468
Oracle Application Framework Developer's Guide, Release 12.1.3


       o     oracle.apps.fnd.framework.webui.beans.OATipBean
       o     oracle.apps.fnd.framework.webui.beans.message.OAMessageProm
             ptBean
       o     oracle.cabo.ui.beans.message.MessagePromptBean
•   Lesson
      o Delete exercise
•   Sample Code
      o oracle.apps.fnd.framework.toolbox.labsolutions.webui.Employ
          eeResultsCO in LabSolutions.jpr of the Toolbox Tutorial




                                                                                  469
Oracle Application Framework Developer's Guide



File Upload and Download
Overview
The File Upload feature enables the uploading of a file from a client machine to the middle tier,
and is implemented by
oracle.apps.fnd.framework.webui.beans.message.OAMessageFileUploadBean.
The File Download feature enables downloading of a file from the middle tier to a client machine
and is implemented by
oracle.apps.fnd.framework.webui.beans.message.OAMessageDownloadBean.

Contents

   •   File Upload
           o Declarative Implementation
           o Runtime Control
   •   File Download
           o Declarative Implementation
           o Runtime Control
   •   Usage Notes
   •   Personalization Considerations
   •   Known Issues
   •   Related Information

File Upload
You can now specify a view object instance and view attribute for the messageFileUpload web
bean and associate a data type to it. The File Upload feature appears as an input field with a
prompt, followed by a Browse button, as shown:




If the view attribute returns a non-null value, that is, a file is already uploaded, OA Framework
renders the File Upload feature as a View link with a prompt, followed by a Clear button:




You can select the View link to see information about the uploaded file. If you select Clear, the
feature clears the View link and redisplays an input field with a Browse button so you can
specify a new file to upload.

Note: You can alter the text of the View link to display some other text or the file name of an
already uploaded file. See the Runtime Control section for more details.

Note: You can set the profile option called UPLOAD_FILE_SIZE_LIMIT to specify the
maximum size of the file a user can upload. For example, if you set

470
Oracle Application Framework Developer's Guide, Release 12.1.3


UPLOAD_FILE_SIZE_LIMIT to 500K, then during the http POST request, OA Framework
reads only up to 500K from the stream and throws an exception if the uploaded file is larger
than 500K.

Declarative Implementation

Perform the following steps to implement the File Upload feature declaratively in an OA
Extension page.

Step 1: Create a region in your page layout region, with the Form property set to true for the
page layout.

Step 2: In the new region, create an item of item style messageFileUpload.

Step 3: In the OA Extension Property Inspector, set the following properties for the
messageFileUpload item:

   •   View Instance - A view object instance of the underlying data source.
   •   View Attribute - A view attribute in the specified view object instance, that maps to the
       column for storing the file content.
   •   Data Type - The Oracle data type of the view attribute. The BLOB data type is
       supported for File Upload. For example, if you set the data type to BLOB, the view
       attribute must map to a column whose data type is also BLOB.

       Note: The data type must be set to the same data type as the column that the view attribute
       maps to, otherwise an error occurs when the user attempts to commit the file upload.

       Note: If you set Data Type to BLOB and you store your file content in FND_LOBS, be sure
       to populate the column FILE_CONTENT_TYPE (File MIME Type). Since
       FILE_CONTENT_TYPE is a non-null column, you will encounter an error is this
       column is not populated. Refer to the
       oracle.apps.fnd.framework.webui.beans.message.OAMessageFileUpload
       Bean Javadoc for additional information.

   •   Prompt - The text label for the File Upload feature.

Runtime Control

You can programmatically alter the text of the link that appears when a file has already been
uploaded to be something other than "View". To change it to some other static text, then in your
controller code, call the setDisplayName method from the OAMessageFileUploadBean and
pass in the text to display for the link.

If you wish the link text to be dynamically determined, for example, to display the name of the
file that is already uploaded, then you can data bind the display name as follows:



OADataBoundValueViewObject displayNameBoundValue =

                                                                                               471
Oracle Application Framework Developer's Guide


  new OADataBoundValueViewObject(uploadBean, "FileName");

uploadBean.setAttributeValue(DOWNLOAD_FILE_NAME,displayNameBoundValue)
;

File Download
The File Download feature appears as linked text on a page. For example, in the figure below, a
default single column region contains a messageTextInput item (Image Name), followed by a
messageDownload item that appears as a File Download link (Process.gif). The text that
appears for the File Download link is the value returned by the View Attribute specified for the
messageDownload item. When you select the file download link, a small window opens in your
Browser. You can either open the file and display the content or save the file. If you choose
Save, the file is created and saved to your client machine.




Declarative Implementation

Perform the following steps to implement the File Download feature declaratively in an OA
Extension page.

Step 1: Create a region in your page layout region, with the Form property set to true for the
page layout.

Step 2: In the new region, create an item of item style messageDownload.

Note: If you implement a messageDownload item in a table or advanced table region, the
view object used to render the table or advanced table must have a designated primary key,
otherwise the messageDownload web bean will repeatedly download content from the first
row.

Step 3: In the OA Extension Property Inspector, set the following properties for the
messageDownload item:

   •   View Instance - The view object instance of the underlying data source.
   •   View Attribute - The view attribute that maps to a column in the underlying data source.
   •   File View Attribute - The view attribute that maps to the column that stores the file
       content.
   •   File Name Override - The file name to save to when you select the File Download link
       and choose the Save option in the File Download window to save the file. The default file
       name that appears in the File Name field of the Save As dialog window is derived from
       the value returned from the view
       attribute specified by the View Attribute property. The value of the File Name Override
       property overrides that default file name and is especially useful if the view attribute
       returns instructional text, such as "Click on this link to download the file". If the File

472
Oracle Application Framework Developer's Guide, Release 12.1.3


       Name Override property is not defined, then
       the file name to save to is the value returned from the view attribute.
   •   File MIME Type - The MIME type of the file. See the Runtime Control example below if
       you do not want to specify a static value for this property.
   •   Data Type - The data type of the File View Attribute. The BLOB datatype is supported
       for File Download.
   •   Prompt - The text prompt that proceeds the File Download link.

Runtime Control

If the file MIME type is stored in a view attribute, you can retrieve it through a data bound value
programmatically. The following code example illustrates how this is done:



// if content type is stored in a view attribute, it can be retreived
through

// data bound value. Otherwise, a static value can also be set:

// e.g. downloadBean.setFileContentType("text/html")

OADataBoundValueViewObject contentBoundValue = new
OADataBoundValueViewObject(downloadBean,

  "FileContentType");

downloadBean.setAttributeValue(FILE_CONTENT_TYPE, contentBoundValue);

Usage Notes
   •   Avoid defining both a messageFileUpload and a messageDownload item in a region and
       mapping both items to the same view attribute. If you map both items to the same view
       attribute, the Clear button in the messageFileUpload web bean that clears the View link,
       will also clear the link for the messageDownload web bean.
   •   A messageFileUpload item is not supported in a Table-in-Table region or Advanced
       Table-in-Advanced Table region.

Personalization Considerations
There are no personalization restrictions.

Known Issues
See a summary of key file upload/download issues with suggested workarounds if available.

Related Information
                                                                                                473
Oracle Application Framework Developer's Guide


   •   BLAF UI Guidelines
   •   Javadoc
          o oracle.apps.fnd.framework.webui.beans.message.OAMessageDown
             loadBean
          o oracle.apps.fnd.framework.webui.beans.message.OAMessageFile
             UploadBean




474
Oracle Application Framework Developer's Guide, Release 12.1.3



Flexfields
Overview
A flexfield is a placeholder set of fields that can be configured by customers for use by their
organizations. Once configured, the customer-defined fields in the set (label/widget pairs) may
appear in either a form or tabular layout. Each field in the set has a name and a set of valid
values. There are two types of flexfields, key and descriptive.

Key flexfields provide a way for Oracle E-Business Suite to represent objects such as
accounting codes, part numbers, or job descriptions, which comprise of multiple fields (or
segments) as a single object of concatenated segments. For example, the Key Accounting
Flexfield is a key flexfield that represents the multiple accounting codes throughout Oracle E-
Business Suite.

Similarly, descriptive flexfields provide a flexible way for Oracle E-Business Suite to provide
customizable "expansion space" in applications, as well as provide a way to implement context-
sensitive fields that appear only when needed. In essence, descriptive flexfields allow
customizations of pages without writing either XML or Java and are configured as a set of fields
on a page, much like the fields of the core application.

Both types of flexfields let you customize Oracle E-Business Suite features without
programming and these customizations are fully supported within Oracle E-Business Suite.

Note: This document assumes a working knowledge of flexfields. If you are not familiar with
flexfields or need further information, please consult the Oracle E-Business Suite Flexfields
Guide Release 12 and Chapter 14 ("Flexfields") in the Oracle E-Business Suite Developer's
Guide Release 12 .

Contents

This document contains the following topics:

   •   Overview
          o Flexfield Features Supported and Unsupported by OA Framework
   •   Descriptive Flexfields
          o Setting Up a Descriptive Flexfield in Oracle E-Business Suite
          o Declarative Implementation in JDeveloper
                   Descriptive Flexfield Segment List
          o Runtime Control
          o Personalization Considerations
          o Descriptive Flexfield Usage Restrictions
   •   Key Flexfields
          o Setting Up a Key Flexfield in Oracle E-Business Suite
          o Declarative Implementation in JDeveloper
                   Key Flexfield Segment List
          o Runtime Control
          o Personalization Considerations

                                                                                              475
Oracle Application Framework Developer's Guide


   •     Reference Fields
   •     Values and Value Sets
   •     Flexfield Validation
   •     Flexfields and Standard Request Submission
   •     Developer Mode Errors
   •     Troubleshooting Flexfield Problems
   •     Known Issues
   •     Related Information

Flexfield Features Supported and Unsupported by OA Framework

The following table lists the flexfield functionality (above and beyond regular flexfield
functionality) that is supported and unsupported by OA Framework. The list also provides links
to the area of this document where the supported or unsupported feature is discussed in more
detail.

Note: Warnings are raised at setup time in the Forms-based flexfield administration screens
if a flexfield is using features not supported in OA Framework.

      Flexfield                     Supported                            Unsupported
      Features
       General         •   Specifying segments for a particular    •   Query a range of key
                           context of a descriptive flexfield          flexfield segments
                       •   Hiding certain segments for Key and
                           Descriptive flexfields
                       •   Read-only segments for Key and
                           Descriptive Flexfields
                       •   Descriptive flexfield default values
                       •   Using Reference fields

   Value Sets          •   Format Rules
                       •   Displaying as Poplist
                       •   Displaying as LOV
                       •   Using a $FLEX$ reference
                       •   Using a $PROFILES$ reference

   Validation          •   None                                    •   Pair
     Types             •   Independent                             •   Special
                       •   Dependent
                       •   Table

 Key Flexfield-        •   Dynamic Insertion                       •   Specifying a segment
   specific            •   Key flexfield within a table                description
                       •   Multiple key flexfields on a page
                       •   Multiple key flexfields in a table
                       •   Generating the CCID
                       •   Combination LOV UI
                              o Required key flexfield LOV

476
Oracle Application Framework Developer's Guide, Release 12.1.3


                            o  Dynamic Insert
                            o  LOV over LOV
                    •   Adding a VRule to a Key Flexfield
                        web bean

  Descriptive       •   Context values                              •   Specifying a segment
   Flexfield-       •   Context switching                               description
    specific        •   Setting context value through an API
                    •   Descriptive flexfield within a table
                    •   Multiple descriptive flexfields on a
                        page
                    •   Multiple descriptive flexfields in a
                        table
                    •   Setting a descriptive flexfield to be
                        Read-only
                    •   Hiding or showing the context

Flexfield Core UI   •   Date picker - supported for both key        •   Mobile Applications
                        and descriptive flexfields.
                    •   Multiple key or descriptive flexfields
                        using the same view object.
                    •   Programmatic implementation of
                        descriptive and key flexfields
                    •   Merging a flexfield with its parent
                        layout (see workarounds for key and
                        descriptive flexfields)

    Flexfield       •   Turning On/Off unvalidated submit
   Validation
   Flexfield        •   Overriding an descriptive flexfield
 Customization          segment LOV to populate multiple
                        descriptive flexfield segments with
                        values.

Segments lists      •   enable/disable, reorder and mark as
                        read-only for Descriptive and Key
                        flexfields
                    •   Read-only and Rendered bound for
                        descriptive and key flexfields

 Flexfields with    •   Query web bean (turning validation          •   Descriptive flexfield in a
      other             off)                                            Master/Detail page
  components        •   Descriptive flexfield or key flexfield in   •   Table-in-Table - a
                        a messageLayout region                          developer mode error
                    •   Embedded mode - flexfields are                  results if you try to
                        rendered when its parent page is                implement a flexfield in
                        embedded in a JTT application.
                    •   HGrid

                                                                                              477
Oracle Application Framework Developer's Guide


                             •    Table Detail Disclosure                    a Table-in-Table.

  PPR support                •    Descriptive flexfield context
                                  switching
                             •    Dependent LOV PPR
                             •    Use descriptive flexfield or key
                                  flexfield as a PPR target

    Exporting                •    Descriptive flexfield data
                             •    Key flexfield data



Descriptive Flexfields
A descriptive flexfield is implemented as an
oracle.apps.fnd.framework.webui.beans.OADescriptiveFlexBean. An
OADescriptiveFlexBean automatically renders a layout for user input of segment values.
For each descriptive flexfield, if the Display Context property is set to True, a context field
renders as a poplist in the first row. After the first row, any global segments defined are
rendered, followed by the context-sensitive segments that correspond to the selected value in
the context poplist.

Each descriptive flexfield segment has a prompt aligned to the right, and a corresponding input
field aligned to the left. Figure 1 below is an example of the flexfield UI for a standard vertical
layout:

Figure 1: Visual Example of both a Key and Descriptive Flexfield on a Page




478
Oracle Application Framework Developer's Guide, Release 12.1.3




The above example displays a descriptive flexfield. Packaging Type is the context field for the
descriptive flexfield and Warehouse is a global field. No context-sensitive elements are
displayed in this example because a context has yet to be selected.

Currently flexfields support three types of input style:

   •   Text Input (not shown above)
   •   PopList, as shown for the segment Packaging Type
   •   LOV, as shown for the segment Warehouse

When you add an OADescriptiveFlexBean to your page, it:

   •   Displays flexfield segments that allow input or update and may populate segments with
       database values from corresponding view objects.
   •   Automatically refreshes with corresponding flexfield segments when a new context is
       selected.
   •   Validates flexfield segment input values.
   •   Automatically transfers valid values to the view object so that the calling page has
       access to valid flexfield values if no errors exist. If errors exist, the current page is
       redrawn with corresponding error messages.


                                                                                              479
Oracle Application Framework Developer's Guide


   •   If you need to wrap a long text of the MessageTextInput of a descriptive flexfield bean to
       fit the page, you can now call setWrapEnabled() on the descriptive flexfield bean before
       calling processFlex() by using the following command:
       dffBean.setWrapEnabled(true);
       Wrapping is disabled by default.

PPR Support

OA Framework provides PPR support for descriptive flexfields in the following ways:

   •   If you change the context of a descriptive flexfield, OA Framework uses PPR to render
       the segments for the new context.

       Note: OA Framework will perform a page refresh rather than PPR if your controller code
       moves the segment web beans of the descriptive flexfield out of the descriptive flexfield
       container.

   •   If a PPR action occurs on a page, and any view object attribute for the descriptive
       flexfield is changed during the processFormRequest method, OA Framework
       automatically adds the flexfield web bean as a target for PPR and re-renders the
       descriptive flexfield.

       Note: If the context attribute for the descriptive flexfield is changed during the
       processFormRequest method, the flexfield web bean is not added as a target for PPR and
       you therefore will not see a change in the descriptive flexfield structure. To show the
       structure change, OA Framework must redirect back to the same page, in which case, you
       may need to add code to your processRequest method if this is a concern.

Setting Up a Descriptive Flexfield in Oracle E-Business Suite

Before you can add a descriptive flexfield to an OA Framework page, you must first set up the
descriptive flexfield in Oracle E-Business Suite. To start, review Chapter 3 ("Planning and
Defining Descriptive Flexfields") in the Oracle E-Business Suite Flexfields Guide Release 12.

When you have a clear plan for the descriptive flexfield you wish to set up, refer to the section
titled "Implementing Descriptive Flexfields" in Chapter 14 ("Flexfields") of the Oracle E-Business
Suite Developer's Guide Release 12 for instructions to the following general steps:

       Step 1: Define descriptive flexfield columns in your database.

       Step 2: Register your descriptive flexfield table with Oracle Application Object
       Library.

       Step 3: Register your descriptive flexfield using the Descriptive Flexfields
       Window.

Next, refer to the Oracle E-Business Suite Flexfields Guide Release 12 for instructions to these
general steps:



480
Oracle Application Framework Developer's Guide, Release 12.1.3


       Step 4: Define your value sets in the Value Sets Window, as described in
       Chapter 5 ("Values and Value Sets").

       Step 5: Define your descriptive flexfield structure using the Descriptive Flexfield
       Segments Window, as described in the "Descriptive Flexfield Segments Window"
       section of Chapter 3 ("Planning and Defining Descriptive Flexfields").

       Recall that the value of a descriptive flexfield context field determines the context
       of the descriptive flexfield and the context-sensitive segments (if any) that are
       displayed. The section titled "Context Fields and Reference Fields" in Chapter 3
       ("Planning and Defining Descriptive Flexfields") discusses context fields in more
       detail.

       Step 6: When you are ready to add the descriptive flexfield to an OA Framework
       page, follow the steps outlined in the Declarative Implementation and Runtime
       Control sections below.

Declarative Implementation

The following steps describe how to add a descriptive flexfield item to a OA Framework region:

Step 0: Ensure that the view object underlying the region includes all the database columns
necessary for this descriptive flexfield. You should not change the database column names for
this flexfield because the OADescriptiveFlexBean uses the same naming convention that
the view object generation routine uses to find the corresponding attribute names from your
view object.

Step 1: Define an item of the item style flex in your region.

Note: You cannot create a flex item directly under a messageComponentLayout region, but
you can create a messageLayout region under the messageComponentLayout region and
add the flex item under the messageLayout region.

Step 2: Set the Read Only property to True or False, depending on whether you want the
descriptive flexfield to be read only.

Step 3: Specify a View Instance for your flexfield. The view instance should be the same as
the view instance (view object) specified for your region.

Note: OA Framework supports multiple descriptive flexfields on the same view object.

Note: If a flexfield's view object does not return a row, an OAException will not be thrown so
that the controller's processRequest method can still execute and render the flexfield.

Step 4: Set the Appl Short Name property to the short name of the application to which the
descriptive flexfield is registered. (Step 3 of Setting Up a Descriptive Flexfield in Oracle
Applications).



                                                                                               481
Oracle Application Framework Developer's Guide


Step 5: Set the Name property to the name of the descriptive flexfield as it was registered.

Note: This differs from how Key Flexfields are defined by shorthand codes.

Step 6: Set the Type property to descriptive.

Step 7: Set the Segment List property as appropriate (see Descriptive Flexfield Segment
List).

Step 8: Finally, you may set the Display Context Field to True or False, depending on
whether you want to hide or show the context for the descriptive flexfield.

Descriptive Flexfield Segment List

If you leave the Segment List property empty, all segments render. The value you specify for
this property must use the following format:

Global Data Elements|[global segment1]|[global
segment2]||...||Context1|[segment1 for context1]|[segment2 for
context1]||...||Context2|....

For our example shown in Figure 1, Packaging Type is the context field and Warehouse is the
global field for the descriptive flexfield. To always display the Warehouse global field and
display the context-sensitive fields Items per Box and Box Size for the Box context and Items
per Pallet and Pallet Weight for the Pallet context, you would specify the following value for the
Segment List property:

Global Data Elements|Warehouse||Box|Items per Box|Box
Size||Pallet|Items per Pallet|Pallet Weight

As shown, segments within a certain context are separated by a single pipe, "|", while data from
a different context is separated by a double pipe, "||".

Read-Only Segments

You can also add the read-only token ($RO$) after any of the segments in the list. For example,
the ($RO$) designator below sets Segment1 to be read-only:

Context1|Segment1($RO$)|Segment2...

Runtime Control

Warning: You should create web beans programmatically only if you cannot create them
declaratively. Programmatically-created web beans cannot be personalized, reused, or
extended easily.

See the OA Framework Controller Coding Standards for additional information about this
and other guidelines that you should consider when writing web bean manipulation code.

482
Oracle Application Framework Developer's Guide, Release 12.1.3


If you have declaratively created a descriptive flexfield and want to autorender the whole
descriptive flexfield structure, you do not have to write any extra code in your controller's
processRequest method.

If you need to programmatically create your descriptive flexfield, you can include code similar to
the example below in your controller's processRequest method. In this example, DescFF is
the item name (of the item with the style flex) in your region:



OADescriptiveFlexBean dffBean = (OADescriptiveFlexBean)

  createWebBean(pageContext, DESCRIPTIVE_FLEX_BEAN, null, "DescFF");

webBean.addIndexedChild(dffBean);
dffBean.setAttributeValue(OAWebBeanConstants.VIEW_USAGE_NAME,"Flextest
VO1");

dffBean.setAttributeValue(OAWebBeanConstants.FLEXFIELD_APPLICATION_SHO
RT_NAME,

  "FND");

dffBean.setAttributeValue(OAWebBeanConstants.REGION_APPLICATION_ID,

  new Integer(0));
dffBean.setAttributeValue(OAWebBeanConstants.FLEXFIELD_NAME,"SimpleFle
x");

In the processFormRequest method, you can also get valid descriptive flexfield data from
your view object's corresponding attributes without any extra coding.

You should also consider these other descriptive flexfield runtime control topics:

   •   Merging Descriptive Flexfield Segments with the Parent Layout
   •   Altering Flexfield UI Layout
   •   processRequest Method
   •   Overwriting the Descriptive Flexfield Context Value
   •   Descriptive Flexfield in a Master/Detail Page
   •   Descriptive Flexfield in a Search Region
   •   Read Only and Rendered Bound Values
   •   Populating a Descriptive Flexfield with Default Values
   •   Overriding a Descriptive Flexfield Segment LOV

Merging Descriptive Flexfield Segments with the Parent Layout

By default, flexfield segments are aligned within themselves but they are not aligned within the
whole (parent) region. If you want to merge descriptive flexfield segments to the parent layout,
you must find the OADescriptiveFlexBean by attribute and call the method

                                                                                                483
Oracle Application Framework Developer's Guide


mergeSegmentsWithParent on
oracle.apps.fnd.framework.webui.beans.OADescriptiveFlexBean in your
controller's processRequest method.

The following code example merges descriptive flexfield segments to the parent layout:



public class RegionCO extends OAControllerImpl

{

  public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

    {

          super.processRequest(pageContext, webBean);



      //find the flexfield that is defined in this region as the item
"DescFF" and merge each

          //individual segment to the outside layout



      OADescriptiveFlexBean dffBean =
(OADescriptiveFlexBean)webBean.findIndexedChildRecursive("DescFF");
      flexBean.mergeSegmentsWithParent(pageContext);

    }



  public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)

    {

          super.processFormRequest(pageContext, webBean);

      }

}

For example, you could add the following line to the end of the "create descriptive flexfield" code
example above:

484
Oracle Application Framework Developer's Guide, Release 12.1.3


dffBean.mergeSegmentsWithParent(pageContext);

Altering the Flexfield UI Layout

Note: This is not recommended by the OA Framework team and may cause problems with
PPR.

If you want to do something unusual with the descriptive flexfield UI layout (like insert a button
after every segment or move the segments around), you need to follow these steps:

   1. Find the OADescriptiveFlexBean by attribute name and call the processFlex
      method on OADescriptiveFlexBean. After this, you will be creating the flexfield
      segment web beans based on metadata and the view object attribute.
   2. Call the getIndexedChild(int)method on the flexfield web bean to go through all
      the child of the flexfield and alter the layout as desired.

processRequest Method

If you change a descriptive flexfield's context value, the descriptive flexfield code must redirect
back to the same page. As a result, the controller processRequest method is called again. If
this behavior causes problems on the page, please use the following code in your
processRequest method:



  public void processRequest(OAPageContext pageContext,

     OAWebBean webBean)

  {String formEvent = pageContext.getParameter(FLEX_FORM_EVENT);
    if (formEvent == null )
      {
       //processRequest ...
      }
  }

Overwriting the Descriptive Flexfield Context Value

If you need to overwrite the descriptive flexfield context value with a value other than the context
derived from the view object, you can do so programmatically using the setFlexContext
method on OADescriptiveFlexBean.

Descriptive Flexfield in a Master/Detail Page

Suppose you implement a Master/Detail page where, if a user selects the single selection radio
button to select a row in the master region, a PPR event is issued. The page's controller then
executes the processFormRequest method to detect the radio button selection and invokes a
method in the application module to mark that row in the master data set as the current row in
the detail region.

                                                                                                485
Oracle Application Framework Developer's Guide


If you want to add a descriptive flexfield to the detail region, you update your controller code
with the following workaround to ensure that the descriptive flexfield gets updated with the
correct context structure when a different row in the master table is selected:



public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)



{

 super.processFormRequest(pageContext, webBean);


pageContext.getApplicationModule(webBean).invokeMethod("refreshDetail"
);

 pageContext.setForwardURLToCurrentPage(null,true,null,(byte)0);

}



public void refreshDetail()

{

 Row[] rows = getFndApplicationVO().getFilteredRows("selection","Y");

 if (rows != null)

 {

    getFndApplicationVO().setCurrentRow(rows[0]);

 }

}

Descriptive Flexfield in a Search Region

Currently if a Search region includes a descriptive flexfield that has a segment of type LOV, any
search criteria that you specify in that flexfield LOV will be auto-validated. LOVs, however,
should not be validated in a search criteria region. To turn validation off, use the following API in
OADescriptiveFlexBean:



486
Oracle Application Framework Developer's Guide, Release 12.1.3


public void setUnvalidated(boolean unvalidated);

If the unvalidated value for this method is true, OA Framework will disable LOV validation
and disable server-side validation for the descriptive flexfield. See Flexfield Validation for more
details.

Read Only and Rendered Bound Values

If you have to implement a flexfield in a table, where the flexfield is read-only or rendered in
some rows and not others, you can do so programmatically using bound values. There is
currently no declarative support for this.

First, create your bound value using OADataBoundValueViewObject or some other
boundValue class. Then set the attribute in your controller's processRequest method as
shown in the examples below:



dffBean.setAttributeValue(READ_ONLY_ATTR,boundValue);

or



dffBean.setAttributeValue(RENDERED_ATTR,boundValue);

Populating a Descriptive Flexfield with Default Values

Previously, if you wanted display the default values of segments when a descriptive flexfield
rendered, you had to use the populateRowWithDFFDefaultValues API in
oracle.apps.fnd.framework.OAFlexUtils. This API would populate a view object row
with the descriptive flexfield default values. Now, OA Framework displays the default values
automatically in the descriptive flexfield whenever you create a new row. If the current row is
loaded from the database, the descriptive flexfield displays the values stored in the database.

Overriding a Descriptive Flexfield Segment LOV

In OA Framework, the LOV for a descriptive flexfield segment is automatically mapped to the
SQL criteria and results for that single segment. However, there may be cases when you want
to associate multiple segments in a descriptive flexfield to the LOV results of a single segment.
In other words, you may want to override a segment LOV such that when a user selects a value
from that segment's LOV, the LOV returns result values for all the other associated flexfield
segments as well. You can override a segment LOV programmatically, using the following
method on OADescriptiveFlexBean:

public void setFlexLovOverrideInfo(Dictionary[] flexLovInfo)

The flexLovInfo parameter is an array of dictionaries. The dictionaries contain the
information necessary to override the flexfield LOV relations so that the segment LOV also

                                                                                                   487
Oracle Application Framework Developer's Guide


returns results to multiple other segments of that descriptive flexfield in the base page. Each
dictionary contains the following properties, which are explained in detail in the Javadoc:

   •    FLEX_LOV_OVERRIDE_SEGMENT - the database column name of the flexfield segment
        whose LOV is to be overridden.
   •    FLEX_LOV_OVERRIDE_RESULTS - a string array of the database column names of the
        flexfield segments that you want to associate with the LOV to override, to return results.
   •    FLEX_LOV_OVERRIDE_VIEWUSAGE - view usage name for the view object containing
        the SQL to override the LOV segment.
   •    FLEX_LOV_OVERRIDE_AM - full path of the application module containing the view
        object specified by FLEX_LOV_OVERRIDE_VIEWUSAGE.

The following code example illustrates how this API is used:



//Create a dictionary array and use arrayMap for each dictionary

  Dictionary[] flexLovOverrideInfo = new Dictionary[1];
  for (int i = 0; i< flexLovOverrideInfo.length; i++)

  {
       flexLovOverrideInfo[i] = new ArrayMap(4);

  }



//Specify AM and VO name for the overriden LOV
  flexLovOverrideInfo[0].put(FLEX_LOV_OVERRIDE_VIEWUSAGE,

    "USCityLovVO");
  flexLovOverrideInfo[0].put(FLEX_LOV_OVERRIDE_AM,


"oracle.apps.per.selfservice.personalinformation.server.AddressUpdateA
M");



//The LOV result will be returned to the following segments,

//and in the new LOV VO, there should be a corresponding column

//for each segment.          If the VO column name is different than the

//segment name, the name should be specified as
"segmentName:lovColumnName".


488
Oracle Application Framework Developer's Guide, Release 12.1.3


//For example: "POSTAL_CODE:ZIP_CODE"
  String[] flexLovOverrideResults = new String[4];
  flexLovOverrideResults[0] = "TOWN_OR_CITY";
  flexLovOverrideResults[1] = "REGION_2";
  flexLovOverrideResults[2] = "POSTAL_CODE:ZIP_CODE";
  flexLovOverrideResults[3] = "REGION_1";
  flexLovOverrideInfo[0].put(FLEX_LOV_OVERRIDE_RESULTS,
  flexLovOverrideResults);



//The LOV will be attached on this segment:
  flexLovOverrideInfo[0].put(FLEX_LOV_OVERRIDE_SEGMENT,

    "TOWN_OR_CITY");



//Set the override info into flexfield web bean.
  flexBean.setFlexLovOverrideInfo(flexLovOverrideInfo);

Descriptive Flexfield Usage Restrictions

  1. A flexfield is supported within a table or advanced table only if the context-sensitive
     segments of a descriptive flexfield are always of the same structure within the table. A
     descriptive flexfield is not supported in the table-in-table feature. See the Oracle Browser
     Look-and-Feel (BLAF) Guidelines: Flexfields [OTN version] and its Open Issues section
     for more details. If you must display descriptive flexfield information from a table, where
     the structure may vary depending on the context, you should implement master/detail
     pages and display the descriptive flexfield structure in the separate detail page.
  2. Multiple descriptive flexfields are supported in a single table and hence a single view
     object, but there should be no overlap between the attributes that the different flexfields
     use, otherwise they will overwrite each other's values.

     Since you cannot change the view object attribute mapping that the flexfield web bean
     uses (for example, it automatically uses the Segment1 view object attribute if a segment
     uses the SEGMENT1 table column), you need to define a prefix for the other flexfields
     using the setFlexPrefix method on the OADescriptiveFlexBean.

     To illustrate, suppose descriptive flexfield DFF1 use ATTRIBUTE1 and ATTRIBUTE2,
     which map to the view object attributes Attribute1 and Attribute2 and descriptive
     flexfield DFF2 use ATTRIBUTE2 and ATTRIBUTE3 which map to the view object
     attributes Attribute2 and Attribute3. Without a prefix, both flexfields update view
     object Attribute2 so one of the values gets overwritten.

     If you call DFF2Bean.setFlexPrefix("DFF2"), the DFF2
     OADescriptiveFlexBean will map to DFF2Attribute2 and DFF2Attribute3 and
     as a result, will no longer conflict with the attributes of the DFF1
     OADescriptiveFlexBean.

                                                                                             489
Oracle Application Framework Developer's Guide


    3. Refer to known flexfield issues for other restrictions.

Key Flexfields
A key flexfield is implemented as an
oracle.apps.fnd.framework.webui.beans.OAKeyFlexBean. An OAKeyFlexBean
automatically renders the layout for the input of segment values. Because a key flexfield does
not have a context field, all the segments for the specified structure code render.

Recall that each key flexfield has a corresponding table, known as a combinations table, that
the flexfield uses to store a list of the complete codes (one column for each segment of the
code) along with the corresponding unique ID number (code combination ID or CCID) for that
code. Pages whose underlying entity objects contain a foreign key reference to the
combinations table are referred to as "foreign key pages", while the page whose underlying
entity object uses the combinations table itself are referred to as "combinations pages" or
"maintenance pages".

Note: the OAKeyFlexBean currently supports only "foreign key pages".

Additional Information: For further discussion of CCIDs, refer to the topics "Combination"
and "Dynamic Insertion" in Chapter 2 ("Planning and Defining Key Flexfields") of the Oracle
Applications Flexfields Guide Release 12. See also the "Flexfields" chapter of the Oracle E-
Business Suite Developer's Guide.

When you add an OAKeyFlexBean to your page, it:

    •    Displays flexfield segments for input or update and may populate flexfield segments with
         database values from corresponding view objects.
    •    Validates input values for flexfield segments and if such a combination already exists,
         uses that current combination's CCID to update the view object. If no such combination
         yet exists, it inserts a new (CCID) row to the combinations table.
    •    Automatically uses the CCID to update the CCID attribute of the view object so that the
         calling page has access to those values if there are no errors. If there are errors, the
         current page is redrawn by OA Framework with corresponding error messages.

Key Flexfield UI in a Table

When a key flexfield is displayed in a table, the concatenated segment descriptions are also
displayed, as shown in Figure 2.

Figure 2: Key Flexfield in a Table




490
Oracle Application Framework Developer's Guide, Release 12.1.3




Key Flexfield Combination LOV UI

Based on the Oracle Browser Look-and-Feel (BLAF) Guidelines: Flexfields [OTN version], key
flexfields are implemented as code combination LOVs rather than as individual segments in the
UI. You can type in a combination code directly in the code combination LOV input.

Using this new UI, you can also select the code combination LOV icon to the right of the input
field, as shown in the Operations Accounting Flexfield in Figure 3.

Figure 3: Combination LOV Key Flexfield on a Base Page




The resulting advanced Search page can be used to search for an existing key flexfield
combination. The Search page is rendered as two regions, the Search region and the Result
region. Each segment of the key flexfield is rendered in the Search region. You do not need to
enter values for all segments when searching for a key flexfield code combination.

Figure 4: Search Page for Key Flexfield Combination LOV




                                                                                               491
Oracle Application Framework Developer's Guide




Note: OA Framework currently does not support searching across a range of concatenated
segments or individual segments and returns a developer mode error if specified. See the
"Range form" topic in Chapter 2 ("Planning and Defining Key Flexfields") of the Oracle E-
Business Suite Flexfields Guide Release 12 for more information about this feature in
Oracle E-Business Suite.

Note: Backwards-Compatibility - The new key flexfield combination LOV UI generates
one LOV web bean for the key flexfield instead of multiple child web beans for each
segment of the flexfield. Some controllers may have dependencies on the old key flexfield
UI. To fix this backwards-compatibility issue, you can turn off the new key flexfield UI by
setting the FND_FWK_COMPATIBILITY_MODE profile to 11.5.9 or using the following Java
API:



       OAKeyFlexBean.useCodeCombinationLOV (boolean false);

Dynamic Insertion

When dynamic insertion is turned on for a key flexfield, a Create button is enabled in the key
flexfield combination LOV Search page. If dynamic insertion is allowed and you enter all the
required segments for a key flexfield and find no matches on the combination LOV search page,
you can select the Create button to create the new code combination.

492
Oracle Application Framework Developer's Guide, Release 12.1.3


Required Segments

If a key flexfield segment is defined as "required" in Oracle Applications, OA Framework
displays an asterisk (*) before the segment. When you perform a search in the combination LOV
Search page, you do not have to specify a value for a "required" segment. OA Framework only
considers the "required" attribute of the segment when you attempt to create a new code
combination with dynamic insertion.

PPR Support

If a PPR action occurs on a page and the view object attribute for the key flexfield is changed
during the processFormRequest method, OA Framework automatically adds the flexfield web
bean as a target for PPR and rerenders the key flexfield.

Setting Up a Key Flexfield in Oracle E-Business Suite

Before you can add a key flexfield to an OA Framework page, you must first set up the key
flexfield in Oracle E-Business Suite. To start, review Chapter 2 ("Planning and Defining Key
Flexfields") in the Oracle E-Business Suite Flexfields Guide Release 12.

When you have a clear plan for the key flexfield you wish to set up, refer to the section titled
"Implementing Key Flexfields" in Chapter 14 ("Flexfields") of the Oracle E-Business Suite
Developer's Guide Release 12 for instructions to the following general steps:

       Step 1: Define key flexfield columns in your database, including your
       combinations table.

       Step 2: Register your key flexfield table with Oracle Application Object Library.

       Step 3: Register your key flexfield using the Key Flexfields Window.

Next, refer to the Oracle E-Business Suite Flexfields Guide Release 12 for instructions to these
general steps:

       Step 4: Define your value sets in the Value Sets Window, as described in
       Chapter 5 ("Values and Value Sets").

       Step 5: Define your key flexfield structure and segments using the Key Flexfield
       Segments Window, as described in the "Defining Key Flexfield Structures" and
       "Defining Segments" sections of Chapter 3 ("Planning and Defining Key
       Flexfields").

       Step 6: When you are ready to add the key flexfield to an OA Framework page,
       follow the steps outlined in the Declarative Implementation and Runtime Control
       sections below.

Declarative Implementation

The following steps describe how to add a key flexfield item to an OA Framework region:

                                                                                                   493
Oracle Application Framework Developer's Guide


Step 0: Ensure that the view object underlying the region includes the CCID column (the foreign
key reference).

Step 1: In your region, choose New > Item from the context menu and set the Item Style of
the new item to flex.

Note: You cannot create a flex item directly under a messageComponentLayout region, but
you can create a messageLayout region under the messageComponentLayout region and
add the flex item under the messageLayout region.

Step 2: Specify the View Instance for your flexfield. This view object instance should be the
same view object instance that you specified for the region. Note that when you create the view
object, you need only include the CCID column.

Note: OA Framework can support multiple key flexfields in a page, as well as in a table and
on the same view object as long as each key flexfield is using a different
CCIDAttributeName. See the Runtime Control section for details on how to specify the
CCID column for your view object.

Note: If a flexfield's view object does not return a row, an OAException will not be thrown so
that the controller's processRequest method can still execute and render the flexfield.

Note: OA Framework automatically handles dynamic insertion for you. See the Runtime
Control section if you want to handle the dynamic insertion yourself.

Step 3: Set the key flexfield's Appl Short Name property to the short name of the application
to which the key flexfield is registered.

Step 4: Set the key flexfield's Name property to the code of the key flexfield as it is registered.

Note: This differs from how a descriptive flexfield is defined by a Name.

Step 5: Set the key flexfield's Type property to key.

Step 6: Finally, set the Segment List property as appropriate (see Key Flexfield Segment
List).

Key Flexfield Segment List

You may fill in the Segment List property if you want to show some, but not all of the
segments in your flexfield. If you leave this property empty, all segments are rendered. The
syntax is similar to that described for descriptive flexfields, only you should use structure codes
to replace context values. The format is:

structure code1|segment1's name|segment2's name...||structure
code2|segment4's name|segment5' name...




494
Oracle Application Framework Developer's Guide, Release 12.1.3


Segments within a certain structure code are separated by a single pipe, "|", while data from a
different structure codes is separated by a double pipe, "||". The example below lists segments
for just one structure code:

FWK Item Flexfield|Manufacturer|Product Family|Product

Read-Only Segments

You can add the read-only token ($RO$) after any of the segments in the list. For example, the
($RO$) designator below sets Segment1 in structure code 1 to be read-only:

Structure code1|Segment1($RO$)|Segment2...

Runtime Control

Warning: You should create web beans programmatically only if you cannot create them
declaratively. Programmatically created web beans cannot be personalized, reused, or
extended easily.

See the OA Framework Controller Coding Standards for additional information about this
and other guidelines that you should consider when writing web bean manipulation code.

If you need to programmatically create your key flexfield, the following are very important to
include in your code:

    •   Call the setStructureCode method on the OAKeyFlexBean to specify the structure
        for the key flexfield.
    •   Call the setCCIDAttributeName method on the OAKeyFlexBean to specify the
        CCID attribute name in your view object if it does not include all the individual flexfield
        segments in the view object. When you input a value in a key flexfield segment and
        submit the page, the key flexfield determines the code combination from the
        combinations table (maintained by OA Framework) and sets the CCID on your view
        object's CCID column. If dynamic insertion is enabled for a key flexfield and you input a
        combination that is not in the combinations table, OA Framework will create that
        combination as a record in the combinations table, and return a valid CCID. If dynamic
        insertion is not enabled, OA Framework returns "-20" as the CCID, indicating that the
        input combination is not found in the combinations table and dynamic validation is turned
        off.

The following code is an example of how to programmatically create a key flexfield:



public class RegionCO extends OAControllerImpl

{

  public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

                                                                                                 495
Oracle Application Framework Developer's Guide


  {

       super.processRequest(pageContext, webBean);

       OAKeyFlexBean kffBean = (OAKeyFlexBean)

          createWebBean(pageContext, KEY_FLEX_BEAN);

       kffBean.setAttributeValue(OAWebBeanConstants.VIEW_USAGE_NAME,

          "FNDFlexTestVO");


kffBean.setAttributeValue(OAWebBeanConstants.FLEXFIELD_APPLICATION_SHO
RT_NAME,

          applicationShortName);

kffBean.setAttributeValue(OAWebBeanConstants.REGION_APPLICATION_ID,

          new Integer(applicationId));

kffBean.setAttributeValue(OAWebBeanConstants.FLEXFIELD_NAME,idFlexCode
);

       kffBean.setCCIDAttributeName("UniqueIdColumn2");

       kffBean.setStructureCode(idFlexStructureCode);



      //optional:
      kffBean.setDynamicInsertion(isdynamicInsertion); //set dynamic
insertion


kffBean.setAttributeValue(OAWebBeanConstants.FLEXFIELD_SEGMENT_LIST,

          segmentList); //set segmentlist

       kffBean.useCodeCombinationLOV(false);

       //if you need old style key flexfield in 5.10 mode


  }




496
Oracle Application Framework Developer's Guide, Release 12.1.3


  public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)

    {

            super.processFormRequest(pageContext, webBean);

        }

}

You should also consider these other key flexfield runtime control topics:

    •       Merging Key Flexfield Segments with the Parent Layout
    •       Handling Dynamic Insertion
    •       Read Only and Rendered Bound Values
    •       Adding a VRule to a Key Flexfield Web Bean



Merging Key Flexfield Segments with the Parent Layout

By default, flexfield segments are aligned within themselves but they are not aligned within the
whole (parent) region. If you want to merge key flexfield segments to the parent layout, you
must find the OAKeyFlexBean by attribute name and call the method
mergeSegmentsWithParent on OAKeyFlexBean.

The following code example merges key flexfield segments to its parent layout. In this example,
KeyFF is the item name (of the item with the style flex) in your region:



public class RegionCO extends OAControllerImpl

{

  public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

    {

            super.processRequest(pageContext, webBean);



      //find the flexfield that is defined in this region as item
"KeyFF" and merge each

            //individual segment to the outside layout

                                                                                              497
Oracle Application Framework Developer's Guide




      OAKeyFlexBean kffBean =
(OAKeyFlexBean)webBean.findIndexedChildRecursive("KeyFF");
      flexBean.setStructureCode("FWK Item Flexfield");
      flexBean.setCCIDAttributeName("FwkitemId");
      flexBean.mergeSegmentsWithParent(pageContext);

     }



  public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)

     {

          super.processFormRequest(pageContext, webBean);

      }

}

Handling Dynamic Insertion

If you wish to handle dynamic insertion yourself, you must first disable dynamic insertion by
calling setDynamicInsertion(false)on the OAKeyFlexBean. Additionally, the
submitButton for the page that contains the key flexfield must have its validation disabled.

Note: For additional information about dynamic insertion, refer to the "Dynamic Insertion"
section of Chapter 2 ("Planning and Defining Key Flexfields") in the Oracle E-Business
Suite Flexfields Guide Release 12.

Read Only and Rendered Bound Values

If you have to implement a flexfield in a table, where the flexfield is read-only or rendered in
some rows and not others, you can do so programmatically using bound values. There is
currently no declarative support for this.

First, create your bound value using OADataBoundValueViewObject or some other
boundValue class. Then set the attribute in your controller's processRequest method as
shown in the examples below:



kffBean.setAttributeValue(READ_ONLY_ATTR,boundValue);

or


498
Oracle Application Framework Developer's Guide, Release 12.1.3




kffBean.setAttributeValue(RENDERED_ATTR,boundValue);

Adding a VRule to a Key Flexfield Web Bean

A VRule is a validation rule that allows you to put extra restrictions on what values a user can
enter in a key flexfield segment based on the values of segment qualifiers (which are attached
to individual segment values).

Additional Information: Refer to the "Qualifiers" topic in Chapter 2 ("Planning and Defining
Key Flexfields") of the Oracle E-Business Suite Flexfields Guide Release 12 for further
discussion of flexfield and segment qualifiers.

You can add one or more VRules to a key flexfield web bean by using the addVRule method
on OAKeyFlexBean. This method allows you to specify the flexfield qualifier and segment
qualifier to validate, validation value(s) for the segment qualifier, whether to Include (true) or
Exclude (false) the user entered value if its segment qualifier matches the specified validation
value, and the Message Dictionary error message to display if the user enters an improper
value. See the addVRule Javadoc for complete usage information about this method. This
method should be called before the processFlex or mergeSegmentsWithParent methods.

As an example, suppose you implement a page where you want to prevent your users from
entering segment values into segments of Oracle General Ledger's Accounting Flexfield, for
which detail posting is not allowed. DETAIL_POSTING_ALLOWED is the segment qualifier,
based on the global flexfield qualifier GL_GLOBAL, that you want to use in your rule. You want
to exclude all values whose segment qualifier value of DETAIL_POSTING_ALLOWED is N
(No). Your message name is "GL Detail Posting Not Allowed", and it corresponds to a message
that says "you cannot use values for which detail posting is not allowed." You would add this
VRule as follows:



kffbean.addVRule (GL_GLOBAL, DETAIL_POSTING_ALLOWED,

  "GL Detail Posting Not Allowed", false, N);

When a user enters an excluded value in one of the segments affected by this qualifier, the user
gets the error message specified. In addition, the excluded values do not appear in the LOV of
your segments. All other values, not specifically excluded are displayed.

Additional Information: For more information about VRules, refer to Chapter 9 ("Key
Flexfield Routines for Special Validation") in the Oracle E-Business Suite Flexfields Guide
Release 12.

Personalization Considerations

   •   See a summary of Flexfields personalization considerations in the Oracle Application
       Framework Personalization Guide.

                                                                                               499
Oracle Application Framework Developer's Guide


Reference Fields
A reference field is a web bean that participates in evaluating one or more properties of a
flexfield, such as default segment value, value set and context reference field for Descriptive
flexfields. Such reference web beans are mapped to :$PROFILES$.*<NAME> references that
are used in flexfields' properties. <NAME> can take any alphanumeric value thus providing a
potentially infinite namespace of named parameters that can be passed from the OA
Framework UI to the flexfield definition. Named parameters are mapped to reference web beans
using flexfield maps. Whenever the value in the reference web bean changes, the page is
refreshed with changes to the corresponding flexfield properties. The reference web bean
display value is used for substituting the references in the properties.

Note: OA Framework does not have explicit support for :<BLOCK>.<FIELD> references that
map fields in a form to a flexfield in Forms-based applications. If a flexfield used in a Forms-
based application is to be re-used in an OA Framework based application, all the
:<BLOCK>.<FIELD> references should be replaced with :$PROFILES$.*<NAME> references.

Declarative Implementation:

By default no flexfield maps metadata exists under a flex item. The following steps describe how
to set up reference fields by adding flexfield maps to a flex item:

   1. Right click on the flex item and select New > flexMaps
   2. Specify a standards-compliant ID, an Attribute Set and other properties as usual for any
      item.
   3. Specify the parameter name in the Name property of the flex maps. For example, if your
      Flexfield definition uses a named parameter $PROFILE$.*paramName, then set the
      Name property as *paramName.
   4. Specify the value or value binding that needs to be set on the parameter.
      The value can be one of the following:
          o A Constant Value
          o A View attribute, represented by SPEL (Simplest Possible Expression Language)
              as${oa.<viewUsage>.<viewAttribute>}
          o The name of the web bean on the current OA Framework page that will act as
              the reference field, represented by the SPEL - ${oa.page.<referenceId>}
   5. (Optional): (Only for Descriptive Flexfields) Set the Refer Context property to true if this
      flex map acts as a Reference Field.

       Repeat the above steps for creating as many flex maps as there are references.

Runtime Control:

You can also access or modify the flex map metadata to remove the existing flex maps
programmatically. Doing so, can override the behavior due to flex map metadata.



public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

500
Oracle Application Framework Developer's Guide, Release 12.1.3


{

    super.processRequest(pageContext, webBean);

    ...

    OADescriptiveFlexBean flexBean =

 (OADescriptiveFlexBean)webBean.findIndexedChildRecursive("FlexItem");

      OAFlexMaps flexMaps = new OAFlexMaps();

      if (dffBean != null)

      {

          flexMaps = flexBean.processFlexMap(pageContext);

      }

      flexMaps.remove("flexMap");

    OAWebBean referenceField =
webBean.findChildRecursive("referenceItem");

      OAFlexMap map1 = new OAFlexMap("flexMap1", new

OABoundValueFlexReference(referenceField), "*paramName", true);

          flexMaps.add(map1);

 flexBean.setFlexMaps(flexMaps);

...

}

If you need to programmatically create flexfield maps for your flexfield, you can include code
similar to the example below in your controller's processRequest method. In the following
example, flexBean is the flexfield web bean that contains the new flexfield maps and
referenceItem is the Name of the reference web bean.

public void processRequest(OAPageContext pageContext, OAWebBean
webBean)
{
super.processRequest(pageContext, webBean);
...
OAWebBean rootBean = pageContext.getRootWebBean();
OAWebBean referenceBean =

                                                                                                 501
Oracle Application Framework Developer's Guide


rootBean.findIndexedChildRecursive("referenceItem");
OAFlexMaps flexMaps = flexBean.getFlexMaps();
if (flexMaps == null) flexMaps = new OAFlexMaps();
OAFlexMap map = new OAFlexMap("flexMap", new
OABoundValueFlexReference(referenceBean), "*paramName");
flexMaps.add(map);
flexBean.setFlexMaps(flexMaps);
...
}

Note the following important restrictions:

   •   OABoundValueFlexReference is the equivalent of the SPEL binding
       ${oa.page.<id>}. The OAFlexMap can take an optional fourth parameter of Boolean
       type. A true value indicates that value change in this field is going to trigger a change in
       the Context field. Please refer to the Javadoc of OAFlexMaps for more details.
   •   When a flex map is defined for a context reference field (of a descriptive flexfield) and
       the synchronize context flag is selected in the Flexfield definition, then the context field is
       disabled in the UI as the context reference web bean will act as the single source for the
       context.
   •   When a flex item is in update mode and the value derived from the view object row
       associated with this flexfield is different from the value supplied in the reference web
       bean, the following message displays:

       "The value in flexfield context reference web bean does not match with the value
       in the context of the Descriptive flexfield web bean PermitFlex. If this is not
       intended, please go back to correct the data or contact your Systems
       Administrator for assistance."

   •   OA Framework will associate a standard flex event with the name
       "FlexReferenceUpdate" with any reference web bean. If the reference web bean is
       already associated with an event, an error would be thrown indicating that this web bean
       cannot act as a reference web bean.

Usage Restrictions

   1. If a reference web bean is to have a default value, then this should be set either
      declaratively or in the processRequest of a controller of any of the container region of
      the flex web bean.
   2. Reference web beans cannot be under a Table, an Advanced Table or an HGrid.
   3. Refer to known flexfield issues for other restrictions.

Personalization Considerations

   •   See a summary of Flexfields personalization considerations in the Oracle Application
       Framework Personalization Guide.
   •   System Administrator can create flexMaps using personalization UI.

Values and Value Sets
502
Oracle Application Framework Developer's Guide, Release 12.1.3


Generally, the value entered in a key or descriptive flexfield segment is validated against a
predefined set of valid values (a "value set"). When you define your value set, you can specify
the types of values that can fit into the value set by setting up formatting rules. The validation
type that you specify for your value set will determine how a user can enter or use the segment
in the flexfield. The validation types are:

   •   None - no validation, so a value can be entered as long as it meets the formatting rules.
   •   Independent - provides a predefined list of values for a segment that are stored in an
       Oracle Application Object Library table.
   •   Table - provides a predefined list of values like an independent value set, but its values
       are stored in an application table. The values are defined by the table you specify and
       the WHERE clause that limits the values to use in the set. You can use bind variables
       such as $FLEX$ and $PROFILES$ in your WHERE clause to base your list of possible
       values on other values. For example, $PROFILES$ lets you bind the value to a specific
       profile option and $FLEX$ lets you bind to the value of a prior segment.

       Additional Information: Refer to the topic "Bind Variables" in Chapter 4 ("Values and Value
       Sets") of the Oracle E-Business Suite Flexfields Guide Release 12 for details on how to use
       these bind variables.

   •   Dependent - provides a predefined list of values, but the values depend on the
       independent value specified in a prior segment of the flexfield structure.
   •   Translatable Independent and Translatable Dependent - similar to Independent and
       Dependent value sets, respectively, except that a translated value can be used.
   •   Special and Pair Value Sets - these value sets provides a mechanism to pass key
       flexfield segment values or combinations as report criteria for Standard Request
       Submission (also referred to as a "flexfield-within-flexfield"). The "Special" and "Pair"
       validation types are not yet supported in OA Framework and will result in a developer
       mode error if specified.

       Additional Information: To learn more about defining a report parameters window
       (descriptive flexfield) for Standard Request Submission or about "Special" or "Pair" value
       sets, refer to Chapter 7 ("Standard Request Submission") in the Oracle E-Business Suite
       Flexfields Guide Release 12.

When a value set's list type is 'Poplist' or 'List of Values', OA Framework automatically renders
the segment as a poplist or a LOV, respectively.

Additional Information: To learn more about value sets, refer to Chapter 4 - "Values and
Value Sets", in the Oracle Applications Flexfields Guide Release 12.

Flexfield Validation
When you implement a page with an Action (Submit) Button, you have the option of setting the
page submit, when the button is selected, to be 'validated' or 'unvalidated'. The behavior of a
flexfield in such a page will vary depending on whether you set the submitButton properties
Disable Server Side Validation and Disable Client Side Validation to true
or false.



                                                                                                    503
Oracle Application Framework Developer's Guide


Note: For Flexfields, to address backwards-compatibility, setting either the Disable
Server Side Validation or Disable Client Side Validation property to true
disables ALL validation, that is, both server and client validation.)

The following table describes a flexfield's behavior when both the client and server validation is
disabled and enabled.

Disable Validation                             Effect on Flexfield Behavior
  (Client and/or
      Server)
False                 1. On the client side, client Javascript checks for required field(s) and date
                      format(s) and displays a Javascript error if error is found.
                      2. On the server side, all data entered in the UI is posted to the FlexJ
                      object, and if any segment input data is invalid (such as a wrong format),
                      an error is thrown.
                      3. The FlexJ object.validate method is called to validate the whole
                      flexfield. If there is any error, an exception is thrown on the UI.
                      4. If all validation passes, the data is populated to the view object.
True                  1. Any client Javascript is not triggered.
                      2. On the server side, when all data is posted to the FlexJ object, if
                      any user input for any segment has an invalid format, the value is
                      discarded, but no error will be thrown.
                      3. The FlexJ object.validate method is not called.
                      4. All data is posted to the view object as is.

An example of when you may want an unvalidated submit is when you have a descriptive
flexfield in a Search region.

Flexfields and Standard Request Submission
The Report Parameters window for Standard Request Submission (SRS), that allows users to
enter criteria for their reports, is a special descriptive flexfield. While many of the setup steps for
Report Parameters are similar to that of a descriptive flexfield, the main differences are that you
use the Concurrent Programs window to define your segments instead of using the Descriptive
Flexfield Segments window and the way you define and use value sets for SRS report
parameters is more complex.

Additional Information: Refer to Chapters 7 ("Standard Request Submission") and 8
("Reporting on Flexfields Data") in the Oracle E-Business Suite Flexfields Guide Release
12.

If you want to provide a flexfield as a report parameter (also referred to as a flexfield-within-a-
flexfield), you can use a flexfield routine to specify the type of flexfield you want as a value set
for the report parameter.



504
Oracle Application Framework Developer's Guide, Release 12.1.3


Additional Information: Chapter 9 ("Key Flexfield Routines for Special Validation") in the
Oracle E-Business Suite Flexfields Guide Release 12 lists the syntax for the key flexfield
routines.

Developer Mode Errors
Oracle E-Business Suite throws a developer mode error if any of the following flexfield
implementations are detected:

   •   A reference field is used in flexfield.
   •   A pair value set is used in flexfield.
   •   A special value set is used in flexfield.
   •   A flexfield is in a Table-in-Table layout.
   •   A flexfield is directly put in a Message layout.
   •   A flexfield is in a Query bean layout

Troubleshooting Flexfield Problems
If your flexfield is not working as expected or there is an error on the flexfield, you can follow
these troubleshooting steps to help identify the source of the problem:

Step 1: Check your flexfield setup.

Login to your Oracle E-Business Suite Forms-based environment as an applications developer,
and navigate to the Segments window (Flexfield > Descriptive/Key > Segments). Identify the
flexfield you are using, then make sure the Freeze Flexfield Definition checkbox is checked for
this flexfield. Compile the flexfield again. If your flexfield is using some feature that is not
supported by OA Framework page, a warning message will appear.

Step 2: Run the Flexfield Test tool under the guidance of your support representative.

Login to your Oracle E-Business Suite Forms-based environment as an applications developer,
and navigate to the Flexfield Text window (Flexfield > Flexfield Test). Identify the flexfield you
are using and follow the instructions provided by your support representative to use the Flexfield
Test window.

Step 3: Check if there is any developer mode error for your flexfield on the OA
Framework page.

At run time, OA Framework checks if the flexfield is properly configured and used. If it finds
anything wrong with the flexfield, OA Framework renders a developer mode error on the page
as well as lists these errors, if any, in the "About" Page. To enable Developer Test Mode
diagnostics, you must set the profile option FND: Developer Mode / FND_DEVELOPER_MODE
to Yes. To render the "About this page" link at the bottom of every OA Framework page, you
must set the profile option FND: Diagnostics / FND_DIAGNOSTICS to Yes.

Step 4: Use the "About" page to get more information about the flexfield.


                                                                                                     505
Oracle Application Framework Developer's Guide


On the bottom of every OA Framework page, there is an "About this page" link (if the profile
option FND: Diagnostics / FND_DIAGNOSTICS is set to Yes). When you open the "About"
page, you can see the page structure as well as the flexfield detail information in the Page tab.
All flexfield information is listed in the Flexfield References section, including:

   •   The flexfield name and Applications ID.
   •   Detail information about each segment, such as segment name and segment value set.
   •   Whether there is any developer mode error for the flexfield.

Known Issues
   •   See a summary of known flexfield issues with suggested workarounds if available.
   •   The specified reference field should exist in the current OA Framework page.
   •   A standard flex event with the name "FlexReferenceUpdate" event would be associated
       with the reference bean specified. If the reference bean already is associated with an
       action, an error would be thrown indicating the bean specified cannot act as a reference
       field.
   •   When a flex item is in update mode and the value derived from the view object row
       associated with this flexfield is different from the value supplied in the reference web
       bean, the following message displays:

       "The value in flexfield context reference web bean does not match with the value
       in the context of the Descriptive flexfield web bean PermitFlex. If this is not
       intended, please go back to correct the data or contact your Systems
       Administrator for assistance."

   •   If there are multiple reference fields for the same property of a field, the order in which
       the field is taken into consideration is uncertain.
   •   A reference field cannot be under a Table or Advanced Table or H-Grid.

Related Information
           o   BLAF UI Guideline(s)
                   Flexfields [OTN version]
           o   Javadoc File(s)
                   oracle.apps.fnd.framework.webui.beans.OADescriptiveFle
                     xBean
                   oracle.apps.fnd.framework.webui.beans.OAKeyFlexBean
                   oracle.apps.fnd.framework.webui.beans.OAWebBean
                   oracle.apps.fnd.framework.OAFlexUtils
                   oracle.apps.fnd.framework.webui.OAFlexMap
                   oracle.apps.fnd.framework.webui.OAFlexMaps
                   oracle.apps.fnd.framework.webui.OABoundValueFlexRefere
                     nce
           o   Lesson(s)
                   Framework Toolbox Tutorial Supplemental Lesson: Creating Descriptive
                     and Key Flexfields
           o   ToolBox Tutorial / Sample Library
           o   FAQs

506
Oracle Application Framework Developer's Guide, Release 12.1.3


   Flexfields




                                                                      507
Oracle Application Framework Developer's Guide



Forms / OA Framework Page Integration
Overview
Both OA Framework and Oracle E-Business Suite provide support for the integration of Oracle
Forms-based Oracle E-Business Suite forms with OA Framework-based pages. You can launch
an Oracle E-Business Suite form from an OA Framework page as well as call an OA Framework
HTML page from an Oracle E-Business Suite form.

Contents

   •   Launching Oracle E-Business Suite Forms from OA Framework Pages
   •   Launching OA Framework Pages from Oracle E-Business Suite Forms

Launching Oracle E-Business Suite Forms from OA Framework
Pages
To launch an Oracle E-Business Suite form from OA Framework, you must first define a button,
link or image web bean. The web bean then relies on the FormsLauncher applet provided by
Oracle E-Business Suite (AOL/J) to launch the specified form.

Declarative Implementation

Step 1: In the OA Extension Structure pane, select the region in which you want to create the
web bean to launch an Oracle E-Business Suite form. Choose New > Item from the context
menu.

Step 2: Set the ID property for the item, in accordance with the OA Framework File Standards,
and set the Item Style property to button, image, or link. You may also launch an Oracle
Applications form from a submit button. See the Runtime Control section below for more details.

Step 3: Set the Destination URI property of the item with a value following this format
(replacing the italicized text as appropriate):

form:responsibilityApplicationShortName:responsibilityKey:securityGroupKey:functionN
ame

For example, if you want to launch the FND Menus form, the Destination URI property should
be set to:

form:SYSADMIN:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDMNMNU

Step 4: If you wish to pass parameters to the form, set the Destination URI property with a
value using the following format (Note that the parameter list is delimited by a space between
each "parameter=value" pair):


508
Oracle Application Framework Developer's Guide, Release 12.1.3


form:responsibilityApplicationShortName:responsibilityKey:securityGroupKey:functionN
ame:param1=value1 param2=value2 param3=value3

Note: If you wish to send varchar2 parameter values that contain spaces, use " to enclose
the string value. For example, to pass in something of the form:

TXN_NUMBER=LT INVOICE 1

Use:

TXN_NUMBER="LT INVOICE 1"

Step 5: Refer to the following Chapter 4 topics for information about additional properties you
may need to set for the specific item: Buttons(Action/Navigation), Buttons (Links), or Images in
Your Pages.

Runtime Control

There are no special programmatic steps necessary to launch an Oracle E-Business Suite form
from a button, image, or link in an OA Framework page. The OAButtonBean, OALinkBean and
OAImageBean support the special form function URL format described above for the
Destination URI property. When OA Framework encounters this special value, it generates
the appropriate URL and also adds a hidden IFrame (inline frame) to the OA Framework page.
The hidden IFrame is the target of the FormsLauncher applet provided by Oracle E-Business
Suite.

Launching an Oracle E-Business Suite Form From a Submit Button

If you wish to launch an Oracle E-Business Suite form from a submit button in an OA
Framework page, you must use the
OAPageContext.forwardImmediatelyToForm(String url) method from
oracle.apps.fnd.framework.webui.OAPageContext. An example of how to use this
API is shown in the code sample below:



public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)

{
 super.processFormRequest(pageContext, webBean);
 if (pageContext.getParameter("Apply")!=null)
 {
  String destination =

       "form:SYSADMIN:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDMNMNU";




                                                                                              509
Oracle Application Framework Developer's Guide


  pageContext.forwardImmediatelyToForm(destination);
 }
}

Usage Notes

Microsoft Internet Explorer supports the IFrame element, so when you launch an Oracle E-
Business Suite form from OA Framework, only a splash window appears. Any other windows
required by the FormsLauncher applet use(s) the hidden IFrame as the target and therefore
remain(s) hidden from the user. Netscape Navigator, on the other hand, does not support the
IFrame element, so in addition to a splash window, the user also sees another window used by
the FormsLauncher applet.

Launching OA Framework Pages from Oracle E-Business Suite
Forms

Declarative Implementation

To launch an OA Framework page from Oracle Forms-based Oracle E-Business Suite forms,
you must define a function to represent the OA Framework page. A function based on an OA
Framework page is defined in exactly the same way as any other function in Oracle E-Business
Suite. You define the function in the Oracle E-Business Suite Form Functions form and specify
the function's Type, as JSP. Refer to the Oracle E-Business Suite Developer's Guide for more
information. The function you define is automatically identified by the Oracle E-Business Suite
menu and no further action is needed.

Runtime Control

If you wish to call the OA Framework page function directly from an Oracle Applications form,
you must use the following Oracle E-Business Suite API:



PACKAGE FND_FUNCTION IS
procedure EXECUTE(function_name in varchar2,
                  open_flag     in varchar2 default 'Y',
                  session_flag in varchar2 default 'SESSION',
                  other_params in varchar2 default NULL,
                  activate_flag in varchar2 default 'ACTIVATE',
                  browser_target in varchar2 default NULL);

You can also pass additional parameters via other_params using a URL format, such as
name1=value1&name2=value2...

For example:




510
Oracle Application Framework Developer's Guide, Release 12.1.3


fnd_function.execute( function_name => 'OKE_OKEKVCOM'
                            other_params =>
'headerid='||:parameter.k_header_id||

                                     '&Ver1='||:compare_version.version1||
                                     '&Ver2='||:compare_version.version2);

Note: There is no ampersand (&) in front of the first parameter name/value pair, but there is
an ampersand in front of subsequent parameter name/value pairs.

Note: The open_flag and session_flag parameters are not shown in the above
example because they are redundant for an HTML function.

Personalization Considerations
   •   See a summary of Forms / OA Framework Page Integration personalization
       considerations in the Oracle Application Framework Personalization Guide.

Known Issues
   •   None

Related Information
   •   BLAF UI Guideline(s)
   •   Javadoc File(s)
   •   Lesson(s)
   •   Sample Code




                                                                                         511
Oracle Application Framework Developer's Guide



Headers and Subheaders
Overview
Per the BLAF UI Guide: Headers and Subheaders [ OTN Version ]specification, the header
component is used to title and separate page contents as illustrated below.

Figure 1: Example of headers, subheaders and subsubheaders in a page.




Primary Header (Page Title)
All pages, except for the "Home" page, should have a page title that describes the page's
contents. Not only does this text provide useful information to the user, but the OA Framework
also uses this value to:

    •    Determine whether page-level action/navigation buttons render both below the page
         contents bottom line (the "ski") and the page title as shown in Figure 2 below. If you don't
         specify a page title, these buttons render below the "ski" and not at the top of the page
    •    Set breadcrumb text when you drill down from the page (if the page title property isn't
         set, the framework will use the browser window title instead -- and if you've followed the
         UI guidelines in setting the window title, your breadcrumbs will be incorrect)

Figure 2: Example of page-level action/navigation buttons rendering below the page title (displayed with the text "Header 1"),
and below the "ski"




512
Oracle Application Framework Developer's Guide, Release 12.1.3




Declarative Implementation

To add a page title, simply specify the Title property for your pageLayout region.

Note: The pageLayout region also has a Window Title property which is used to specify the
browser's window title. This has nothing to do with specifying the page title.

Warning: Although your page may appear to have a page title if you add a header or one of the
"default" regions to your pageLayout, the OA Framework does not interpret this as a page title.
You must explicitly specify the region property as described.

Runtime Control

Warning: See the OA Framework Controller Coding Standards for guidelines that you should
consider when writing web bean manipulation code.

Instantiate

Since the page title is a property of the page layout itself, you can't instantiate a page title
directly. Instead, you set it on the
oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean as shown
below.

Control Visual Properties

To set the page title programmatically (which is a common practice if you need to specify
context for the header like you would with "Update Employee: Fred Flintstone"), do the
following:



import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
...

                                                                                               513
Oracle Application Framework Developer's Guide


processRequest(OAPageContext pageContext, OAWebBean webBean)
{
...
    // Assuming the controller is associated with the pageLayout
region
    OAPageLayoutBean page = (OAPageLayoutBean)webBean;



   // Assuming the controller is associated with a child/grandchild
region of the

      // pagelayout region

   OAPageLayoutBean page =
(OAPageLayoutBean)pageContext.getPageLayoutBean();



   // Always set translated text Strings obtained from Message
Dictionary

      page.setTitle(<title text>);

...



See Example: Implementing Search & Drilldown to Details for a more detailed example of
setting a contextual page title.

Subheaders
The UI guidelines allow for two levels of subheaders below the page title: a "subheader" and a
"subsubheader" as shown in Figure 1 above.

Declarative Implementation

   •    To add a subheader to your page add a region with one of the styles listed in Figure 3
        to a pageLayout.
   •    To add a subsubheader, add a region with one of the styles listed in Figure 3 to any
        subheader. Remember to specify its ID property in accordance the OA Framework
        Package / File / Directory naming standards.

In both cases, the framework automatically indents the header in relation to its parent region,
and sizes the header text in accordance with the UI guidelines.




514
Oracle Application Framework Developer's Guide, Release 12.1.3


Tip: The classes corresponding to each of the "default" region styles subclass
oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean, so they all
behave as headers in your page. If you want to use these regions as layout templates, and you
don't want the header line to show, set the Hide Header property to True.

Figure 3: Relationship between header region styles and OA Framework classes


Region Style           OA Framework Class
header                 oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean
defaultSingleColu oracle.apps.fnd.framework.webui.beans.layout.OADefaultSin
mn                gleColumnBean
defaultDoubleCol oracle.apps.fnd.framework.webui.beans.layout.OADefaultDou
umn               bleColumnBean
hideShowHeader oracle.apps.fnd.framework.webui.beans.layout.OAHideShowHe
                  aderBean

The OADefaultSingleColumnBean and OADefaultDoubleColumnBean classes have
been deprecated. In their place, you should use a combination of an OAHeaderBean followed
by an
oracle.apps.fnd.framework.webui.beans.layout.OAMessageComponentLayoutB
ean. See Page Layout (How to Place Content) for additional information.

Runtime Control

Warning: You should create web beans programmatically only if you cannot create them
declaratively. Programmatically created web beans cannot be personalized, reused, or
extended easily.

See the OA Framework Controller Coding Standards for additional information about this and
other guidelines that you should consider when writing web bean manipulation code.

Instantiate

You can instantiate any of the classes described above by calling the appropriate
createWebBean() method in the
oracle.apps.fnd.framework.webui.OAControllerImpl class. If you select a signature
that requires a constant to determine what kind of bean to create, use the following for each
class:

Figure 4: OAWebBeanConstants for creating corresponding OA Framework classes


Constant                                                                       OA Framework Class
OAWebBeanConstants.HEADER_BEAN                                                 OAHeaderBean
OAWebBeanConstants.DEFAULT_SINGLE_COLUMN_BEA                                   OADefaultSingleColumnBea
N                                                                              n
OAWebBeanConstants.DEFAULT_DOUBLE_COLUMN_BEA OADefaultDoubleColumnBea

                                                                                                    515
Oracle Application Framework Developer's Guide


N                                                              n
OAWebBeanConstants.HIDE_SHOW_HEADER_BEAN                       OAHideShowHeaderBean

Note: You should not instantiate and programmatically add contents to any of the "default"
regions. You may, however, instantiate regions that you define declaratively in JDeveloper.

Control Visual Properties

To change the header's text value, get a handle to the right class (based on what you
instantiated, or specified declaratively) and call setText(OAPageContext pageContext,
String text).

To achieve the correct text size as specified in the UI Guidelines when headers are used in side
navigation components, or displayed in the "Home" page main content area (in an "At a Glance"
region, for example), call setSize(int size) on the header bean with one of the following
values.

    •    0 - the "large" size
    •    1 - the "medium" size (used for headers displayed in the "Home" content page area).
    •    2 - the "small" size (used for headers added to side navigation components)

See the ToolBox Sample Library for an example of a "Home" page including headers in the
main content area and in a side navigation component.

To set the associated icon in your processRequest method, call setIcon(String icon) as
shown:



header.setIcon(OAWebBeanConstants.APPS_MEDIA_DIRECTORY +
"<icon_name>.gif");

Note: In R12, the header region without a title appears as a long blue line.

Adjacent Subheaders
The UI Guidelines allow multiple subheaders to be used side-by-side in a page a shown in
Figure 4.

Figure 4: Example of adjacent subheaders.




516
Oracle Application Framework Developer's Guide, Release 12.1.3




Declarative Implementation

You create the headers themselves as described in the Subheaders section above. Creating the
layout to hold you adjacent subheaders is a different matter. For help with creating complex
layouts declaratively, see Page Layout (How to Place Content).

Runtime Control

For any programmatic changes to the headers, also see the Subheaders section.

Headers in Side Navigation
You can also add headers to side navigation controls as shown in Figure 5.

Figure 5: example of headers in side navigation




Declarative Implementation



                                                                                                  517
Oracle Application Framework Developer's Guide


Currently, you can't add a Side Navigation (including a header) to your page declaratively. See
the Tabs / Navigation document for instructions on creating a Side Navigation component. Once
you've created your Side Navigation, you simply add your header to it as you would to any other
component.

Runtime Control

Control Visual Properties

When you add a header to a container, the OA Framework automatically sets the text and line
colors based on the corresponding background color. You do not need to set any color
properties.

The only change that you're likely to make to a header when you add it to a side navigation is to
change the size of the header text since this is not configured automatically.

Note: You cannot configure header text size by setting a CSS style; this is not supported. See
the instructions for changing the header size in the Subheaders section above.

Hide/Show Subheaders
   •   See the Hide/Show documentation for a description of this feature and implementation
       instructions

Known Issues
   •   None

Related Information
   •   BLAF UI Guidelines:
          o Headers and Subheaders [ OTN Version ]
          o Locator Element (Breadcrumbs) [ OTN Version ]
   •   Developer's Guide:
          o Hide/Show
          o Content Containers
          o Page Layout (How to Place Content)
   •   Javadoc
          o oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBe
             an
          o oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean
          o oracle.apps.fnd.framework.webui.beans.layout.OAHideShowHead
             erBean
          o oracle.apps.fnd.framework.webui.beans.layout.OADefaultSingl
             eColumnBean
          o oracle.apps.fnd.framework.webui.beans.layout.OADefaultDoubl
             eColumnBean


518
Oracle Application Framework Developer's Guide, Release 12.1.3


      o   oracle.apps.fnd.framework.webui.beans.layout.OAMessageCompo
          nentLayoutBean
•   ToolBox Tutorial / Sample Library




                                                                               519
Oracle Application Framework Developer's Guide



HGrid
Overview
A HGrid, otherwise known as a hierarchy grid, allows users to browse through complex sets of
hierarchical data. Certain types of data, such as the organizational structure of employees within
a company, are naturally hierarchical and best displayed as a tree structure. There are two UI
components that display hierarchical information on a page: the HGrid web bean and the Tree
web bean. A Tree is generally used when you want to put emphasis on the hierarchy and the
relationship between different sets of objects in a hierarchy. A HGrid is more appropriate when
you want to display the hierarchy, but also give more detailed information at each node of the
hierarchy.

Consider using a HGrid instead of a Tree when you want your users to either:

   •   Manipulate the objects in the hierarchy (add, delete, move, reorder, etc.). Note that in
       certain cases, you may want your users to navigate from a Tree to a HGrid to perform
       these actions. This is done by providing a button that switches to an "update" or "edit"
       mode, which displays a HGrid instead of a Tree.
   •   See more object details than can be displayed in a Tree, plus the amount of required
       detail per object does not warrant use of a Tree with a Master/Detail view.

Following is an example of a HGrid.




520
Oracle Application Framework Developer's Guide, Release 12.1.3




A HGrid consists of the following components/features, as pointed out in the figure above:

   1. Breadcrumbs
   2. Focus icon
   3. Expand node arrow
   4. Collapse node arrow
   5. Focus column
   6. Object hierarchy column
   7. Multiple selection
   8. Control bar
   9. Selection/Expansion control
   10. Root node
   11. Record navigator

Each row in a HGrid corresponds to a tree node. A HGrid also has two special columns: a focus
column and an object hierarchy column. The object hierarchy column identifies the current tree

                                                                                             521
Oracle Application Framework Developer's Guide


node and allows you to expand or collapse this node. When you expand on a node that contains
more records than the defined record set size, "Next" and "Previous" record navigation links
appear. If the total number of records is known, the record navigation links also display the
record set range and the total number of records.

The focus column allows you to select a new root for the tree. You can zoom into a sub-tree of a
massive tree by selecting the focus icon for that sub-tree row. The HGrid also renders bread
crumbs, allowing you to focus out (or zoom out) of the current sub-tree, and renders links to
allow you to quickly expand or collapse all the nodes under the current focus root.

This document describes the declarative definition and APIs provided by the HGrid
(oracle.apps.fnd.framework.webui.beans.table.OAHGridBean) component within
OA Framework. As described in the Oracle Browser Look-and-Feel (BLAF) UI Guideline: HGrid
[OTN version] specification, the HGrid feature shares many properties with tables, most notably
that it is a display of information in tabular format. The main difference between the two is that a
table displays a flat list of objects, whereas a HGrid displays objects in a hierarchy. You should
be familiar with the construction of a table (setting up the metadata as well as the business
components). If you are not familiar with tables, please take a quick look at the Tables
documentation before proceeding.

Contents

   •   Defining Business Components
   •   Declarative Implementation
          o Defining a HGrid
          o Enabling Search on a HGrid
   •   Runtime Control
          o processRequest method
          o processFormRequest method
          o Getting and Setting the Initial Focus Path
          o Deleting Rows in a HGrid
          o Using FireAction on the Hierarchy Column
          o Using Save Model on the Hierarchy Column
          o Per Row Dynamic Poplist
          o Getting a Hold of the viewInHierarchy Named Child's Link Web Bean
          o Preserving HGrid State
                   HGrid Data Proxy in UIX
                   Proxy Use in the OA Framework
                   Support for Dynamic HGrids
          o Optimizing Child Row Retrieval
   •   Personalization Considerations
   •   Known Issues
   •   Related Information

Defining Business Components
As with all other beans supported by OA Framework, the data for the HGrid component is
derived from BC4J objects. Just as the HGrid displays data in hierarchical format, the structure
of the source data is also hierarchical, based on multiple view objects connected via view links.

522
Oracle Application Framework Developer's Guide, Release 12.1.3


Each instance of a view object is connected to the HGrid at a particular level, allowing the HGrid
to display all the rows in range at that level. The view links that define the parent-child
relationship between a row in the master view object and the detail view object allow you to drill
down in the HGrid and show details at the next level. When a user selects the hide/show
(expand/collapse node arrow) to show more details, OA Framework traverses the view link and
fetches/displays all the detail records for the master row that is selected.

Note: It is possible to use a different view object for the children rows as long as the parent
view object and the child view object share the same attribute names. The reason for this
becomes clear when setting up OA Extension metadata. An unlimited number of view links
can be used to define the necessary parent-child relationships at each level of the
hierarchy.

When defining a HGrid in OA Extension, specify the name of the view link instance for each
node that is used to drill down to the correct detail view object instance. To ensure that the
HGrid performs well, the view objects and view links defined must be efficient. In general, the
view links get fired at each level to determine whether or not there are children. As a result,
multiple queries are performed if there are multiple nodes displayed at a level, therefore, record
navigation is recommended for better performance.

Note: If your data model supports it, designate an alternate master view object attribute as
the one to use to determine whether there are children. This avoids the need to fire multiple
view link queries.

Each row in a view object provides data for a corresponding row in the HGrid at each level. An
initial instance (top most) of the view object should return the root node of the HGrid. This top
level view object should return exactly one row. The HGrid component relies heavily on the
notion of hierarchical data with a unique root. If the top level view object returns multiple rows of
data, those rows are automatically made children of a dummy root node. The automatically
generated parent dummy node renders as non-selectable and expanded.

Note: You cannot get a handle to this dummy node as it is generated internally and does
not map to any row or view object attached to the HGrid.

The first step in defining a HGrid is to define the business object hierarchy that maps to your
business requirements.

To illustrate the above, build a simple HGrid example to display supervisor-employee hierarchy
information.

Note: Some of the data model is greatly simplified for this example.) The data for each
employee comes from the PER_ALL_PEOPLE_F view. Each employee is uniquely identified
by the PERSON_ID column in this view. The PER_ALL_ASSIGNMENTS_F view describes the
supervisor-employee relationship through the SUPERVISOR_ID and PERSON_ID columns in
this view.

Step 1: Set up a view object definition for the PER_ALL_PEOPLE_F view, selecting the data that
you want to display in the HGrid. Download


                                                                                                  523
Oracle Application Framework Developer's Guide


oracle.apps.fnd.framework.persontree.server.PerAllPeopleFVO as an example.
You can also download the corresponding VOImpl class.

Note: The initQuery method in the VOImpl adds an additional where clause to the view
object to fetch the root node.

Step 2: Define the view link used to retrieve subsequent levels of the HGrid. In this example,
define a view link that links the PerAllPeopleFVO to itself.

   a. In JDeveloper, select the package where you want to add the view link. From the context
      menu, choose Create View Link ... to display the "View Link Wizard".
   b. In the View Link Wizard, Step 1 of 6: Name, enter a name for the view link. (In this
      example use PerAllPeopleFVL).
   c. In Step 2 of 6: View Objects, choose the source and destination view objects. (In this
      example use PerAllPeopleFVO as both the source and destination).
   d. In Step 3 of 6: Source Attributes, select the source attributes. These are typically the
      primary key attributes (or a subset thereof) of the source view object. Select any other
      columns that are needed to build the where clause used to fetch the detail row set. The
      values of these attributes from the master view object are used to determine the detail
      row set. (In this example, use the PERSON_ID column as discussed earlier).
   e. In Step 4 of 6: Destination Attributes, select the destination attributes (as in the
      previous step).
   f. In Step 5 of 6: View Link SQL, build the where condition used to get the detail row set.
      The default where clause simply contains a one-to-one mapping of the source and
      destination attributes. The bind variables are bound with values of the source attributes
      in the master row. (In this example, use the PER_ALL_ASSIGNMENTS_F view to
      determine all the persons supervised by the person in the master row). In other words,
      construct a where clause as follows:

       person_id in (select person_id from per_all_assignments_f where
       supervisor_id = :1)

   g. In Step 6 of 6: View Link Properties, ensure that the Generate Accessor in View Object
      checkbox is checked for both the Source and Destination view objects. The accessor
      name is generated automatically but you can change it if desired.
   h. Download the complete definition for PerAllPeopleFVL. Setup additional view links if
      the master-detail relationships at each level of the HGrid are different.

Step 3: Add the view objects and view links that you created to the application module used for
the page.

Warning: Using the Application Module Wizard to add the view link to the application
module can be difficult. First add the view objects to the application module. Then to add a
view link, select the view link in the left column and select the source view object in the right
column. This enables the ">" shuttle control, which you can use to move the view link over
to the right.

HGrid Navigation

524
Oracle Application Framework Developer's Guide, Release 12.1.3


To implement a HGrid for the purpose of navigating to additional detail information about the
selected node in subtabs below the HGrid, consider the following when creating your BC4J
components:

   •   If the detail information consists of other attributes of a UI row selected in the HGrid,
       then the BC4J row used by the HGrid should ideally be used by the detail section.
       However, this row exists in a non-default RowSet of an internal view object. Currently
       our UI components (outside of HGrid and Table-in-Table) can only be bound to the
       default RowSet of a view object. Therefore, in this situation, you must use a separate
       view object for the detail section to query for the detail information. While this extra query
       is not ideal, on the positive side:
            o The rows used by the HGrid UI will have fewer attributes to query .
            o The detail section may require joins to other tables to get information and that
                complexity can be kept out of the view objects used for the HGrid itself.
   •   As long as the application module is kept around, all the data for the HGrid will be kept
       as well. However, if a separate view object is used for the detail section as described
       above, the detail view object will get refreshed constantly. (This would preclude the
       possibility of updates in the detail section.) If updates are required, you must create
       distinct view objects for the detail section corresponding to each row in the HGrid,
       resulting in more data being held around. This also means you will have to manage view
       instances for the detail and change the view usage on the detail UI components each
       time.

Declarative Implementation

Defining a HGrid

Having defined the data sources for the HGrid bean, the next step is to define the HGrid
component in OA Extension. Refer to the OA Component Reference for additional information
about the properties you can set on the hGrid region.

In OA Framework, in addition to containing all the region items that a Table region can contain,
a HGrid style region also contains a nested region item of style HGrid Hierarchy. The HGrid
Hierarchy region item simply points to a nested region of style Tree Level. A Tree Level region
corresponds to a node in a HGridBean. A Tree Level region contains two region items: a Tree
Definition and a Tree Child. The Tree Definition region item describes the node and the Tree
Child region item points to a nested region of style Tree Level. This allows OA Framework to
build complex hierarchies in a declarative way.

The definition of a HGrid is similar to that of a table. Specify the following metadata in OA
Extension:

Step 1: Define a top level region and set the Region Style property to hGrid. A HGrid region
may also have an optional controller and application module. You can nest this region within a
container region such as PageLayout, Header, Stack Layout, or messageComponentLayout.

Note: OA Extension assumes that for all regions, the Add Indexed Children property is
set to True. As a result, the Add Indexed Children property generally does not appear
in the Property Inspector. However, for backwards compatibility, the Add Indexed

                                                                                                 525
Oracle Application Framework Developer's Guide


Children property will appear for a region if you previously set this property to False using
an earlier version of OA Extension.

Step 2: Select the hGrid region in the Structure pane. In the Property Inspector, set the Record
Set Size property to control the maximum number of records that can be displayed at a time
under each tree node. The syntax used to display the record navigation links is:

{ParentName[/ObjectType];} {Next | Previous} [SetRange] [of
TotalRecords]

For example:

Car Division/Brands: Next 11-20 of 26

Note When you set the Record Set Size property on the hGrid region, the value applies
to all tree nodes in the HGrid. To achieve finer control, where each tree node has a different
maximum record set size, you can set the Record Set Size property on the specific
nodeDefinition.

Step 3: OAHGridBean supports both single and multiple selection of rows. Refer to the
instructions for rendering table selection and selection buttons on the control bar for additional
information.

Note HGrid currently does not yet support the Advanced Table selection and control bar
implementation.

Step 4: In the OA Extension Structure pane, select the hGrid region and display the context
menu. In the context menu, under New, select tree, to create a HGrid hierarchy column (which
distinguishes a HGrid from a table). In the figure below of the HGrid structure, the tree region is
labeled as HGridHierarchyRN.

This nested tree region defines a particular level in the hierarchy of the HGrid. The tree region
can have two types of named children (members):

   •   nodeDefinition - The nodeDefinition item automatically appears when you create the
       tree region. It defines the appearance of the node in the hierarchy. For the
       nodeDefinition item, specify:
           o a value for the View Instance property to associate the node with a view
               instance.
           o a value for the View Attribute property, to render the view attribute name as
               the text of the node in the object hierarchy column.
           o a value for the Icon URI property to render an image next to the text in the
               node in the object hierarchy column.
           o a value for the Destination URI property to render the node as a hyperlink in
               the object hierarchy column.
           o a value for the Record Set Size property, if you wish to display a maximum
               record set size for this node that is different from the value of the Record Set
               Size property set on the hGrid region.


526
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   childNode - In the Structure pane, select members under the Tree region and display
       the context menu. Under New, select childNode.The childNode item defines the parent-
       child relationship between tree levels.
           o Set the Ancestor Node property on this item to indicate the region where you
               are looping back. The Ancestor Node property can be set to another tree
               region, to the same tree region (for a recursive relationship), or to no tree region
               (null, indicating that the node is a leaf level in the hierarchy tree). The ancestor
               node should be set as a fully-qualified path name such as
               /oracle/apps/<applshortname>/<module>/<pagename>.<childNode
               ID > where the ancestor childNode ID is whatever childNode (node) you are
               looping back to.

               Attention: For a recursive relationship, as indicated above, you set the ancestor
               node to the same tree region. However, the "same tree region" refers to the parent
               of the base recursing node and not the recursing node itself.

           o   Set the View Link Accessor property to the view link accessor name that
               should be used to retrieve the child nodes at this level.

               Note: Previously, the view link instance used to retrieve the child nodes at a
               particular level was set via the child node's View Link Instance property. This
               property is now deprecated and is present only for backwards compatibility. You
               should only use the View Link Accessor property on the child node to specify the
               view link instance.

               Note: A childNode item can also have other nested members.

Attention: If you intend to support the Export feature on a HGrid, then different
viewAttributeNames cannot be used at different levels in the hierarchy column. All levels of
the hierarchy column (that is, all nodeDefs) should have the same viewAttributeName. This
is analogous to the definition of all other columns of a HGrid. This restriction does not apply
if the Export feature is not being used.




                                                                                                  527
Oracle Application Framework Developer's Guide




Remember that each tree region can contain two members, as called out in the figure above:

   1. nodeDefinition - holds the definition for this level, such as icon name, URL, etc.
   2. childNode - holds the definition of the view link, pointing to the detail view object.

Step 5: You can define other columns in the HGrid by adding corresponding region items to the
HGrid region. The HGrid bean supports all the column types that the table bean supports,
including form fields like text inputs and poplists.

Note: HGrid does not yet support the Advanced Table column and column group
containers.

Step 6: Set the View Instance and View Attribute properties on each of the region items
representing your columns.

Step 7: To define table actions, select your hGrid region in the Structure pane of OA Extension.
Display the context menu and under New, choose the tableActions. This automatically creates
a tableActions named child consisting of a flowLayout region.

Step 8: Specify a standards-compliant ID for the region and leave the Region Style as
flowLayout or set it to rowLayout.

Suggestion: If you have only buttons to add to the table actions area, then you can use
either layout styles, flowLayout being preferable. However, if you are adding message web
beans such as messageChoice or messageTextInput along with buttons to the table action
area, then you should use the rowLayout style. Using a flowLayout instead of a rowLayout
in this case may cause alignment problems.




528
Oracle Application Framework Developer's Guide, Release 12.1.3


Step 9: Under the Layout region, layout the children you want to render as table actions, such
submitButton or messageChoice. Select the Layout region, and choose New > Item from the
context menu. Select the new Item that is created and set the item style as appropriate.

Enabling Search on a HGrid

You can enable the ability to search on an HGrid. According to the Oracle Browser Look-and-
Feel (BLAF) UI Guideline: HGrid Flows [OTN version] specifications, the HGrid search results
are displayed in a flat table list. The results table contains a special icon called "View in
Hierarchy" in each result row that takes the user to the original HGrid with the focus on the
result item.

However, the rendering of the Query region varies, depending on the setting of certain Query
region properties and the (user personalized) views, if any, defined by the user:

   •   If you set the Initial Panel property of your Query region to simple or advanced,
       an empty flat table displays when the page first renders.
   •   If you set the Initial Panel property of your Query region to customized and the
       user does not have any default view specified, a HGrid displays when the page first
       renders. However, in this case, once the user selects a view, the following displays,
       based on the view selected:
            o HGrid - if the selected view does not have any search criteria associated with it.
            o Table - if the selected view does have search criteria associated with it.
   •   If you set the Initial Panel property of your Query region to customized and the
       user has no views defined, the Simple/Advanced Search panels display as expected.
       However, if you construct your Query region in resultsBasedSearch mode, and also
       specify only the Views panel to display based on the following property settings:
            o Include Simple Panel = false
            o Include Advanced Panel = false
            o Include Views Panel = true

       OA Framework displays the Views panel with an empty Views poplist and HGrid if the
       user has no views defined.

Step 1: Follow the instructions to set up a search region as described in the Search document.

Step 2: Select your hGrid region in the Structure pane. In the Property Inspector, set the
following properties on the hGrid region:

   •   Search View Usage - specify the view usage to use for the search results. The view
       usage must have the same attributes as the other view objects that are associated with
       the nodes of the HGrid.
   •   Search Controller Class - specify a controller class associated with the search
       results table. OA Framework automatically converts the metadata for the hGrid region to
       the metadata for the results table by removing the hierarchy column from the hGrid
       region and rendering the rest of the columns as a flat list. The search controller class
       allows you to provide additional control over the results table. This controller class can
       contain processRequest, processFormData, and processFormRequest methods


                                                                                              529
Oracle Application Framework Developer's Guide


       that are invoked during the rendering of the results table as well as for POST requests to
       the server.

Step 3: Select the hGrid region and from the context menu, choose New > viewInHierarchy to
add a viewInHierarchy named child to the hGrid. The named child creates a link item by default.
On the link item, specify a value for the Destination URI property. The Destination URI
indicates the URI to navigate to when a user selects a result item link from the search results
table that directs the user back to the hGrid with the focus on the result item. Use a form
submission on this link by setting up a fire action.

Manage this POST request in the Search Controller Class by clearing the state of the hGrid
using OAHGridBean.clearCache and forwarding back to the same page to redisplay the
hGrid region with the focus on the appropriate result. Refer to the Runtime Control section for
information on methods that get/set the initial focus path.

According to BLAF guidelines, the View in Hierarchy column typically displays an image icon.
You can add the image as a child of the link (just as with a normal link web bean).

Although you should always create the View in Hierarchy column declaratively, you can also get
programmatic control of the link web bean as described in the Runtime Control section.

Note: The old mechanism for specifying a URI for the View in Hierarchy link has been
deprecated, as described in the OA Framework Coding Standards. Previously, you had to
specify the URI in the View in Hierarchy URI property of the hGrid region. The new
viewInHierarchy named child of the hGrid region takes precedence over this now
deprecated property.

Runtime Control
The last step in defining a HGrid is to setup a controller. Refer to the sample controller class
PersonTreePageCO to continue with the person tree example discussed in the Defining
Business Components section.

processRequest method

As is the case with other components in OA Framework, use the processRequest method for
any custom layout code. Initialize the view object for the root node in this method.

Note: You must execute the query on the root view object. In the earlier original
implementation of the HGrid, the HGrid used to automatically execute the query for the root
view object. To ensure backward compatibility, this behavior is still present in an earlier
release of OA Framework, however, consider this behavior deprecated.

processFormRequest method

Use the processFormRequest method to process form events from the page containing the
HGrid. From a HGrid, access data only via the business components. See the
PersonTreePageCO for code that walks the business component tree. Refer to the

530
Oracle Application Framework Developer's Guide, Release 12.1.3


oracle.apps.fnd.framework.webui.OAHGridQueriedRowEnumerator Javadoc for
additional information.

Getting and Setting the Initial Focus Path

The following methods on OAHGridBean are available to get and set the initial focus path for a
HGrid:

   •   getInitialFocusPath
   •   setInitialFocusPath

The setInitialFocusPath API is used to set the initial focus on a particular node of the
HGrid. This API applies to both static and dynamic HGrids:

setInitialFocusPath(int[] focusRootPath)

This signature is used for static HGrids. For example, HGrids on which
setFetchOnDemand(true) has not been called. The focusRootPath parameter describes
the path from the root of the HGrid to the subnode that must be the initial focus root. Each
element in this array indicates the child index of the next node on the path.

To focus in on the 2nd child of the 5th child of the root use:

int[] focusRootPath = {4, 1};

This follows the child at index 4 (which is the 5th child), and then follows that node's child at
index 1 (which is its 2nd child).

setInitialFocusPath(String[] focusRootPath)

This signature is used for dynamic HGrids. For example, HGrids on which
setFetchOnDemand(true) has been called. The focusRootPath parameter describes the
path from the root of the HGrid to the subnode that must be the initial focus root. Each element
in this array indicates the ID of the next node on the path.

Warning: The setInitialFocusPath only sets the initial focus on the HGrid. For
example, when the HGrid is in a pure form with no previously saved state. Future visits to
the same HGrid will not use the initial focus path. If a HGrid's UI needs to be set back to its
initial pure form, then you must call OAHGridBean.clearClientCache. This applies to
both static as well as dynamic HGrids.

Deleting Rows in a HGrid

Although you generally use the processFormRequest method to process events on the
HGrid, in the case where a user wants to delete rows from a HGrid, you must redirect back to
the processRequest method.



                                                                                                    531
Oracle Application Framework Developer's Guide


The reason is because of passivation and the fact that OA Framework stores an internal cache
to hold on to rows. In general, if you delete a row and then call the OAHGridBean clearCache
method, it results in a DeadViewRowAccessException because the cache is still holding a
reference to the deleted row. To avoid this problem, you must always clear the cache first, then
delete the row.

Suppose you want to delete some row(s) in a HGrid, where multiple selection is enabled and
the Delete button deletes all selected rows. To identify the rows to delete, you need to use
OAHgridQueriedRowEnumerator to go through the tree of rows. In the processFormRequest
method, redirect to the processRequest method and use the enumerator to get a handle to
the rows selected for deletion, clear the HGrid cache, then delete the rows, as shown in this
example:



public void processRequest(...)

{

    OAHGridQueriedRowEnumerator enum =

        new OAHGridQueriedRowEnumerator(pageContext, hGridBean);

    Vector listOfRowsToDelete = new Vector(5);

    while (enum.hasMoreElements())

    {

        Row rowToDelete = (Row) enum.nextElement();

        if (rowToDelete != null)

        {

            if ("Y".equals(rowToDelete.getAttribute("DeleteFlag"))

            {

                // Add list Row to be deleted later

                listOfRowsToDelete.add(rowToDelete);

            }

        }

    }


532
Oracle Application Framework Developer's Guide, Release 12.1.3


    //Now you have a handle to all the rows to delete



    //Call ClearCache to remove internal cache

    hGridBean.clearCache(pageContext);

    //Delete all the rows in the list

    for (int i = 0; i < listOfRowsToDelete.size(); i++)

    {

        Row rowToDelete = (Row) listOfRowstoDelete.elementAt(i);

        //delete the row

        rowToDelete.remove();

    }



}

Note: Previously, if you try to call clearCache from the processFormRequest method, a
developer mode error occurs, due to an incorrect developer mode check. This has been
resolved. You can avoid the error by temporarily turning off developer mode in OA
Extension. (In OA Extension, select Project Settings from the Project menu, then navigate
to Common > Oracle Applications > Run Options. Remove OADeveloperMode from the
Selected Options list.)

Using FireAction on the Hierarchy Column

You can associate a FireAction element with the hierarchy column of a HGrid to perform a form
submit. See Chapter 4: Submitting the Form for more information on submitting a form.

Using Save Model on the Hierarchy Column

To implement a Save Model ("Warn About Changes" dialog with links), on the hierarchy column
of the HGrid, you must code it manually, by including the following code example:



OATreeDefinitionBean webBean = ...

webBean.setAttributeValue(WARN_ABOUT_CHANGES, Boolean.TRUE);

                                                                                          533
Oracle Application Framework Developer's Guide


Table Row Dynamic Poplist

OA Framework provides programmatic support for the implementation of a choice list (poplist or
pulldown) in an updatable multi-row table, such that its poplist values can vary on a row-by-row
basis.

Refer to Dynamic Poplists in Standard Web Widgets for programmatic instructions.

Getting a Hold of the viewInHierarchy Named Child's Link Web Bean

Although you should only use declarative steps to enable search on an HGrid, if you must get
hold of the link web bean that is in the viewInHierarchy named child of the hGrid region
programmatically, use the findChildRecursive method:



OAHGridBean hGridBean = ...

OALinkBean vihLinkBean = hGridBean.findChildRecursive("vihlink");

// "vihlink" is the ID of the viewInHierarchy link

Preserving HGrid State

When a user performs a transaction on your page, you need to ensure that your page preserves
its HGrid state. How you support state management for an HGrid depends on the following:

   •   Case 1: If a HGrid cannot have its hierarchy structure change, but its node properties
       can be altered, it is considered a non-dynamic HGrid. You do not have to do anything
       extra to support state management for a non-dynamic HGrid.
   •   Case 2: If a HGrid is read-only, it is also a non-dynamic HGrid and you do not have to do
       anything extra to support state management in this case.
   •   Case 3: If a HGrid's hierarchy structure changes as a result of nodes being added,
       moved around or deleted, it is considered a dynamic HGrid. To support state
       management for a dynamic HGrid:

       Step 1: Add the following line of code to your controllers' processRequest method:




       hGridBean.setFetchOnDemand(true);

       hGridBean.setUsePkValuesNodeId(true);

       Step 2: Remove all calls to clearClientCache or clearCache.

       Step 3: Change all initialFocusPath(int[]) calls to
       initialFocusPath(String[]).

534
Oracle Application Framework Developer's Guide, Release 12.1.3


The following sections describe in detail how OA Framework supports state management of
dynamic HGrids.

HGrid Data Proxy in UIX

Before addressing the details of state management in HGrids, it is necessary to understand
what a HGrid proxy object is and how it works in UIX.

In UIX, the state of the HGrid (such as nodes expanded or collapsed, nodes focused into,
record navigation, and so on) and all interaction with the data sources is maintained by an
object known as the HGrid data proxy. This object needs to be specified on the proxy attribute
of the UIX oracle.cabo.ui.beans.table.HGridBean. The proxy is actually a fairly
complex Java interface (oracle.cabo.ui.data.tree.HGridDataProxy) and the UIX
team has provided an initial implementation of this interface called
oracle.cabo.ui.data.tree.ClientStateHGridDataProxy. This particular proxy is a
black box to application developers. Application developers are only allowed to create the proxy
object and initialize it with the event, state, root and node request parameters as submitted by
the client (the browser). Application developers can save the parameters in an appropriate
store, such as a session, and use these values to reinitialize the proxy when the HGrid is
rerendered. For example, when revisiting a previously rendered HGrid. However, application
developers are not allowed to peek into the values of these parameters. The values are internal
to the implementation of the ClientStateHGridDataProxy.

Proxy Use in the OA Framework

OA Framework manages the ClientStateHGridDataProxy transparently for all Oracle E-
Business Suite developers. Since most Oracle E-Business Suite require the state of the HGrid
to be persisted across visits to the same HGrid, OA Framework caches the event, state, root
and node request parameters on the servlet session. These values are then used to reinitialize
the HGrid when it is revisited.

While this satisfies requirements for state persistence, the UIX
ClientStateHGridDataProxy has a significant drawback in that it uses index based
tracking for the state. For example, the state might read "expand the 5th child of the 1st child of
the root node". If the structure of the HGrid changes through addition or deletion of nodes, any
saved state may no longer apply correctly to the HGrid. The most common side effect of this is
an IndexOutOfBoundsException from the UIX renderers. The other problem is that the
state might be applied to the wrong node due to the rearrangement of nodes.

To circumvent these problems, OA Framework provides the clearClientCache API on
OAHGridBean which clears any saved state. This allows changes to the HGrid hierarchy but
loses any previous state completely, resulting in the HGrid being redrawn fully collapsed.

Support for Dynamic HGrids

The included UIX release provides a new proxy known as
oracle.cabo.ui.data.tree.DynamicHGridDataProxy. This proxy was initially designed
to support unbounded record navigation in HGrids, such as record navigation, without fetching
all rows to the middle-tier. This feature is exposed in OA Framework via the

                                                                                                535
Oracle Application Framework Developer's Guide


setFetchOnDemand API on OAHGridBean. The interesting feature of this proxy is that it uses
name-based state tracking instead of indices. As a result, it solves the major problems of the
ClientStateHGridDataProxy. The IndexOutOfBoundsExceptions are no longer
possible (because there are no indexes) and since the state tracking is by name, there is no
possibility of the state being applied to the wrong node.

Optimizing Child Row Retrieval

When any given level of a HGrid is rendered, the rendering engine must first determine whether
the node is expandable so that it can render the Expand icon if necessary. To do this, the
rendering engine checks whether the node has children by using the HGrid's BC4J view links.
This translates to firing the detail view object query just to check for the presence of children,
which for large HGrids, can be a serious performance drain.

Using treeChildPresentVOAttr

Since data models in Oracle E-Business Suite often have a master row level attribute that keeps
track of the presence or absence of children, you can optimize performance in this case. You
can instruct the HGrid to use this attribute instead of firing a detail view object query to
determine whether the expansion icon needs to be rendered. In order to do this, set the
treeChildPresentVOAttr attribute on the <oa:childNode> in the metadata.
Unfortunately, since this attribute is currently not supported in metadata, you must set this
attribute programatically on the
oracle.apps.fnd.framework.webui.beans.nav.OATreeChildBean, which is the
runtime web bean corresponding to <oa:childNode>. For example:



OATreeChildBean.setChildPresentVOAttr(String childPresentVOAttr)

The String parameter in this case is the name of a master view object row attribute that returns
"Y" or "N" to indicate whether there are any children.

Important: All Applications should use this feature to avoid unnecessary queries against
the database.

Using treeLevelChildCountAttr

Some Oracle E-Business Suite data models also maintain information about the number of
children of a master row, at the master row itself. If you have such an attribute available, you
may use it instead of treeChildPresentVOAttr. The treeLevelChildCountAttr has
two advantages:

   •   You can use this attribute to determine whether a node has children and hence, whether
       an expansion icon needs to be rendered for a node.
   •   For a HGrid that uses record navigation, when a node is expanded, you can use this
       attribute to properly adjust the record navigation links ("Previous" and "Next") without
       triggering the fetch of all rows being displayed.


536
Oracle Application Framework Developer's Guide, Release 12.1.3


In order to do use this attribute, set the treeLevelChildCountAttr attribute on the
<oa:nodeDef> in the metadata. Unfortunately, since this attribute is currently not supported in
metadata, you must set this attribute programatically on the OATreeDefinitionBean, which
is the runtime web bean corresponding to <oa:nodeDef>. For example:



OATreeDefinitionBean.setChildCountVOAttr(String childCountVOAttr)

The String parameter in this case is the name of a master view object row attribute that returns
an oracle.jbo.domain.Number indicating the number of children. Note that this number
must match the number of rows actually returned by the detail view object query.

Personalization Considerations
   •   See a summary of HGrid personalization considerations in the Oracle Application
       Framework Personalization Guide. Also see a summary of Standard Web Widgets
       personalization considerations if you plan to implement a dynamic poplist in a HGrid.

Known Issues
   •   See a summary of key HGRID issues with suggested workarounds if available

Related Information
   •   BLAF UI Guideline(s)
          o HGrid [OTN version]
          o HGrid Flows [OTN version]
   •   Javadoc File(s)
          o oracle.cabo.ui.beans.table.HGridBean
          o oracle.apps.fnd.framework.webui.beans.table.OAHGridBean
          o oracle.apps.fnd.framework.webui.beans.nav.OAHGridHierarchyB
             ean
          o oracle.apps.fnd.framework.webui.OAHGridQueriedRowEnumerator
          o oracle.cabo.ui.action.FireAction
          o oracle.cabo.ui.collection.Parameter
          o oracle.apps.fnd.framework.webui.beans.nav.OATreeDefinitionB
             ean
          o oracle.apps.fnd.framework.webui.beans.nav.OATreeChildBean
          o oracle.cabo.ui.data.tree.HGridDataProxy
          o oracle.cabo.ui.data.tree.ClientStateHGridDataProxy
          o oracle.cabo.ui.data.tree.DynamicHGridDataProxy
   •   Lesson(s)
   •   Frequently Asked Questions
          o HGrid FAQ's
   •   Sample Code
          o PerAllPeopleFVOImpl
          o PersonTreePageCO

                                                                                               537
Oracle Application Framework Developer's Guide


          o   PerAllPeopleFVL
          o   PerAllPeopleFVO




538
Oracle Application Framework Developer's Guide, Release 12.1.3



Hide/Show
Overview
As described in the BLAF UI Guideline: Hide/Show [ OTN Version ] specification, the Hide/Show
feature lets the user control whether parts of a page are hidden or displayed by selecting a
special link (or icon) that toggles between content "disclosed" and "hidden" states.

Figure 1: Example of a Hide/Show control in the hidden (undisclosed) state.




Figure 2: Example of a Hide/Show control in the disclosed state.




Hide/Show can be incorporated into a page design in the following ways. Each implementation
is described below.

    •    Hide/Show in Page Content
    •    Hide/Show in a Table Row
    •    Hide/Show in a Table Cell
    •    Hide/Show in Side Navigation
    •    Hide/Show Headers

For efficiency, this feature uses Partial Page Rendering (PPR) to redraw only the part of the
page that is affected by the Hide/Show component's selection. If PPR is not available (the user
is running an unsupported browser or the developer disables the feature), the full page is
redrawn for each Hide/Show event.

Hide/Show in Page Content
In this context the Hide/Show control determines whether part of a simple region's contents are
hidden or shown. Per the BLAF UI Guidelines, this is typically used in the context of a Search
region or within a subheader to control some of its contents.

Tip: If you want to control all the contents beneath a subheader, the Hide/Show Header might
be a better choice.

Figure 3: example of a Hide/Show control in a "Search" region




                                                                                                  539
Oracle Application Framework Developer's Guide




The OA Framework supports multiple Hide/Show components on a single page. You may even
nest them as permitted by the UI Guidelines.

Declarative Implementation

Step 1: to add a Hide/Show component to your page, create region and set its style to
hideShow. At runtime, the OA Framework will instantiate an
oracle.apps.fnd.framework.webui.beans.layout.OADefaultHideShowBean.

Note: To ensure that the Hide/Show component is not indented when displayed, add it to a
region that does not automatically indent its content (a stack or a header, for example). If you
add it to a region that automatically indents its components (like a messageLayout region), the
Hide/Show component will not render as specified in the UI Guidelines.

Step 2: Set the following properties for the hideShow region:

   •   Disclosed Text - the text to display when the content is disclosed. Per the UI
       Guidelines, this text should be written in the form of "Hide <content description>". If you
       fail to specify this property, the OA Framework displays "Hide" as the default value.
   •   Undisclosed Text - the text to display when the content is hidden. Per the UI
       Guidelines, this text should be written in the form of "Show <content description>". If you
       fail to specify this property, the OA Framework displays "Show" as the default value.
   •   Initially Disclosed - controls whether the supplemental content is shown when
       the page first renders in the session (note that the OA Framework tracks the state of
       each hide/show component on the servlet session so it will always remember the user's
       last action when the page is rendered). The default value is "False."

Step 3: Add the content that you want to control (regions and/or items) directly to the hideShow
region. These regions and/or items will be added as indexed children of the hide/show
component.

Step 4 (optional): If you want to control the hideShow bean's disclosure state using a view
object attribute, follow these substeps:

   •   Step 4.1: Define an attribute in the view object you want to reference. This attribute must
       be a Boolean type (in the SQL statement that maps to this attribute, use a DECODE to
       return 0 for false and 1 for true), and it must be updateable so the correct state can be
       set when the user toggles the control.

540
Oracle Application Framework Developer's Guide, Release 12.1.3


   •   Step 4.2: Set the View Instance Name property for the hideShow region to point to
       the view object you want to use.
   •   Step 4.3: Set the View Attribute Name property for the attribute you defined in Step
       4.1.
   •   Step 4.4 Add logic to a controller for the hideShow (or higher in the hierarchy) to
       execute the view object's query. If the query has not been executed when the
       component is rendered, the Initially Disclosed state will be used. If the query has
       still not been executed when the user selects the link or icon, the OA Framework will
       throw a developer mode exception if your project has its OADeveloperMode property
       enabled (see Testing for additional information about OADeveloperMode).

Repeating Hide/Show Controls (using Child View Instance)

The Child View Instance property is exposed on container beans for the purpose of
rendering the containers children multiple times (once for each row in the associated view
object). To use this mechanism for displaying a Hide/Show control for each row, follow these
steps:

Step 1: Define a layout region (a stack layout, for example) in your page and add a Hide/Show
control beneath it.

Step 2: Set the Child View Instance property on the layout region to the view object you
want to use to control the rendering.

Step 3: Set the Child View Attribute property on the layout region to the view object's
primary key (note that this does not support composite keys at this time). This step enables the
OA Framework to correctly identify the Hide/Show control it creates for each view object row.

Step 4: Set the View Instance Name property on the Hide/Show control to the same view
object you referenced in Step 2. Also set its View Attribute Name property to a Boolean
attribute that determines whether the content is hidden or shown (in the SQL statement that
maps to this attribute, use a DECODE to return 0 for false and 1 for true, and it must be
updateable so the correct state can be set when the user toggles the control.).

Step 5: Add the components to the Hide/Show control that you want to display when its state is
disclosed. Note that you can add any component you wish, except for a List of Values. Each of
these components must bind to a view attribute in the view object you specified in Steps 2 and
3.

Also see the Auto-Repeating Layout topic for additional information about using the Child
View Instance property.

Hide/Show and the Search "Go" Button

The BLAF UI Guidelines for Hide/Show suggest that the Search "Go" button should change
locations based on whether the supplemental content is hidden or shown. For Oracle E-
Business Suite products, you may simply add the Go button to your Search region after the
Hide/Show component so its location remains the same while the user works in the page. This
exception (which was approved by the BLAF UI team although it is not documented in the

                                                                                               541
Oracle Application Framework Developer's Guide


guidelines) avoids the need to implement a complex workaround in the OA Framework to
support the conditional positioning.

Runtime Control

Warning: You should create web beans programmatically only if you cannot create them
declaratively. Programmatically created web beans cannot be personalized, reused, or
extended easily.

See the OA Framework Controller Coding Standards for additional information about this and
other guidelines that you should consider when writing web bean manipulation code.

Instantiate OADefaultHideShowBean

Generally, there is little reason to instantiate a Hide/Show control yourself. That said, if
absolutely necessary, you should instantiate an OADefaultHideShowBean if you want the OA
Framework to automatically configure the bean to perform a form submit and handle the
hide/show events.

See the oracle.apps.fnd.framework.webui.OAControllerImpl Javadoc for other
createWebBean() signatures.



import oracle.apps.fnd.framework.webui.OAWebBeanConstants;



import
oracle.apps.fnd.framework.webui.beans.layout.OADefaultHideShowBean;

...

 OADefaultHideShowBean hideShow =

   (OADefaultHideShowBean)createWebBean(pageContext,
OAWebBeanConstants.DEFAULT_HIDE_SHOW_BEAN, null, "aName");

Once you instantiate the bean, you need to set it's disclosed and undisclosed text values as
illustrated in the Control Visual Properties section below.

Instantiate OAHideShowBean

You should instantiate an OAHideShowBean only if you can't use the declarative
implementation, and you need to fully configure the bean (for example, you want the icon/link
selection to issue a GET instead of a POST as the "default" bean does), and you want to
implement the event handling yourself (so you will be responsible for manually hiding and
showing the supplemental content).


542
Oracle Application Framework Developer's Guide, Release 12.1.3


See the OAControllerImpl Javadoc for other createWebBean signatures.



import oracle.apps.fnd.framework.webui.OAWebBeanConstants;

import oracle.apps.fnd.framework.webui.beans.layout.OAHideShowBean;



...

 OAHideShowBean hideShow =

   (OAHideShowBean)createWebBean(pageContext,
OAWebBeanConstants.HIDE_SHOW_BEAN, null, "aName");

Control Visual Properties

You can set the disclosed and undisclosed text values at runtime as shown below. You cannot
change the standard hide/show icon.



import
oracle.apps.fnd.framework.webui.beans.layout.OADefaultHideShowBean;

...

processRequest(OAPageContext pageContext, OAWebBean webBean)

{

   // Get a handle to the hideShow bean if this code is in a
controller associated with

    // a parent or grandparent of the bean.

    OADefaultHideShowBean hideShow =

    (OADefaultHideShowBean)findIndexedChildRecursive("<component
ID>");



   // Alternatively, if this code is in a controller associated with
the hide/show



                                                                                         543
Oracle Application Framework Developer's Guide


   // region, simply cast the OAWebBean parameter passed to the
processRequest()

      // method.

      OADefaultHideShowBean hideShow = (OADefaultHideShowBean)webBean;



   // Set the undisclosed Text. Always remember to obtain a translated
text value

      // from Message Dictionary. NEVER set a hard-coded text value.

      hideShow.setUndisclosedText("<Show...>");



   // Set the undisclosed Text. Always remember to obtain a translated
text value

      // from Message Dictionary. NEVER set a hard-coded text value.

      hideShow.setDisclosedText("<Hide...>");



      // Set the default (initial) disclosure state.

      hideShow.setDefaultDisclosed(pageContext, Boolean.TRUE;



}

Control Behavior and Data

The OA Framework automatically configures the OADefaultHideShowBean to perform a form
submit when the user selects the link or icon. If you need to turn off client side Javascript
validation when the form is submitted (you're using the hideShowBean in a data entry page), get
a handle to your Hide/Show component and call the following in your processRequest method:



hideShow.setUnvalidated(true);

If you need to disable Partial Page Rendering for any reason, call the following in your
processRequest method:


544
Oracle Application Framework Developer's Guide, Release 12.1.3




hideShow.setPartialRenderMode(OAWebBeanConstants.PARTIAL_RENDER_MODE_N
ONE);

You can also change the bound value if you're using a view object attribute to determine the
disclosure state.



hideShow.setViewUsageName(<"viewObjectInstanceName">);
hideShow.setViewAttributeName(<"viewObjectAttributeName">;

Handle Hide/Show Events

When using the OADefaultHideShowBean, the OA Framework automatically handles the user
selection events to hide and show supplemental content.

If you need to write code to handle these events yourself for any reason, add the following code
to your controller's processFormRequest method:

Warning: You should not interfere with the OA Framework's handling of these events (in
particular, do not make any changes involving the hide/show state management or the
associated view instance if one is attached to the hide/show bean).



// Get the name of the event currently being raised.

String hideShowEvent =
pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM);



if ((OAWebBeanConstants.SHOW_EVENT.equals(hideShowEvent)) ||

      (OAWebBeanConstants.HIDE_EVENT.equals(hideShowEvent)))

{

...

If you have multiple Hide/Show components on the page, you can also get the name of the
bean that raised the event by getting the value of the source parameter:



// Get the component ID for the bean that raised this event


                                                                                               545
Oracle Application Framework Developer's Guide


String hideShowId =
pageContext.getParameter(OAWebBeanConstants.SOURCE_PARAM);

Note that if you associate a controller with your Hide/Show control (so the webBean parameter
in the processFormRequest method is referencing this component), then the source parameter
value will equal the webBean's component ID.



public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)

{

  String hideShowEvent =
pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM);



    // Get the component ID for the bean that raised this event

  String hideShowId =
pageContext.getParameter(OAWebBeanConstants.SOURCE_PARAM);



    // Get the component ID of the current webBean

    String beanId = webBean.getUINodeName();



    if (beanId.equals(hideShowId))...

Back Button / Refresh Considerations

The OA Framework automatically handles user selection of the browser Back and Refresh
buttons for this component. That said, however, if you're using a view object to manage the
disclosure state, you should consider review Supporting the Browser Back Button before
proceeding.

Personalization Considerations

    •   See a summary of Hide/Show personalization considerations in the Oracle Application
        Framework Personalization Guide.

Hide/Show in a Table Row


546
Oracle Application Framework Developer's Guide, Release 12.1.3


You can also use a Hide/Show bean to control whether additional information is displayed for a
table row.

See the table [ classic | advanced ] documentation for information about this.

Hide/Show in a Table Cell
In this context, control whether supplemental information is shown in a single table cell.

Figure 5: example of a Hide/Show control for a table cell




Declarative Implementation

To implement this as shown in a table column (without prompts for the data), follow the same
steps that are listed in the Hide/Show in Page Content section with the following difference:

    •    You must specify the View Instance and View Attribute names. The View
         Instance should reference the same view object that the table is using, and the View
         Attribute must be a Boolean type (in the SQL statement that maps to this attribute,
         use a DECODE to return 0 for false and 1 for true), and it must be updateable so the
         correct state can be set when the user toggles the control.

If you want the data in the Hide/Show column to include prompts, you must add a tableLayout
to the column first, and then add your hideShow region as described above.

Runtime Control

See the Hide/Show in Page Content section for runtime control instructions.

Personalization Considerations

    •    See a summary of Hide/Show personalization considerations in the Oracle Application
         Framework Personalization Guide.

Hide/Show in Side Navigation
The OA Framework currently does not support Hide/Show in a side navigation as shown in
Figure 6, and this is not planned for Release 12.


                                                                                                  547
Oracle Application Framework Developer's Guide


Figure 6: example of a Hide/Show control in a Side Navigation




Hide/Show Headers
If you want to hide or show all the contents beneath a subheader as shown in Figures 6 and 7,
use the Hide/Show Header bean.

Note: This bean does not have associated disclosed and hidden text properties since only the
Hide/Show icon toggles when the user selects it. The header text remains the same in both
states.

Figure 7: example of a Hide/Show Header in the disclosed state




Figure 8: example of a Hide/Show Header in the hidden (undisclosed) state




Declarative Implementation

To add a Hide/Show Header to your page, create a region and set it's style to
hideShowHeader. At runtime, the OA Framework will instantiate an
OAHideShowHeaderBean.

The only other region property that you must set is the Text to display. You can also change
the default Initially Disclosed value from False to True.

Finally, add contents to the hideShowHeader as you would for any other header region.

Runtime Control



548
Oracle Application Framework Developer's Guide, Release 12.1.3


Warning: You should create web beans programmatically only if you cannot create them
declaratively. Programmatically created web beans cannot be personalized, reused, or easily
extended.

See the OA Framework Controller Coding Standards for additional information about this and
other guidelines that you should consider when writing web bean manipulation code.

Instantiate

See the OAControllerImpl Javadoc for other createWebBean signatures.



Import oracle.apps.fnd.framework.webui.OAWebBeanConstants;

import
oracle.apps.fnd.framework.webui.beans.layout.OAHideShowHeaderBean;

...

 OAHideShowHeaderBean header =

   (OAHideShowHeaderBean)createWebBean(pageContext,
OAWebBeanConstants.HIDE_SHOW_HEADER_BEAN, null, "aName");

Control Visual Properties

The only visual property that you can set for this bean is the header's text as shown:



// Always remember to obtain a translated text value from Message
Dictionary
// NEVER set a hard-coded text value.
header.setText(pageContext, "<some value>");

Control Behavior and Data

As described in the Hide/Show in Page Content section above, you can change the bound value
if you're using a view object attribute to determine the disclosure state. You can also turn off
client-side Javascript validation if needed.

Handle Hide/Show Events

The OA Framework automatically handles hiding and showing the header's content. There is no
reason to write code to handle this yourself.

Back Button / Refresh Considerations


                                                                                            549
Oracle Application Framework Developer's Guide


The OA Framework automatically handles user selection of the browser Back and Refresh
buttons for this component. That said, however, if you're using a view object to manage the
disclosure state, you should review Supporting the Browser Back Button before proceeding.

Personalization Considerations

   •   See a summary of Hide/Show personalization considerations in the Oracle Application
       Framework Personalization Guide.

Known Issues
   •   None

Related Information
   •   BLAF UI Guidelines
          o Hide/Show [ OTN Version ]
   •   OA Framework Developer's Guide
          o Tables [ Classic | Advanced ]
          o Testing OA Framework Applications
          o OA Framework Controller Coding Standards
          o Partial Page Rendering
          o Supporting the Browser Back Button
   •   Javadoc
          o oracle.apps.fnd.framework.webui.beans.layout.OAHideShowBean
          o oracle.apps.fnd.framework.webui.beans.layout.OADefaultHideS
             howBean
          o oracle.apps.fnd.framework.webui.beans.layout.OAHideShowHead
             erBean
          o oracle.apps.fnd.framework.webui.OAControllerImpl
   •   OA Framework ToolBox Tutorial / Sample Library
          o oracle.apps.fnd.framework.toolbox.tutorial.webui.SupplierSe
             archPG
          o oracle.apps.fnd.framework.toolbox.samplelib.webui.BasicStru
             ctPG




550
Oracle Application Framework Developer's Guide, Release 12.1.3



Images in Your Pages
Overview
For the purposes of discussing how to incorporate images into your pages, we classify OA
Framework application images into the following categories:

Category        Description                                                    Images Added By
1               Core component images (for example: buttons, tabs, the         UIX
                List of Values (LOV) icon, train steps, table column sorting
                icons, the Hide/Show icons, message icons, the 1-pixel
                spacer image and so on)
2               Corporate and product branding images.                         Page Developers
3               Images added to support a page's functionality as              Page Developers
                illustrated in Figure 1 (see the Status, Delete and Update
                icons in the search results table).

This document describes how to add images in the third category. See the Branding document
for additional information about the second category. UIX renders images in the first category
automatically.

Figure 1: Typical OA Framework page showing all 3 categories of images




                                                                                                 551
Oracle Application Framework Developer's Guide




Contents

    •   Declarative Implementation
    •   Runtime Control
    •   Personalization Considerations
    •   Known Issues
    •   Related Information

Declarative Implementation
Step 1: Locate the image that you want to add to your page in either the Ancillary Graphic
Repository (internal link | external link) or the Icon Repository (internal link | external link). You'll
need the image's name and its size for Step 2.

Note for Oracle E-Business Suite Developers: If you need new images for your product,
contact the Oracle User Interface team to request assistance. Once the UI team creates a new
icon for you and adds it to the Icon Repository or the Ancillary Graphic Repository, the OA



552
Oracle Application Framework Developer's Guide, Release 12.1.3


Framework team automatically includes this new file in the next regularly scheduled "images"
ARU.

Step 2: Create a new item with a standards-compliant ID and set the following properties for the
item:

   •   Set the Style property to image.
   •   Set the Image URI to the image's name. For example, to add the Update (enabled)
       icon shown in Figure 1 above, you would set this value to updateicon_enabled.gif.
   •   Set the Additional Text property to the value listed in the image's source repository.
       This value is displayed as tooltip text, and used for accessible component access (and
       as such is required by the Accessibility coding standards). If an image is purely
       decorative, then set this to DECORATION to generate an empty string for its value
       (which appears in the HTML source as alt="" for the image tag).
   •   Set the Height to the image's published height.
   •   Set the Width to the image's published width.

       Note: The Height and Width properties must be set for any images that you add to a
       page. See the View Coding Standard V30 for additional information.

   •   If selecting the image should perform an HTTP GET, set the Destination URI to a
       target page (for example:
       OA.jsp?page=/oracle/apps/fnd/framework/toolbox/samplelib/webui/Sa
       mpleBrowserPG&retainAM=Y). If selecting the image should perform an HTTP POST,
       see Submitting the Form for special configuration instructions.

At runtime, OA Framework instantiates an
oracle.apps.fnd.framework.webui.beans.OAImageBean.

Tip: If you need to conditionally display different images in a table (for example, a Delete image
is enabled or disabled on a row-level basis), use a Table Switcher. You can also use a bound
value as shown in the Runtime Control example below.

Storing and Deleting Product Specific Dynamic Images

OA Framework provides the following APIs for storing and deleting product specific temporary
and permanent dynamic images under /OA_HTML/fwk/t and /OA_HTML/fwk/p.

Note: These directories are not striped by product, therefore we recommend that all image
names be prefixed with the product code.

Use these APIs to return the physical path to where the images can be stored:
public String getTemporaryImageLocation();
public String getPermanentImageLocation();

Use these APIs to return the virtual path to where the images can be stored:
public String getTemporaryImageSource();
public String getPermanentImageSource();


                                                                                              553
Oracle Application Framework Developer's Guide


Note: This path can be used to build URLs for your images.

Use this API to delete a permanent or temporary image:
Public void deleteImage(String imageName, String imageType);

Use this API to ensure that your image name is unique:
Public String generateUniqueImageName(String imageName, String
imageType);

Note: Image type can be OAWebBeanConstants.OA_TEMPORARY_IMAGE or
OAWebBeanConstants.OA_PERMANENT_IMAGE.

In a typical customer environment, multiple users and JVMs access the same physical directory.
In order to guarantee a unique image name, an empty file corresponding to the image name is
created. File extensions provided in the image name will be respected. If you are attempting to
create a gif file, make sure your image name is someImageName.gif. It is the responsibility of
the application using the temporary images, to delete such images at the end of the transaction.
See the javadoc for more information.

How to use these APIs is shown in the Runtime Control example below.

Runtime Control
To add an image to your page programmatically, you must specify the relative image path in
addition to setting the height, width, and alternative text. However, (when adding an image
declaratively, it is sufficient to specify just the image's name and the alternative text. For
example:



import oracle.apps.fnd.framework.webui.OAWebBeanConstants;

import oracle.apps.fnd.framework.webui.beans.OAImageBean;

...



public void processRequest(OAPageContext pageContext, OAWebBean
webBean);

{

    super.processRequest(pageContext, webBean);



    ...

554
Oracle Application Framework Developer's Guide, Release 12.1.3




    OAImageBean dots =

    (OAImageBean)createWebBean(pageContext,
OAWebBeanConstants.IMAGE_BEAN, null, "dotsImage");

  dots.setSource(OAWebBeanConstants.APPS_MEDIA_DIRECTORY +
"cc_dotsprocess.gif");


dots.setShortDesc(pageContext.getMessage("FND","FND_DOTS_SHORT_DESC"))
;

    dots.setHeight("35");

    dots.setWidth("8");



    webBean.addIndexedChild(dots);



}

You can also add an image to your page using bound values, as shown below. (See the Bound
Values topic for additional information). This particular example (from the PoSummaryCO class
in the ToolBox Tutorial application) uses a view object attribute value to set the correct status
image on a row-level basis).



import oracle.cabo.ui.data.BoundValue;

import oracle.cabo.ui.data.bind.ConcatBoundValue;

import oracle.cabo.ui.data.bind.FixedBoundValue;

import oracle.apps.fnd.framework.webui.OADataBoundValueViewObject;

import oracle.apps.fnd.framework.webui.beans.OAImageBean;

...



public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

                                                                                              555
Oracle Application Framework Developer's Guide


{

    super.processRequest(pageContext, webBean);



    OAImageBean statusImageBean =

         (OAImageBean)table.findIndexedChildRecursive("StatusImage");



    /*

  ** Note that you may define an image bound value without specifying
the APPS_MEDIA_DIRECTORY,

  ** however, we include this example to show you how to concatenate a
fixed bound    value

    ** with a data bound value.

    */



    // Define the OA Framework image directory



  FixedBoundValue imageDirectory = new
FixedBoundValue(APPS_MEDIA_DIRECTORY);



  // Define a binding between the image bean and the view object
attribute that it

    // will reference to get the appropriate .gif image value name.

  // Note that the corresponding attribute values are obtained using a
decode() in the

    // POSimpleSummaryVO view object. Another attribute must be defined

    // to return the text to be displayed for the shortDesc.




556
Oracle Application Framework Developer's Guide, Release 12.1.3


    OADataBoundValueViewObject statusBinding =

      new OADataBoundValueViewObject(statusImageBean, "StatusImage");

    OADataBoundValueViewObject statusTextBinding =

      new OADataBoundValueViewObject(statusImageBean, "StatusText");



  statusImageBean.setAttributeValue(SHORT_DESC_ATTR,
statusTextBinding);



  // Concatenate the image directory with the actual image name (as
retrieved

    // from the view object attribute decode() statement)



    ConcatBoundValue statusCBV

    = new ConcatBoundValue(new BoundValue[] {imageDirectory,
statusBinding});



  // Finally tell the image bean where to get the image source
attribute



    statusImageBean.setAttributeValue(SOURCE_ATTR, statusCBV);



}

The following is an example of how the APIs for storing and deleting product specific dynamic
images may be used:



...




                                                                                            557
Oracle Application Framework Developer's Guide


       //At the beginning of a transaction

       //Image returned would look like HRCar2.gif, if say another image

       //with the prefix HRCar.gif already exists in that directory.



    String imageName =
pageContext.generateUniqueImageName("HRCar.gif",

        OAWebBeanConstants.OA_TEMPORARY_IMAGE);



    //assuming your image generation program takes full path to the
image being created

       someAPIForCreatingTheGif(getTemporaryImageLocation() + imageName);



       //create the image bean

       OAWebBeanFactory factory = pageContext.getWebBeanFactory();

    OAImageBean image =
(OAImageBean)factory.createWebBean(pageContext, IMAGE_BEAN);

    image.setSource(getTemporaryImageSource() +
"infoicon_active.gif");



...



       //At the end of the transaction

    pageContext.deleteImage(imageName,
OAWebBeanConstants.OA_TEMPORARY_IMAGE);

Personalization Considerations
   •    See a summary of Images in Your Pages personalization considerations in the Oracle
        Application Framework Personalization Guide.



558
Oracle Application Framework Developer's Guide, Release 12.1.3


Known Issues
  •   None

Related Information
  •   BLAF UI Guideline(s)
         o Ancillary Graphic List (Repository) [OTN Version ]
         o Icon Repository [OTN Version]
  •   Javadoc
         o oracle.apps.fnd.framework.webui.beans.OAImageBean




                                                                                 559
Oracle Application Framework Developer's Guide



Include Content (URL and Servlet)
Overview
You can use the URL Include or Servlet Include web beans to include HTML content loaded
from an external source under a parent region. This allows you to easily modify the HTML
content without disturbing your E-Business Suite application page.

    •    URL Include - use this item style to display a block of very simple HTML content on an
         existing page. For example, you may use this item style to display recent
         announcements on a home page.
    •    Servlet Include - use this item style to display a block of HTML content loaded from a
         local Servlet or JSP.

URL Include
Figure 1: Example of a "Home" page including a simple HTML announcement.




Declarative Implementation

Step 1: Create a new Item in the region where you want to include content.

Step 2: In the Property Inspector, set the Item Style property to urlInclude.

Step 3: Enter a value for the Source URI property to indicate the source of the HTML content.
Note the following:

    •    The value should be an absolute URL such as,
         http://www.oracle.com/products/product_list.html, and not a relative
         URL, such as /products/product_list.html. Relative links behave as relative to
         the surrounding page and not relative to the source of the HTML content.


560
Oracle Application Framework Developer's Guide, Release 12.1.3


    •    No post-processing on the HTML is performed, so the included HTML should not include
         HTML tags like <html> or <body>.
    •    Do not use forms or input fields in your HTML content, because anything submitted in
         the form (POST) is sent in the context of the surrounding page, not the source of the
         HTML content.

Note: If the included HTML content contains a link that navigates out of that content, you
should include a target="_blank" designation so that the link opens in a new browser
window instead of in the current browser window, unless that is what you desire. For
example, the HTML link would look something like this:



<a href="http://www.oracle.com/products/product_list.html"

   target="_blank">Oracle Products</a>

Runtime Control

No programmatic steps are required to implement the URL Include web bean.

Servlet Include
Figure 2: Example of a dynamic page displaying the number of times accessed




Declarative Implementation

Step 1: Create a new Item in the region that you want to include content.

Step 2: In the Property Inspector and set the Item Style property to servletInclude.

Step 3: Enter a value for the Source URI property to indicate the source of the local Servlet or
JSP. Note the following restrictions:

    •    The value should be an relative URL to the JSP or Servlet.
    •    Query parameters may be appended to the relative URL. These parameters are visible
         to the included servlet or JSP in its ServletRequest.

Runtime Control

                                                                                                 561
Oracle Application Framework Developer's Guide


No programmatic steps are required to implement the Servlet Include web bean.

Personalization Considerations
   •   None.

Known Issues
   •   None




562
Oracle Application Framework Developer's Guide, Release 12.1.3



Inline Messaging, Tips, Hints and Bubble Text
Overview
Per the Oracle Browser Look-and-Feel (BLAF) UI Guideline Inline Messaging, Tips, Hints and
Bubble Text [ OTN Version ], you can add supplemental helpful text to your pages to help the
user complete the task at hand. Within this general category of help methods (see the UI
Guideline for information on how to choose the appropriate help method(s) for your design), this
document describes how to add field-level hints, tips and bubble text. Figure 1 shows instruction
text set for the page and region-levels, field-level hints and a tip. Figure 2 shows bubble text
examples.

     •    See the Instruction Text document for information on adding primary task help text at the
          page and region levels.
     •    See the Buttons (Global) document for information on adding page-level context
          sensitive help to the Help global button.

Figure 1: Example of page and region-level instruction text, field-level hints and a tip.




Figure 2: Bubble text examples.




                                                                                                    563
Oracle Application Framework Developer's Guide




Inline Messages / Field-Level Hints
You can declaratively create either short or long field-level hints:

   •   The short hints render immediately below the item as shown in Figure 1 (see the
       Purchase Order field).
   •   The long hints render as a selectable information icon next to the item (see the Created
       poplist in Figure 1). When the user selects the information icon, a dialog window opens
       as shown in Figure 3 below.

Note that you cannot configure a static error message as shown in the UI Guidelines (this is
displayed automatically for you when field-level validation fails; see Error Handling for additional
information about this). You also cannot associate a warning icon with an item as shown in the
UI Guidelines.

Field-Level Hint

To configure a field-level hint for any field that is not displaying a date (see the date format
instructions below for this case):

Step 1: In the JDeveloper structure pane, select the item with which you want to associate a
hint.

Note: Field-level hints can be configured only for those items whose name begins with
message (for example, a messageChoice or a messageTextInput).

Step 2: Set the Tip Type property to shortTip.

Step 3: Define a message in the Applications Message Dictionary for the text you want to
display. Set the Tip Message Appl Short Name and the Tip Message Name properties
accordingly.

564
Oracle Application Framework Developer's Guide, Release 12.1.3


The OA Framework displays your text in the current session language immediately beneath the
related item.

To configure the standard date format example beneath a date field:

Step 1: In the JDeveloper structure pane, select the date item that needs a format example.

Step 2: Set the Tip Type property to dateFormat.

The OA Framework automatically renders a standard date format example using the user's date
format preference.

Long Hint (with Information Icon)

To add a long hint to an item:

Step 1: In the JDeveloper structure pane, select the item with which you want to associate a
hint.

Step 2: Set the Tip Type property to longMessage.

Step 3: Configure the long message content:

    •    (Option 1) Define a message in the Applications Message Dictionary for the text you
         want to display. Set the Tip Message Appl Short Name and the Tip Message
         Name properties accordingly, and the OA Framework displays your message in the
         dialog shown below when the user selects the item's information icon.
    •    (Option 2) If you need complete control of the contents in the dialog window, do not
         specify the Tip Message Appl Short Name and Tip Message Name properties.
         Instead, design your own region and specify its fully qualified name for the Long Tip
         Region property (for example,
         /oracle/apps/fnd/framework/toolbox/webui/PurchaseOrderLongTipRN).
         At runtime, the OA Framework displays your region in the dialog.

Figure 3: Dialog window that opens when the information icon is selected.




                                                                                                 565
Oracle Application Framework Developer's Guide


Tips
Although the field-level hint properties in JDeveloper are called "tips," a tip in BLAF UI
Guidelines parlance is a special component with an icon, a standard "TIP" prefix and the tip text
that you define (an example is shown immediately above the search results table in Figure 1).
When you define a tip for your page, the OA Framework instantiates an
oracle.apps.fnd.framework.webui.beans.OATipBean and renders the tip text in the
current session language.

Tip: If you want to display tip text that includes HTML tags, see the Custom HTML document.

Declarative Implementation

To add a tip to your document:

Step 1: In the JDeveloper structure pane, select the region where you want to add a tip, right-
click and select New > Item. Note that, unlike field-level hints which are associated with directly
with existing items, tips are like any other item; you can simply add them wherever you need
them.

Step 2: Specify the item ID in accordance with the OA Framework Naming Standards and set
the Item Style to tip.

Step 3: If your tip text is very brief, you may enter it directly in the Text property. Otherwise,
define a message in the Applications Message Dictionary, and then set the Tip Message
Appl Short Name and the Tip Message Name accordingly.

Runtime Control

Warning: You should create web beans programmatically only if you cannot create them
declaratively. Programmatically created web beans cannot be personalized, reused, or
extended easily.

See the OA Framework Controller Coding Standards for additional information about this and
other guidelines that you should consider when writing web bean manipulation code.

If you need to create a tip programmatically, follow these steps:

Step 1: Create a message in the Applications Message Dictionary.

Step 2: Instantiate the tip as shown below. Then, instantiate an
oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBean to hold your
tip text and add it as an indexed child of the tip. Note that UIX automatically sets the CSS style
to OraTipText on your behalf.




566
Oracle Application Framework Developer's Guide, Release 12.1.3


import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBean;
import oracle.apps.fnd.framework.webui.beans.OATipBean;

...

public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

{

// Always call this first.

super.processRequest(pageContext, webBean);



 // Instantiate the tip bean using the factory mechanism (do not use
"new").

OATipBean tip = (OATipBean)createWebBean(pageContext,

                                               OAWebBeanConstants.TIP_BEAN,

                                               null,"aName");



// Instantiate the text portion of the tip.

 OAStaticStyledTextBean tipText =
(OAStaticStyledTextBean)createWebBean(pageContext,


OAWebBeanConstants.STATIC_STYLED_TEXT_BEAN,

                                               null,"anotherName");



 // Obtain the translated text value from the Applications Message
Dictionary
 // and set it as the text value in the static styled text bean.

 String tipTextValue = pageContext.getMessage("AK",
"FWK_TBX_T_TIP_BEAN", null);

tipText.setText(tipTextValue);


                                                                                567
Oracle Application Framework Developer's Guide




 // Add the tip text to the tip bean.

 tip.addIndexedChildren(tipText);



}

Bubble Text
Bubble text, otherwise known as "ALT" or "rollover" text, should be added to buttons and
images as described in the OA Framework View Coding Standards Accessibility section. See
this document for instructions on when and how to specify the ALT text. See the UI Guideline for
information on appropriate verbiage.

Related Information
    •   BLAF UI Guidelines
           o Inline Messaging, Tips, Hints and Bubble Text [ OTN Version ]
    •   Javadoc
           o oracle.apps.fnd.framework.webui.beans.OATipBean
           o oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBea
              n
    •   Developer's Guide
           o Instruction Text
           o Buttons (Global)
           o Custom HTML
           o OA Framework View Coding Standards
           o OA Framework File Standards
           o Error Handling
    •   OA Framework ToolBox Tutorial / Sample Library
           o oracle.apps.fnd.framework.toolbox.tutorial.webui.PoSearchPG
              .xml




568
Oracle Application Framework Developer's Guide, Release 12.1.3



Instruction Text
Overview
Per the Oracle Browser Look-and-Feel (BLAF) UI Guideline Instruction Text [ OTN Version ],
instruction text is the primary method for directing and helping users to perform specific tasks.
Instruction text can be specified in relation to the following as illustrated in Figure 1 below.

     •    the entire page
     •    a section of content (a subheader or a subsubheader)
     •    a table
     •    a group of components within a section of content (rare, not illustrated in Figure 1)

Figure 1: Example of instruction text in different parts of the page.




See Inline Messages, Tips, Hints and Bubble Text for information on creating field-level hints
and tips as shown above the table in Figure 1.

Declarative Implementation
To add plain instruction text (without any links or HTML formatting) in any of the valid page
areas, following these steps and the OA Framework will create an
oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBean.

Tip: If you want to display tip text that includes HTML tags, see the Custom HTML document.

Step 1: Create a message in the Applications Message Dictionary.

Step 2: Create a region item and set its Style to staticStyledText.

Step 3: Set the region item's ID property in accordance the OA Framework File Standards.


                                                                                                    569
Oracle Application Framework Developer's Guide


Step 4: Set the CSS Class property to OraInstructionText.

Step 5: Associate the message you created in Step 1 with the region item you created in Step 2
by setting its Message Name and Message Appl Short Name properties as appropriate for
your message.

Runtime Control
Warning: You should create web beans programmatically only if you cannot create them
declaratively. Programmatically created web beans cannot be personalized, reused, or
extended easily.

See the OA Framework Controller Coding Standards for additional information about this and
other guidelines that you should consider when writing web bean manipulation code.

If you need to create a tip programmatically, follow these steps:

Step 1: Create a message in the Applications Message Dictionary.

Step 2: Instantiate the static styled text and configure its key properties.



import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBean;

...

public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

{

 // Always call this first.

 super.processRequest(pageContext, webBean);



 // Instantiate the instruction text bean using the createWebBean()
factory.

 OAStaticStyledTextBean helpText =
(OAStaticStyledTextBean)createWebBean(pageContext,


OAWebBeanConstants.STATIC_STYLED_TEXT_BEAN,



570
Oracle Application Framework Developer's Guide, Release 12.1.3


                                                 null,"aName");



// Obtain the translated message from Message Dictionary and set it

// as the bean's value.

 String helpTextValue = pageContext.getMessage("AK",
"FWK_TBX_T_REGION_GENERAL", null);

helpText.setText(helpTextValue);



// Set the CSS Style to OraInstructionText.

helpText.setCSSClass("OraInstructionText");



}

Personalization Considerations
    •   None

Known Issues
    •   None

Related Information
    •   BLAF UI Guidelines:
           o Instruction Text [ OTN Version ]
    •   Developer's Guide
           o Custom HTML
    •   Javadoc
           o oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBea
              n




                                                                                  571
Oracle Application Framework Developer's Guide



Buttons (Links)
Overview
This document describes the different kinds of links that you can create for your pages.

     •    "Return to" Link
     •    Display-Only Table Column Link
     •    Display-Only Text Field Link
     •    Plain Link
     •    "Mailto" Action Link
     •    Form Submit Links

Note: For information about buttons that behave as links, see Buttons (Action / Navigation). For
information about embedding links in instruction text, see the Instruction Text document.

"Return to" Link
"Return to..." links render below the page contents bottom line as shown:

Figure 1: "Return to..." link an a page-level action/navigation button below the "ski"




Declarative Implementation

A "Return to... link" is a special named component of the page layout region. To create one:

Step 1: Select your pageLayout region in the JDeveloper Structure pane, right-click and select
New > ReturnNavigation. JDeveloper creates a link item for you.

Step 2: Name the link in accordance with the OA Framework File Standards, set the Text to
display, and set the Destination URI to the target page. For example:
OA.jsp?page=/oracle/apps/dem/employee/webui/EmpSearchPG&retainAM=Y.

Runtime Control

Warning: You should create web beans programmatically only if you cannot create them
declaratively. Programmatically created web beans cannot be personalized, reused, or
extended easily.

See the OA Framework Controller Coding Standards for additional information about this and
other guidelines that you should consider when writing web bean manipulation code.

572
Oracle Application Framework Developer's Guide, Release 12.1.3


Instantiate

To add a return link programmatically:



processRequest(OAPageContext pageContext, OAWebBean webBean)

{

    super.processRequest(pageContext, webBean);



 OALinkBean returnLink =

   (OALinkBean)createWebBean(pageContext,
OAWebBeanConstants.LINK_BEAN, null, "returnLink");


returnLink.setDestination("OA.jsp?page=/oracle/apps/dem/employee/webui
/EmpSearchPG&retainAM=Y");



 // Retrieve and set the translated link text.

 String linkText = pageContext.getMessage("AK",
"FWK_TBX_T_RETURN_TO_POS", null);

 returnLink.setText(linkText);



 // Add the return link to the page.              This example assumes the
controller is



 // associated with the pageLayout region.

 ((OAPageLayoutBean)webBean).setReturnNavigation(returnLink);



}

Display-Only Table Column Link

                                                                                        573
Oracle Application Framework Developer's Guide


Typically, display-only table columns are messageStyledText items. To enable the link, simply
set the Destination URI property and set the CSS Class to OraLinkText. Then, set the
View Instance and View Attribute properties as you normally would to obtain the link
text.

Remember that you can use tokens in your Destination URI to obtain parameter values for
the request when the link is selected. For example, the following Destination URI value
obtains the empNum primary key from the EmployeeNumber attribute in the current row of the
associated view object:

OA.jsp?page=/oracle/apps/dem/employee/webui/EmpDetailsPG
&retainAM=Y&addBreadCrumb=Y&empNum={@EmployeeNumber}

Figure 2: Example of display-only text table column links.




See Implementing the View for detailed information about using URL tokens.

Display-Only Text Field Link
The important characteristic of a display-only text field link is it renders aligned with other text
fields, and it includes a prompt.

To achieve this, simply create a messageStyledText bean and configure its properties as
described in the Display-Only Table Column Link section above.

Plain Link
If you want to display a simple link without a prompt, add a link item to your page and set its
Destination URI property. You can either set its Text property, or you can bind the link to a
view object by setting its View Instance and View Attribute properties.

"Mailto"Action Link
If you want a link to send an email when selected, for any component that can be configured as
a link, simply set the destination property to mailto:<emailAddress>.

For example, the Destination URI property for the "Buyer" field shown in Figure 3 above is
defined as mailto:{@BuyerEmail}.


574
Oracle Application Framework Developer's Guide, Release 12.1.3


Note the use of token replacement to obtain the BuyerEmail value from a view object attribute.

Form Submit Links
If you need to perform specific actions when users select a link or an image, you can configure
them to submit the page form instead of simply navigating to their target pages. See Submitting
the Form for instructions on how to implement this.

Related Information
   •   BLAF UI Guidelines
          o Buttons (Links) [ OTN Version ]
   •   OA Framework Developer's Guide
          o Submitting the Form
          o Implementing the View
          o OA Framework File Standards
          o OA Framework Controller Coding Standards
          o Buttons (Action / Navigation)
          o Instruction Text
   •   Javadoc
          o oracle.apps.fnd.framework.webui.beans.message.OAMessageStyl
             edTextBean
          o oracle.apps.fnd.framework.webui.beans.nav.OALinkBean
          o oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBe
             an




                                                                                            575
Oracle Application Framework Developer's Guide



List of Values (LOV)
Overview
As described in Oracle Browser Look-and-Feel (BLAF) UI Guideline: LOV (List of Values) [ OTN
Version ], a List of Values (LOV) is a special control that lets users choose a value from a
predefined list of values for the purpose of populating one or more fields on a page.

Implementation details for the following LOV types are described below.

    •    Text Field LOV
    •    Dependent LOV Text Field
    •    LOV Choice List
    •    Multiselect LOV (For a Table)
    •    Multiselect LOV (For a Single Field)

An LOV Primer
Before learning how to implement a List of Values, it's important to understand its key
components and behavior. This section briefly describes each of the following; implementation-
level details are provided below for the different LOV types.

    •    Base Page and LOV Window
    •    LOV Mappings
    •    Dependent LOVs
    •    Validation (Also Known as "Autocompletion")
    •    AutoClear
    •    Look Ahead LOV

Base Page and LOV Window

A base page includes an LOV control in its page layout. For example, Figure 1 illustrates a
"Purchase Order" LOV field. When the user selects the magnifying glass icon, the LOV window
shown in Figure 2 displays. The user optionally searches within the LOV using designated query
criteria, and selects a row from the results list to populate the value(s) in the base page (you can
configure your LOV to return multiple values to different base page items).

Figure 1: Purchase Orders and LOV Search.




576
Oracle Application Framework Developer's Guide, Release 12.1.3




Figure 2: An LOV window with Advanced Search enabled




LOV Mappings

                                                                                              577
Oracle Application Framework Developer's Guide


LOV Mappings define the data communication between the base page and the LOV window. An
LOV map is comprised of the following participants:

LOV Item

The item in the LOV for which the mapping is defined.

(Base Page) Criteria

When the user invokes a List of Values, one or more field values from the base page can be
passed to the LOV to be used as search criteria (note that the LOV field on the base page
should always be configured as a search criteria item). When the LOV window renders, the
query results are displayed. For example, in the purchase order example above, if the user
enters "2" in the "Purchase Order" field and selects the LOV icon, the query will return all
purchase orders whose number starts with "2."

If you need to programmatically control the query criteria (for example, you need to intercept
base page values to ascertain what the real query criteria should be), then you must configure
the LOV to accept passive criteria, which is loosely defined to mean any LOV query criteria that
you specify programmatically in an associated LOV controller.

(Base Page) Result

When the user selects a row in the LOV, one or more values are returned to the base page. In
the ToolBox Tutorial Application example shown in Figure 1 above, each of the user-friendly
"Buyer," "Supplier" and "Supplier Site" LOV fields also have hidden primary keys. When the
user selects a value from the LOV, the OA Framework copies both the user-friendly name and
the primary key values to the base page.

Figure 3: XML page structure showing the Buyer, Supplier and Supplier Site LOV fields and the corresponding hidden primary
key fields.




578
Oracle Application Framework Developer's Guide, Release 12.1.3




Dependent LOVs

You can also configure an LOV value to depend on a value from another field(s). For example,
in the ToolBox Tutorial Application example shown above, the user cannot select a supplier site
value until a supplier is selected, so the "Supplier Site" LOV is configured to depend on the
"Supplier" value.

Validation (Also Known As "Autocompletion")

LOVs can be configured to automatically validate data that the user enters without invoking the
LOV window unless required. For example, if partial page rendering (PPR) is enabled and the
user enters the value "Smi" in a Buyer name field and then tabs out, the OA Framework
automatically queries all buyers whose name begins with "Smi."

In such a case, the following outcomes are possible:

   •   If a single match is found, the OA Framework automatically populates the result field(s).
   •   If multiple matches are found, the OA Framework displays the LOV window so the user
       can try different search criteria.
   •   If no matches are found, the OA Framework displays the LOV window so the user can
       try different search criteria.
   •   Note: PPR does not work with pages that have errors on them; the OA Framework
       resorts to a full page refresh in these cases.


                                                                                             579
Oracle Application Framework Developer's Guide


Validate-On-Submit

The OA Framework also automatically validates hidden formValue LOV result fields when the
page form is submitted (You can declaratively disable this for formValue fields and enable it for
displayed LOV fields).

This second level of checking is important for the following reasons:

   •   If PPR is disabled, validation is simply not performed when the user enters a value and
       tabs out; no other result fields will be populated.
   •   Even if validation causes the LOV window to open, the result fields will still be empty if
       the user cancels out without making a selection.
   •   If the user enters a value in the LOV field and immediately selects a submit button, link
       or icon without tabbing out first, regular validation is not performed.

When validate-on-submit is enabled, the LOV behaves almost exactly the same as it does when
performing the standard validation:

   •   If a single match is found, the OA Framework automatically populates the result field(s).
   •   If multiple matches are found, the OA Framework displays an error message at the top
       of the base page.
   •   If no matches are found, the OA Framework displays an error message at the top of the
       base page.

Passive Criteria

Previously, LOVs with passive criteria could not be properly validated. Even if a single valid
match was found for the given criteria, the OA Framework displayed the LOV window so the
user could select the single matching value. Now, even LOVs with passive criteria can be
validated (assuming you enable validation on the LOV field as described in the implementation
details below).

AutoClear

The OA Framework automatically clears dependent fields when the user changes the LOV
value.

   •   First, if the user changes a value of the LOV field, or any criteria items for the LOV, and
       tabs out, the OA Framework clears all associated result field values.
   •   Second, if the user changes the value of an LOV criteria field and tabs out, the OA
       Framework clears the LOV field value.

Note that AutoClear cascades throughout LOV relationships. For example, assume the user
changes the value of a criteria field and tabs out. The OA Framework clears the corresponding
LOV input field, and all related results fields. If any of these result fields are designated as a
criterion for different LOV field, that LOV input will also be cleared along with its result fields.
This continues until all related LOV items have been cleared.




580
Oracle Application Framework Developer's Guide, Release 12.1.3


Warning: If an LOV result is written to a messageStyledText item, AutoClear cannot clear this
field.

Look Ahead LOV

The List of Values component also has type-ahead search capabilities. As an end-user types in
characters in the LOV search field, the results are fetched and displayed inline to the LOV
component. A user can select a value from this look ahead window just as in the classic LOV
window. For most use cases, this capability eliminates the need to launch the LOV modal
window, to perform a search within the window, and to navigate through the results using Next /
Previous links in the LOV window results table, thereby saving a number of clicks and server-
side requests, and significantly enhancing end-user productivity.

The Look Ahead LOV is enabled by default. It is controlled by a property on the
messageLovInput item and the profile option FND: Disable Look Ahead LOV at the Site or
Application level. When Look Ahead LOV is enabled for a LOV component, a UI indicator of a
dimmed downward arrow in the lower right corner of the LOV text input field appears.

Figure 4: The Look Ahead LOV window appears as a user enters data in the Application Name LOV.




An inline list of values appears only when a user enters 1 or more alpha-numeric characters into
the LOV input field. You can specify the minimum number of characters required to initiate the
Look Ahead LOV by setting a property on the messageLovInput item or by setting the profile
option FND: Minimum Characters for Look Ahead at the Site or Application level.

By default, the Look Ahead LOV performs a search for records that "start" with the alpha-
numeric characters entered. You can change this behavior to search for records that "contain"
the criteria entered, by setting a property on the messageLovInput item.

                                                                                                 581
Oracle Application Framework Developer's Guide


The matching records appear in the Look Ahead LOV window below the LOV text input field.
The matching records update in real-time as the user enters or deletes characters in the LOV
input field. By default, only a maximum of 50 records are fetched at a time, but you can change
that maximum by setting a property on the messageLOVInput item. Users can click on the
Next/Previous links in the window to fetch further or previous records.

By default, the Look Ahead LOV displays 10 rows in its visible area. Depending on your page,
you can change the number of rows to display in its visible area by setting a property on the
messageLOVInput item.

Users can navigate the Look Ahead LOV window of matching records by using the keyboard or
mouse.

Keyboard Navigation

    •    [Tab] - Highlights the next record.
    •    [Up Arrow] - Highlights the previous record. If the currently highlighted record is the first
         record, the Up Arrow removes the highlighting from that record. If no record is currently
         highlighted, the Up Arrow has no effect.
    •    [Down Arrow] - Highlights the first record if no records are currently highlighted, or
         highlights the next record if a record is already highlighted.
    •    [Esc] - Dismisses the Look Ahead LOV window without selecting a record.
    •    [Alt][<] or [Alt][Shift][,]- navigates to the previous page of records.
    •    [Alt][>] or [Alt][Shift][.]- navigates to the next page of records.
    •    [Alt][R] - invokes the LOV modal window where you can refine your search.
    •    [Space bar] - selects the highlighted value.

Mouse Navigation

    •    Hovering over a particular record highlights the record.
    •    Left-clicking on the highlighted record selects the highlighted record and populates the
         record values into the result fields.
    •    Scrolling the mouse scrolls the Look Ahead LOV window.

Note: If a user enters data into the LOV input field without first entering values for the LOV's
criteria fields, then the message about missing validation criteria appears, as in the traditional
LOV modal window. If no records match the data that the user enters into the LOV input field,
then the same message of 'No records found' appears as in the results table of the LOV modal
window.

Figure 5: A 'No Items found' message displayed by the Look Ahead LOV feature if no record matches the data entered by the
user.




582
Oracle Application Framework Developer's Guide, Release 12.1.3




Text Field LOV
As illustrated in Figures 1 and 3 above, a Text Field LOV is an updateable text field with an
associated flashlight icon. Its behavior at runtime depends on your configuration decisions.

Declarative Implementation

Driving View Object Based on Entity Objects

If the view object that you are updating with the LOV selection results is based on entity objects,
and your LOV will be returning values mapped to entity-object based attributes on one or more
reference entity objects:

   1. You must define associations between the driving entity and each reference entity.
   2. In the view object definition wizard, you must configure each reference entity object's
      Association End as Reference and Read Only.

For example, assume you define a page to create a purchase order including an LOV to select
a supplier:

   •   The LOV returns a SUPPLIER_ID foreign key value for update on the purchase order
       (PurchaseOrderEO), and a SUPPLIER_NAME value to display in the UI.
   •   The SUPPLIER_NAME value is mapped to a reference entity object attribute
       (SupplierEO.SUPPLIER_NAME).
   •   There is a reference association (PoToSupplierAO) that joins the
       PurchaseOrderEO.SUPPLIER_ID and the SupplierEO.SUPPLIER_ID.

When you configure the purchase order view object to reference the SupplierEO via the
PoToSupplierAO, you must check both the Read Only and Reference properties.

If you follow these instructions, OA Framework does not attempt to write any values on
reference entities (thereby avoiding a BC4J runtime error regarding updates to a Read Only
entity), and BC4J's standard faulting mechanism is used to automatically query the reference
values as needed.


                                                                                                583
Oracle Application Framework Developer's Guide


LOV View Object and Application Module

Step 1: As described in Implementing the Model, define a view object for your list of values
query (note that the OA Framework File Standards recommend creating this application module
in the oracle/apps/<app_short_name>/<module>/lov/server directory).

   •   This view object should include all the columns you want to display in the LOV results
       table, and any hidden values that you want to return when the user makes a choice. For
       example, a view object for selecting a buyer might include BUYER_NAME (displayed
       value), BUYER_ID (hidden primary key), and JOB_TITLE (displayed value).
   •   You do not need to include a WHERE clause for the base page search criteria items; the
       OA Framework automatically appends an appropriate WHERE clauses and bind
       variables based on the LOV criteria. That said, however, your LOV can include a
       WHERE clause that always restricts the result set (for example, an END_DATE check
       for a "Currently Employed Buyers" LOV).
   •   The view object for the LOV region can be based on an entity object, but given its limited
       data selection, it's typically created using plain SQL.

Step 2: If you have not already done so, create a dedicated application module (AM) to contain
all view objects that are shared by a package or module (note that the OA Framework File
Standards recommend creating this application module in the
oracle/apps/<app_short_name>/<module>/lov/server directory). Add the view object
that you created in Step 1 to this application module.

Note: Do not designate this application module as being passivation-enabled (it isn't a real root
application module).

LOV Field and (Optional) Additional Criteria/Results Fields

Step 3: In the OA Extension Structure pane, select the region where you want to add the LOV
field, right-click and select New > Item. Set the Item Style property to messageLovInput.

   •   Step 3.1: Specify a standards-compliant ID, an Attribute Set and other properties
       as usual for text fields.
   •   Step 3.2: If you don't want the LOV to automatically validate when the user enters a
       value and tabs out or submits the form without tabbing out, set the Disable
       Validation property to True. Note that, per the OA Framework View Coding
       Standards, this value should always be False unless it's essential that you allow partial
       values in the field (in a search region, for example).
   •   Step 3.3: To enable or disable the Look Ahead LOV feature, set the Look Ahead
       Enabled property to True or False, respectively. You can also update the profile FND:
       Disable Look Ahead LOV at the Site or Application level to False to enable the Look
       Ahead feature for all LOVs. The default value for this profile option is False at the Site
       level. Note that the value you set on the Look Ahead Enabled property overrides the
       profile value for this LOV.
   •   Step 3.4: Control the minimum number of alpha-numeric character inputs required to
       activate the Look Ahead LOV feature by setting the profile option FND: Minimum
       Characters for Look Ahead at the Site or Application levels. The default value for the
       profile option is 3. To override this profile option value and set a different minimum

584
Oracle Application Framework Developer's Guide, Release 12.1.3


       number of characters to activate the Look Ahead feature for this LOV, set the Minimum
       Characters For Look Ahead property to a value of 1 or higher.

       Note: For smaller width LOVs, that is, those LOVs whose width is 5 characters or
       less, if the width of the messageLovInput item is smaller (for example, 2) than
       the width set on the Minimum Characters For Look Ahead property or the
       FND: Minimum Characters for Look Ahead profile (for example, 3), then the
       minimum number of characters required to activate the Look Ahead LOV defaults
       to1.

   •   Step 3.5: Set the Look Ahead Search Type property to specify the search type of
       the Look Ahead LOV. Set the property to contains, to have the Look Ahead LOV return
       records whose LOV field value contains the matching characters anywhere within the
       value. Set the property to startsWith to have the Look Ahead LOV return records that
       start with the criteria entered. The default value for this property is startsWith.

       Note: For selective search criteria LOVs, Look Ahead Search Type cannot use the
       contains value.

   •   Step 3.6: By default, the Look Ahead LOV window fetches a maximum of 50 records. A
       scroll bar along with Next and Previous links enable navigation. Set the Look Ahead
       Records Displayed property to specify a different maximum. If more than the
       maximum number of records match the user's input, then Next and Previous links
       appear in the window to let the user navigate among the records.
   •   Step 3.7: By default, the Look Ahead LOV window displays 10 rows in its visible area.
       Set the Look Ahead Records Visible property to specify a different number of
       rows to display in the visible area to suit the needs of your specific page.
   •   Step 3.8: The Look Ahead Selection Event Enabled property lets you determine
       what happens when the user selects a value in the Look Ahead LOV window. If the
       property is set to:
           o True - a server-side LOV validate event fires, and the page refreshes with the
               resulting fields.
           o False - no server-side event fires, and the results are based on the client side.

       Note: According to the OA Framework View Coding Standards, this value should
       always be True if you have special handling in your controller for LOV events,
       like using isLovEvent().

Step 4 (optional): Create additional items for LOV result values. For example, if you create an
LOV for "Employee Name," you will probably need a hidden field for the "Employee ID" value.
Note that you should set the Style to formValue and the Rendered property to True for all
hidden fields used for LOV results. Items of type messageStyledText are also valid for results.

Step 5 (optional): Create additional items for LOV search criteria. Note that LOV criteria items
must be form elements (for example, they cannot be of type messageStyledText). If not, the
LOV cannot read their values. For example, if you define a text input field as an LOV criteria
item, but you set its Read Only property to True, it is not rendered as a form element.



                                                                                               585
Oracle Application Framework Developer's Guide


Tip: If you want to use the value that you display in a messageStyledText field as LOV search
criteria, consider creating a mirror formValue field to hold the same value. LOVs do allow
formValue items as criteria items.

Warning: Query criteria for supplemental fields (in addition to the LOV field itself) must be used
carefully. For example, assume an "Employee Name" LOV is configured to apply a
"Department" value as query criteria. If the user enters a value of "Sales" in the "Department"
field and selects the "Employee Name" LOV icon, all employees in the sales department are
displayed.

   •   The value entered in the criteria field is used to perform an exact match (the base page
       LOV field's value is an exception to this rule as it is always used to perform a partial
       match). As a consequence, if the user enters "Sa" in the "Department" field and invokes
       the "Employee Name" LOV, the query will not find any employees in the "Sales"
       department.
   •   Supplemental query criteria items cannot be used as user enterable search criteria
       within the LOV itself. So, in our "Department" example, the LOV cannot be configured to
       let the user search on "Department" within the LOV window (if she realizes she wants to
       search in the "Consulting" department instead, she needs to dismiss the LOV and
       change the "Department" value on the base page before opening invoking the LOV a
       second time).

LOV Region

Step 6: Create the LOV region itself. First, you need to decide if you want to create an "external"
LOV that can be leveraged in multiple pages by defining unique mappings for each instance, or
a single-use LOV for use only in the current page. Instructions for each are provided below.

To create a single-use LOV region:

   •   Step 6.1 When a you create a messageLovInput item, OA Extension automatically
       creates an inline LOV region (listOfValues style) for this item.
   •   Step 6.2: Select your new listOfValues region in the Structure pane, and set its AM
       Definition property to the fully qualified name of the application module you created
       in Step 2 above (for example,
       /oracle/apps/fnd/framework/toolbox/tutorial/lov/server/TutorialLO
       VAM).
   •   Step 6.3: Select the listOfValues region again, right-click and select New > Region
       Using Wizard to create your results table and bind it to the view object you created
       above (see the Tables documentation for additional information about creating this
       component).
           o Remember to give the region and its items standards-compliant IDs, and
               specify appropriate Attribute Sets for the items.
           o Set the item Style to messageStyledText for any items you want to display in
               the LOV "Results" table. Note that at least one table item must be of type
               messageStyledText for the LOV to render properly.
           o Set the item Style to formValue for any hidden items (remember to set their
               Rendered property value to True so the OA Framework includes them in the
               web bean hierarchy).


586
Oracle Application Framework Developer's Guide, Release 12.1.3


          o   Set the Search Allowed property to True for any LOV result items you want to
              present to the user as searchable values. These items are listed in the search
              poplist the user sees in the LOV window.
                   At a minimum you must set the Search Allowed property to True for
                      the the result table item corresponding to the LOV field on the base page.
                   Do NOT set the Search Allowed property to True for any result table
                      items that correspond to the supplemental search criteria items that you
                      created in Step 5 above.
          o   Set the Selective Search Criteria property to True to identify items for
              which the user must provide search criteria (see the Search topic for additional
              information about selective search criteria).
                   In the simple LOV search, only those items that have both the Search
                      Allowed and Selective Search Criteria properties set to True
                      will appear in the Search By poplist. At runtime, the user must provide a
                      real search value; if the user enters % or tries to perform the search
                      without specifying a Search By value, the OA Framework displays the
                      standard selective search criteria error message.

                      Note: For backwards compatibility, simple searches will function as they
                      always have if none of the items are marked with the Selective
                      Search Criteria property set to True.

                     In the advanced LOV search (instructions for enabling an advanced
                      search are provided below), all items whose Search Allowed property
                      is set to True will render, however, the user must enter a value in at least
                      one of the designated Selective Search Criteria fields.

                      Note: If you enable an advanced search, you must designate at least one
                      Selective Search Criteria item.

   •   Step 6.4 (optional): Select the listOfValues region again, right-click and select New >
       searchInstructions to provide custom help text for the LOV search region. Specify a
       standards-compliant ID, set the CSS Class to OraInstructionText and specify the
       Message Dictionary message to display as the help text by setting the Tip Message
       Appl Short Name and the Tip Message Name as appropriate.

To create a reusable LOV region:

   •   Step 6.1: Create the shared region (not a page!) using the instructions provided in
       Implementing the View: Create a Shared Region. Set its Style to listOfValues.
   •   Steps 6.2 - 6.4: Follow as documented above for the single-use LOV region.
   •   Step 6.5: Associate the reusable LOV with the base page LOV field. In the OA Extension
       Structure pane, select the LOV item you created in Step 3 and set its External LOV
       property to the fully qualified name of the shared listOfValues region you just created
       (for example,
       /oracle/apps/fnd/framework/toolbox/tutorial/lov/webui/EmployeesLo
       vRN).



                                                                                               587
Oracle Application Framework Developer's Guide


       Note: OA Extension confirms that you want to replace the default generated
       inline LOV region with the external LOV. Select the OK button to proceed, and
       OA Extension will remove the inline LOV region and display the external LOV in
       a dimmed state since you cannot edit a referenced object.

       Tip: If you change your mind and want to create an inline LOV after setting an
       external LOV, select the Set to Default Property Inspector toolbar button to clear
       the External LOV property. OA Extension automatically recreates the default
       inline LOV region for you.

LOV Mappings

Step 7: Create the LOV Mappings (regardless of whether you choose to implement a reusable
LOV or a single-use LOV, you map its data communication relationship to the base page in the
same way).

For the first mapping, select the LOV mapping that was created by default when you created
your messageLovInput. To create additional mappings, select the lovMappings node in the
Structure window, right-click and select New > lovMap from the context menu.

To configure a mapping:

   •   Specify the LOV Region Item that will participate in the mapping.
   •   Specify the Criteria Item for a base page item whose value is to be used as LOV
       search criteria.
   •   Specify the Return Item for a base page item whose value is to be populated by the
       LOV selection.
   •   Set the Required property to True for Criteria Items whose values must be populated
       before the LOV can be invoked (if not, the OA Framework displays an error message in
       the LOV window).
   •   Set the Programmatic Query property to True for any Criteria Items whose values
       you want to apply to the WHERE clause programmatically.
   •   Tip: you might use this approach, for example, if you have supplemental Criteria Items
       whose values should be used for partial matches instead of the default OA Framework
       behavior of an exact match (remember that the LOV field value itself is always used for a
       partial match).
   •   Set the Use for Validation property one of the following values:
           o default validate-on-submit will be triggered if the base item is of type formValue,
               and if it has no value (this is the OA Framework 5.7 behavior)
           o yes validate-on-submit will be triggered if the base item has no value regardless
               of the item type.
           o no validate-on-submit is not triggered by a null value regardless of the item type.
           o Note: if you want to turn off validate-on-submit altogether for an LOV input, you
               need to set the Use for Validation property to no for all LOV maps whose
               base item is of type formValue.

When configuring your mappings, pay close attention to the following usage notes:




588
Oracle Application Framework Developer's Guide, Release 12.1.3


    •      First and foremost, you need one mapping for each distinct field on the base page that
           you want to use as criteria and/or to which you want to return a result value. A single
           LOV mapping for the LOV field can handle both sending criteria values to the LOV, and
           receiving result values from the LOV. Note that older pages migrated from previous
           versions of JRAD or AK may show separate mappings for each direction.
    •      The data types for the LOV Region Item and the Criteria/Results Items must
           match. If they do not, and you are running in Developer Test Mode, you will receive an
           error.
    •      You must have a mapping for the base page LOV field. Specify the name of that field
           for both the Criteria Item and Return Item properties. For the LOV Region
           Item property, specify the item in the LOV region that corresponds to the base page
           LOV field. If you fail to configure the LOV field as a Criteria Item and you are
           running your page in Developer Test Mode, the OA Framework will display an error.
    •      In LOV mappings for fields other than the LOV field itself, you can specify either
           the Criteria Item or the Return Item property, but not both. Do not try to
           create one mapping for a (non-LOV field) field as criteria and another mapping for the
           same field as a return item, as this will cause runtime errors. For the LOV Region
           Item property, specify the item in the LOV region that corresponds to the appropriate
           base page field.
    •      If your LOV does not naturally include a formValue result item (so it returns its values
           only to visible fields), you must add at least one formValue result field whose Use for
           Validation property is set to True. For example, consider the following Address
           example:

LOV Usage                         Item Name                 Item Type
criteria                          AddressLov                messageTextInput
result                            AddressLov                messageTextInput
result                            City                      messageTextInput
result                            State                     messageTextInput

    •      In this case, we have an AddressLov field with associated City and State fields. When
           the user selects a value from the Address list of values, results are returned to the
           AddressLov field and its related City and State fields. This configuration can lead to the
           submission of invalid values when partial page rendering (PPR) is disabled. To resolve
           this, simply add a formValue item for one of the results as shown:

LOV Usage                  Item Name                               Item Type
criteria                   AddressLov                              messageTextInput
result                     AddressLov                              messageTextInput
result                     City                                    messageTextInput
result                     State                                   messageTextInput
result                     AddressFormValue                        formValue

    •      If the user tries to submit invalid values for the address fields, the OA Framework detects
           that the AddressFormValue field is null (meaning that it has not been populated by a
           valid LOV result value), and so it will validate the values on submission.

                                                                                                   589
Oracle Application Framework Developer's Guide


General Usage Notes

   •   The base page's LOV value is applied only to the first, automatic query that the OA
       Framework executes when the LOV window first opens (or for autovalidation, when the
       user leaves the LOV field after entering a partial value). Any subsequent searches
       performed by the user in the LOV window do not use the base page LOV value.
   •   If there are no criteria in the base page LOV field, the OA Framework does not perform
       an automatic query when the LOV window opens.
   •   Query criteria from fields other than the LOV field are not displayed in the LOV window,
       but they will affect all queries executed in the LOV window.
   •   Any query criteria values from items configured as passive criteria are not automatically
       added to the WHERE clause; you must manually set them in a controller as described
       above.
   •   A table and an LOV used in a table should always used different view objects to avoid
       stale data errors.
   •   If an LOV is used in a table or an HGrid, you cannot map to criteria or result fields
       outside the table or HGrid.
   •   If you make an LOV text input field read only, the OA Framework hides the LOV icon
       and renders the data in messageStyledText item.
   •   If an LOV is used in a table with an "Add Another Row" button, and the LOV returns a
       result to a messageStyledText item, add a mirror formValue item for the
       messageStyledText item and map it to the same underlying view object attribute. Then,
       add a special LOV map to return the same value to the formValue field that you return
       to the messageStyledText field. This ensures that the data is properly written to the
       underlying view object.
   •   If the selected LOV value is longer than the specified maximum length of the LOV field,
       browsers exhibit different runtime behaviors. For example, Internet Explorer displays a
       client-side validation error message while Mozilla-based browsers return a truncated
       value to the base page. When designing your LOV, it is therefore desirable to ensure
       that the mapped value lengths are consistent.

Enabling Advanced Search in Your LOV

If you want to enable an advanced search in your LOV, in addition to the default simple search,
set the Advanced Search Allowed property on the listOfValues region to True.

You can also set this property programmatically by calling
setAdvancedListOfValues(Boolean.true) on the OAListOfValuesBean. Note that
this should be called only in the processRequest method of a controller associated with the
listOfValues region.

Advanced Search Usage Notes

   •   Per the BLAF UI guidelines, the Simple Search always displays by default, even if the
       Advanced Search is enabled. This state is illustrated in Figure 1 above.
   •   If the user searches in one mode and toggles to the other, the underlying query criteria
       object is cleared to avoid inconsistency.
   •   You should not make any changes to the underlying query criteria object yourself as this
       might destabilize the LOV.


590
Oracle Application Framework Developer's Guide, Release 12.1.3


    •   The Advanced Search displays any listOfValues region items whose Search
        Allowed property is set to True.

Runtime Control

Warning: You should create web beans programmatically only if you cannot create them
declaratively. Programmatically created web beans cannot be personalized, reused, or easily
extended .

See the OA Framework Controller Coding Standards for additional information about this and
other guidelines that you should consider when writing web bean manipulation code.

Instantiate

The following example code illustrates how to create a Text Field LOV programmatically. See
the oracle.apps.fnd.framework.webui.beans.message.OAMessageLovInputBean
Javadoc for additional information about these methods.



public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

{

    super.processRequest(pageContext, webBean);



    OAMessageLovInputBean lovInput =

      (OAMessageLovInputBean)createWebBean(pageContext, LOV_TEXT,
null, "inputTest");

    webBean.addIndexedChild(lovInput);



    // Specify the path to the base page.

   lovInput.setAttributeValue(REGION_CODE,
"/oracle/apps/dem/webui/Basic");


   // Specify the application id of the base page.
   lovInput.setAttributeValue(REGION_APPLICATION_ID, new
Integer(20001));



                                                                                          591
Oracle Application Framework Developer's Guide


      // Specify the LOV region definition.




lovInput.setLovRegion("/oracle/apps/fnd/framework/toolbox/tutorial/web
ui/EmployeesLovRN", 0);



   // Validation should be enabled for LOVs unless it's essential for
the field to allow

      // a partial value (in a "Search" region, for example).



      lovInput.setUnvalidated(false);



      // Configure the LOV mappings.

   // Note that you must call this method after you add the
messageLovInput item

      // to the web bean hierarchy.

   lovInput.addLovRelations(pageContext, "inputTest", // base page
item

                                                 "Empname", // lov item

                                                 LOV_RESULT, // direction

                                                 LOV_REQUIRED_NO);



   lovInput.addLovRelations(pageContext, "inputTest", // base page
item

                                                 "Empname", // lov item

                                                 LOV_CRITERIA, // direction

                                                 LOV_REQUIRED_NO);

      // Enable Look ahead.

592
Oracle Application Framework Developer's Guide, Release 12.1.3


    lovInput.setLookAheadEnabled(true);



    // Set the Search Type as contains.

    lovInput.setSearchType(CONTAINS);



    // Change the default number of records displayed to 100.

    lovInput.setLookAheadSize(100);



    // Enable Client side population.

    lovInput.setLookAheadSelectionEventEnabled(false);



    // Set the minimum characters to initiate look ahead as 1.

    lovInput.setMinCharsForLookAhead(1);

}

Usage Note: For the above code example, the REGION_CODE and REGION_APPLICATION_ID
attributes must be set to the path of a valid base page and to that valid base page's application
ID, respectively. These attribute values must represent an existing personalizable static region
reference and cannot be set to arbitrary values. OA Framework validates these values when it
renders "Personalize ..." region links on the page and a Java exception results when these
values do not represent a valid combination.

The following example illustrates how to add an LOV relation programmatically to a declaratively
defined LOV. See the OAMessageLovInputBean Javadoc for additional information about
these methods.



public void processRequest(OAPageContext pageContext, OAWebBean
webBean)

{

    super.processRequest(pageContext, webBean);

    OAMessageLovInputBean msglov =

                                                                                             593
Oracle Application Framework Developer's Guide


       (OAMessageLovInputBean)webBean.findChildRecursive("Employee");



      msglov.addLovRelations(pageContext,

                                 "Employee", // base page item name

                                 "EmpName", // lov item name

                                 LOV_CRITERIA, // direction

                                 LOV_REQUIRED_YES);

}

Configure WHERE Clause Based on Passive Criteria

If you have configured one or more criteria items as passive criteria, you must obtain the
passive criteria values and manually apply them to the WHERE clause in a controller associated
with the LOV region as illustrated in the Dependent Text Field LOV / Passive Criteria Example
below.

Switch LOV View Objects Based on Passive Criteria

If you need to change the view object an LOV queries dynamically, create a controller and
associate it with the LOV region. Then, create one or more passive criteria items that you can
inspect in this controller's processRequest metho
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
OAF Developer Guide 13.1.3
Ad

More Related Content

What's hot (20)

Đề tài: Quản lý cửa hàng điện thoại di động, HAY
Đề tài: Quản lý cửa hàng điện thoại di động, HAYĐề tài: Quản lý cửa hàng điện thoại di động, HAY
Đề tài: Quản lý cửa hàng điện thoại di động, HAY
Dịch vụ viết thuê Khóa Luận - ZALO 0932091562
 
Quy trình kiểm toán các khoản phải thu trong kiểm toán báo cáo tài chính tại ...
Quy trình kiểm toán các khoản phải thu trong kiểm toán báo cáo tài chính tại ...Quy trình kiểm toán các khoản phải thu trong kiểm toán báo cáo tài chính tại ...
Quy trình kiểm toán các khoản phải thu trong kiểm toán báo cáo tài chính tại ...
luanvantrust
 
Forecasting in Oracle Inventory
Forecasting in Oracle InventoryForecasting in Oracle Inventory
Forecasting in Oracle Inventory
Baker Khader Abdallah, PMP
 
Phân tích và thiết kế hệ thống quản lý bán hàng
Phân tích và thiết kế hệ thống quản lý bán hàngPhân tích và thiết kế hệ thống quản lý bán hàng
Phân tích và thiết kế hệ thống quản lý bán hàng
leemindinh
 
Thực tập kiểm thử phần mềm
Thực tập kiểm thử phần mềmThực tập kiểm thử phần mềm
Thực tập kiểm thử phần mềm
Nguyễn Anh
 
Oracle Framework Personalization
Oracle Framework PersonalizationOracle Framework Personalization
Oracle Framework Personalization
Edi Yanto
 
Md050 application extensions_functional_design_080112
Md050 application extensions_functional_design_080112Md050 application extensions_functional_design_080112
Md050 application extensions_functional_design_080112
magik570
 
Oracle fusion hrms_for_uae_hr_setup_white_paper_rel11
Oracle fusion hrms_for_uae_hr_setup_white_paper_rel11Oracle fusion hrms_for_uae_hr_setup_white_paper_rel11
Oracle fusion hrms_for_uae_hr_setup_white_paper_rel11
Feras Ahmad
 
Example requirements specification
Example requirements specificationExample requirements specification
Example requirements specification
indrisrozas
 
oracle project accounting | best oracle project accounting training
oracle project accounting | best oracle project accounting trainingoracle project accounting | best oracle project accounting training
oracle project accounting | best oracle project accounting training
OnlineOracleTrainings
 
Khoá Luận Tốt Nghiệp Nâng Cao Hiệu Quả Hoạt Động Kinh Doanh Của Công Ty Cổ Ph...
Khoá Luận Tốt Nghiệp Nâng Cao Hiệu Quả Hoạt Động Kinh Doanh Của Công Ty Cổ Ph...Khoá Luận Tốt Nghiệp Nâng Cao Hiệu Quả Hoạt Động Kinh Doanh Của Công Ty Cổ Ph...
Khoá Luận Tốt Nghiệp Nâng Cao Hiệu Quả Hoạt Động Kinh Doanh Của Công Ty Cổ Ph...
Dịch vụ viết bài trọn gói ZALO: 0936 885 877
 
Ame how to diagnose issues with the default approver list in purchasing when ...
Ame how to diagnose issues with the default approver list in purchasing when ...Ame how to diagnose issues with the default approver list in purchasing when ...
Ame how to diagnose issues with the default approver list in purchasing when ...
Abdul Rahman Fouad Thabit
 
Oracle Forms :Window and Canvases
Oracle Forms :Window and CanvasesOracle Forms :Window and Canvases
Oracle Forms :Window and Canvases
Sekhar Byna
 
Oracle Cloud Human Capital Management Table Structure
Oracle Cloud Human Capital Management Table Structure Oracle Cloud Human Capital Management Table Structure
Oracle Cloud Human Capital Management Table Structure
AssaduzzamanSarker
 
Oaf personalization examples
Oaf personalization examplesOaf personalization examples
Oaf personalization examples
Madhurima Chatterjee
 
NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU
NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU
NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU
nataliej4
 
Oracle Payables R12 ivas
Oracle Payables R12 ivasOracle Payables R12 ivas
Oracle Payables R12 ivas
Ali Ibrahim
 
OEBS R12 Presentation.ppt
OEBS R12 Presentation.pptOEBS R12 Presentation.ppt
OEBS R12 Presentation.ppt
Mohd Haireeen
 
Xây dựng phần mềm quản lý thông tin nhân sự trường Đại học Dân lập Hải Phòng
Xây dựng phần mềm quản lý thông tin nhân sự trường Đại học Dân lập Hải PhòngXây dựng phần mềm quản lý thông tin nhân sự trường Đại học Dân lập Hải Phòng
Xây dựng phần mềm quản lý thông tin nhân sự trường Đại học Dân lập Hải Phòng
hieu anh
 
Oracle Forms : Validation Triggers
Oracle Forms : Validation TriggersOracle Forms : Validation Triggers
Oracle Forms : Validation Triggers
Sekhar Byna
 
Quy trình kiểm toán các khoản phải thu trong kiểm toán báo cáo tài chính tại ...
Quy trình kiểm toán các khoản phải thu trong kiểm toán báo cáo tài chính tại ...Quy trình kiểm toán các khoản phải thu trong kiểm toán báo cáo tài chính tại ...
Quy trình kiểm toán các khoản phải thu trong kiểm toán báo cáo tài chính tại ...
luanvantrust
 
Phân tích và thiết kế hệ thống quản lý bán hàng
Phân tích và thiết kế hệ thống quản lý bán hàngPhân tích và thiết kế hệ thống quản lý bán hàng
Phân tích và thiết kế hệ thống quản lý bán hàng
leemindinh
 
Thực tập kiểm thử phần mềm
Thực tập kiểm thử phần mềmThực tập kiểm thử phần mềm
Thực tập kiểm thử phần mềm
Nguyễn Anh
 
Oracle Framework Personalization
Oracle Framework PersonalizationOracle Framework Personalization
Oracle Framework Personalization
Edi Yanto
 
Md050 application extensions_functional_design_080112
Md050 application extensions_functional_design_080112Md050 application extensions_functional_design_080112
Md050 application extensions_functional_design_080112
magik570
 
Oracle fusion hrms_for_uae_hr_setup_white_paper_rel11
Oracle fusion hrms_for_uae_hr_setup_white_paper_rel11Oracle fusion hrms_for_uae_hr_setup_white_paper_rel11
Oracle fusion hrms_for_uae_hr_setup_white_paper_rel11
Feras Ahmad
 
Example requirements specification
Example requirements specificationExample requirements specification
Example requirements specification
indrisrozas
 
oracle project accounting | best oracle project accounting training
oracle project accounting | best oracle project accounting trainingoracle project accounting | best oracle project accounting training
oracle project accounting | best oracle project accounting training
OnlineOracleTrainings
 
Ame how to diagnose issues with the default approver list in purchasing when ...
Ame how to diagnose issues with the default approver list in purchasing when ...Ame how to diagnose issues with the default approver list in purchasing when ...
Ame how to diagnose issues with the default approver list in purchasing when ...
Abdul Rahman Fouad Thabit
 
Oracle Forms :Window and Canvases
Oracle Forms :Window and CanvasesOracle Forms :Window and Canvases
Oracle Forms :Window and Canvases
Sekhar Byna
 
Oracle Cloud Human Capital Management Table Structure
Oracle Cloud Human Capital Management Table Structure Oracle Cloud Human Capital Management Table Structure
Oracle Cloud Human Capital Management Table Structure
AssaduzzamanSarker
 
NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU
NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU
NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU
nataliej4
 
Oracle Payables R12 ivas
Oracle Payables R12 ivasOracle Payables R12 ivas
Oracle Payables R12 ivas
Ali Ibrahim
 
OEBS R12 Presentation.ppt
OEBS R12 Presentation.pptOEBS R12 Presentation.ppt
OEBS R12 Presentation.ppt
Mohd Haireeen
 
Xây dựng phần mềm quản lý thông tin nhân sự trường Đại học Dân lập Hải Phòng
Xây dựng phần mềm quản lý thông tin nhân sự trường Đại học Dân lập Hải PhòngXây dựng phần mềm quản lý thông tin nhân sự trường Đại học Dân lập Hải Phòng
Xây dựng phần mềm quản lý thông tin nhân sự trường Đại học Dân lập Hải Phòng
hieu anh
 
Oracle Forms : Validation Triggers
Oracle Forms : Validation TriggersOracle Forms : Validation Triggers
Oracle Forms : Validation Triggers
Sekhar Byna
 

Viewers also liked (20)

Oracle ِApplication Development Framework (ADF)
Oracle ِApplication Development Framework (ADF)Oracle ِApplication Development Framework (ADF)
Oracle ِApplication Development Framework (ADF)
ِAbdulla AlShourbagy
 
Spring3 발표자료 - 김연수
Spring3 발표자료 - 김연수Spring3 발표자료 - 김연수
Spring3 발표자료 - 김연수
Yeon Soo Kim
 
Spring@mvc웹호스팅
Spring@mvc웹호스팅Spring@mvc웹호스팅
Spring@mvc웹호스팅
J.H Ahn
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
ksain
 
Oracle application framework (oaf) online training
Oracle application framework (oaf) online trainingOracle application framework (oaf) online training
Oracle application framework (oaf) online training
Glory IT Technologies Pvt. Ltd.
 
세미나 Spring mybatis
세미나 Spring mybatis세미나 Spring mybatis
세미나 Spring mybatis
Somang Jeong
 
Spring framework 4.x
Spring framework 4.xSpring framework 4.x
Spring framework 4.x
Arawn Park
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
ymtech
 
스프링공부1
스프링공부1스프링공부1
스프링공부1
NaKaNaRa
 
스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용
스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용
스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용
Sungchul Park
 
스프링 코어 강의 3부 - 웹 애플리케이션 아키텍처
스프링 코어 강의 3부 - 웹 애플리케이션 아키텍처 스프링 코어 강의 3부 - 웹 애플리케이션 아키텍처
스프링 코어 강의 3부 - 웹 애플리케이션 아키텍처
Sungchul Park
 
Tdd live spring camp 2013
Tdd live spring camp 2013Tdd live spring camp 2013
Tdd live spring camp 2013
beom kyun choi
 
스프링 코어 강의 1부 - 봄 맞이 준비 운동
스프링 코어 강의 1부 - 봄 맞이 준비 운동스프링 코어 강의 1부 - 봄 맞이 준비 운동
스프링 코어 강의 1부 - 봄 맞이 준비 운동
Sungchul Park
 
스프링보다 중요한 스프링 이야기
스프링보다 중요한 스프링 이야기스프링보다 중요한 스프링 이야기
스프링보다 중요한 스프링 이야기
Sungchul Park
 
Spring 웹 프로젝트 시작하기
Spring 웹 프로젝트 시작하기Spring 웹 프로젝트 시작하기
Spring 웹 프로젝트 시작하기
jiseob kim
 
변경에 강한 애플리케이션, 유기적 애플리케이션
변경에 강한 애플리케이션, 유기적 애플리케이션변경에 강한 애플리케이션, 유기적 애플리케이션
변경에 강한 애플리케이션, 유기적 애플리케이션
Sungchul Park
 
keras 빨리 훑어보기(intro)
keras 빨리 훑어보기(intro)keras 빨리 훑어보기(intro)
keras 빨리 훑어보기(intro)
beom kyun choi
 
[오픈소스컨설팅]Docker on Kubernetes v1
[오픈소스컨설팅]Docker on Kubernetes v1[오픈소스컨설팅]Docker on Kubernetes v1
[오픈소스컨설팅]Docker on Kubernetes v1
Ji-Woong Choi
 
[오픈소스컨설팅]Spring MVC
[오픈소스컨설팅]Spring MVC [오픈소스컨설팅]Spring MVC
[오픈소스컨설팅]Spring MVC
Ji-Woong Choi
 
SpringCamp2013 Spring MVC TEST
SpringCamp2013 Spring MVC TEST SpringCamp2013 Spring MVC TEST
SpringCamp2013 Spring MVC TEST
YongEun Choi
 
Oracle ِApplication Development Framework (ADF)
Oracle ِApplication Development Framework (ADF)Oracle ِApplication Development Framework (ADF)
Oracle ِApplication Development Framework (ADF)
ِAbdulla AlShourbagy
 
Spring3 발표자료 - 김연수
Spring3 발표자료 - 김연수Spring3 발표자료 - 김연수
Spring3 발표자료 - 김연수
Yeon Soo Kim
 
Spring@mvc웹호스팅
Spring@mvc웹호스팅Spring@mvc웹호스팅
Spring@mvc웹호스팅
J.H Ahn
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
ksain
 
세미나 Spring mybatis
세미나 Spring mybatis세미나 Spring mybatis
세미나 Spring mybatis
Somang Jeong
 
Spring framework 4.x
Spring framework 4.xSpring framework 4.x
Spring framework 4.x
Arawn Park
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
ymtech
 
스프링공부1
스프링공부1스프링공부1
스프링공부1
NaKaNaRa
 
스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용
스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용
스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용
Sungchul Park
 
스프링 코어 강의 3부 - 웹 애플리케이션 아키텍처
스프링 코어 강의 3부 - 웹 애플리케이션 아키텍처 스프링 코어 강의 3부 - 웹 애플리케이션 아키텍처
스프링 코어 강의 3부 - 웹 애플리케이션 아키텍처
Sungchul Park
 
Tdd live spring camp 2013
Tdd live spring camp 2013Tdd live spring camp 2013
Tdd live spring camp 2013
beom kyun choi
 
스프링 코어 강의 1부 - 봄 맞이 준비 운동
스프링 코어 강의 1부 - 봄 맞이 준비 운동스프링 코어 강의 1부 - 봄 맞이 준비 운동
스프링 코어 강의 1부 - 봄 맞이 준비 운동
Sungchul Park
 
스프링보다 중요한 스프링 이야기
스프링보다 중요한 스프링 이야기스프링보다 중요한 스프링 이야기
스프링보다 중요한 스프링 이야기
Sungchul Park
 
Spring 웹 프로젝트 시작하기
Spring 웹 프로젝트 시작하기Spring 웹 프로젝트 시작하기
Spring 웹 프로젝트 시작하기
jiseob kim
 
변경에 강한 애플리케이션, 유기적 애플리케이션
변경에 강한 애플리케이션, 유기적 애플리케이션변경에 강한 애플리케이션, 유기적 애플리케이션
변경에 강한 애플리케이션, 유기적 애플리케이션
Sungchul Park
 
keras 빨리 훑어보기(intro)
keras 빨리 훑어보기(intro)keras 빨리 훑어보기(intro)
keras 빨리 훑어보기(intro)
beom kyun choi
 
[오픈소스컨설팅]Docker on Kubernetes v1
[오픈소스컨설팅]Docker on Kubernetes v1[오픈소스컨설팅]Docker on Kubernetes v1
[오픈소스컨설팅]Docker on Kubernetes v1
Ji-Woong Choi
 
[오픈소스컨설팅]Spring MVC
[오픈소스컨설팅]Spring MVC [오픈소스컨설팅]Spring MVC
[오픈소스컨설팅]Spring MVC
Ji-Woong Choi
 
SpringCamp2013 Spring MVC TEST
SpringCamp2013 Spring MVC TEST SpringCamp2013 Spring MVC TEST
SpringCamp2013 Spring MVC TEST
YongEun Choi
 
Ad

Similar to OAF Developer Guide 13.1.3 (20)

Odoo development
Odoo developmentOdoo development
Odoo development
Ramzi Hajjaji
 
E views 9 command ref
E views 9 command refE views 9 command ref
E views 9 command ref
Ibrahima Bakhoum
 
Xi3 ds administrators_guide_en
Xi3 ds administrators_guide_enXi3 ds administrators_guide_en
Xi3 ds administrators_guide_en
Sarat Reddy
 
SAP CPI-DS.pdf
SAP CPI-DS.pdfSAP CPI-DS.pdf
SAP CPI-DS.pdf
JagadishBabuParri
 
hci10_help_sap_en.pdf
hci10_help_sap_en.pdfhci10_help_sap_en.pdf
hci10_help_sap_en.pdf
JagadishBabuParri
 
SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_en
SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_enSAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_en
SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_en
Jim Miller, MBA
 
Oracle apps integration_cookbook
Oracle apps integration_cookbookOracle apps integration_cookbook
Oracle apps integration_cookbook
chaitanyanaredla
 
Mvc music store tutorial - v3.0
Mvc music store   tutorial - v3.0Mvc music store   tutorial - v3.0
Mvc music store tutorial - v3.0
mahmud467
 
Mvc music store tutorial - v3.0
Mvc music store   tutorial - v3.0Mvc music store   tutorial - v3.0
Mvc music store tutorial - v3.0
lookzlook
 
Mvc music store tutorial - v3.0 (1)
Mvc music store   tutorial - v3.0 (1)Mvc music store   tutorial - v3.0 (1)
Mvc music store tutorial - v3.0 (1)
novia80
 
Mvc music store tutorial - v3.0
Mvc music store   tutorial - v3.0Mvc music store   tutorial - v3.0
Mvc music store tutorial - v3.0
jackmilesdvo
 
Liferay administration-guide
Liferay administration-guideLiferay administration-guide
Liferay administration-guide
guest4094ec
 
2 x applicationserver
2 x applicationserver2 x applicationserver
2 x applicationserver
Teberite Ramos
 
Provisioning_Service.pdf
Provisioning_Service.pdfProvisioning_Service.pdf
Provisioning_Service.pdf
Jagadish Babu
 
E views 6 users guide i
E views 6 users guide iE views 6 users guide i
E views 6 users guide i
Adi Irawan
 
Administrator guide
Administrator guideAdministrator guide
Administrator guide
rturkman
 
X cart 430-manual
X cart 430-manualX cart 430-manual
X cart 430-manual
madtgw
 
Cake php cookbook
Cake php cookbookCake php cookbook
Cake php cookbook
Trùm Haivler
 
Managing Data Center Connectivity TechBook
Managing Data Center Connectivity TechBook Managing Data Center Connectivity TechBook
Managing Data Center Connectivity TechBook
EMC
 
BizTalk Practical Course Preview
BizTalk Practical Course PreviewBizTalk Practical Course Preview
BizTalk Practical Course Preview
MoustafaRefaat
 
Xi3 ds administrators_guide_en
Xi3 ds administrators_guide_enXi3 ds administrators_guide_en
Xi3 ds administrators_guide_en
Sarat Reddy
 
SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_en
SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_enSAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_en
SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_en
Jim Miller, MBA
 
Oracle apps integration_cookbook
Oracle apps integration_cookbookOracle apps integration_cookbook
Oracle apps integration_cookbook
chaitanyanaredla
 
Mvc music store tutorial - v3.0
Mvc music store   tutorial - v3.0Mvc music store   tutorial - v3.0
Mvc music store tutorial - v3.0
mahmud467
 
Mvc music store tutorial - v3.0
Mvc music store   tutorial - v3.0Mvc music store   tutorial - v3.0
Mvc music store tutorial - v3.0
lookzlook
 
Mvc music store tutorial - v3.0 (1)
Mvc music store   tutorial - v3.0 (1)Mvc music store   tutorial - v3.0 (1)
Mvc music store tutorial - v3.0 (1)
novia80
 
Mvc music store tutorial - v3.0
Mvc music store   tutorial - v3.0Mvc music store   tutorial - v3.0
Mvc music store tutorial - v3.0
jackmilesdvo
 
Liferay administration-guide
Liferay administration-guideLiferay administration-guide
Liferay administration-guide
guest4094ec
 
Provisioning_Service.pdf
Provisioning_Service.pdfProvisioning_Service.pdf
Provisioning_Service.pdf
Jagadish Babu
 
E views 6 users guide i
E views 6 users guide iE views 6 users guide i
E views 6 users guide i
Adi Irawan
 
Administrator guide
Administrator guideAdministrator guide
Administrator guide
rturkman
 
X cart 430-manual
X cart 430-manualX cart 430-manual
X cart 430-manual
madtgw
 
Managing Data Center Connectivity TechBook
Managing Data Center Connectivity TechBook Managing Data Center Connectivity TechBook
Managing Data Center Connectivity TechBook
EMC
 
BizTalk Practical Course Preview
BizTalk Practical Course PreviewBizTalk Practical Course Preview
BizTalk Practical Course Preview
MoustafaRefaat
 
Ad

Recently uploaded (20)

AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 

OAF Developer Guide 13.1.3

  • 1. Oracle Application Framework Developer's Guide Release 12.1.3 July 2010
  • 3. Table of Contents ORACLE APPLICATION FRAMEWORK DEVELOPER'S GUIDE, RELEASE 12.1.3.................................17 Preface .................................................................................................................................17 Oracle Application Framework Support Guidelines for Customers ................................20 CHAPTER 1: GETTING STARTED ..................................................................................................25 Introduction to OA Framework ...........................................................................................25 Setting Up Your Development Environment ......................................................................33 Customer, Consultant or Support Representative Using JDeveloper on Windows ............ 33 Customer, Consultant or Support Representative Using JDeveloper on Linux .................. 36 Building and Running 'Hello, World!' .................................................................................40 OA Framework Development Runtime Configuration.......................................................71 CHAPTER 2: OA FRAMEWORK ESSENTIALS .................................................................................75 JSP Application Primer .......................................................................................................75 Anatomy of an OA Framework Page ..................................................................................86 Page Basics ...................................................................................................................... 86 The Model ......................................................................................................................... 87 The View........................................................................................................................... 92 The Controller ................................................................................................................... 98 Web Bean Architecture ................................................................................................... 103 Guide to OA Framework Javadoc ................................................................................... 105 OA Framework State Management ...................................................................................109 Architectural Overview .................................................................................................... 109 Root Application Modules (Database Session and Transaction State) ............................ 110 Servlet Session ............................................................................................................... 115 3
  • 4. Oracle Application Framework Developer's Guide Oracle E-Business Suite User Session ........................................................................... 116 Page Context .................................................................................................................. 117 Request .......................................................................................................................... 120 State Persistence Model ('Passivation') .......................................................................... 122 Application Module Pooling ............................................................................................. 122 CHAPTER 3: BUILDING AN OA FRAMEWORK APPLICATION (THE BASICS) ....................................125 Implementing the Model....................................................................................................125 Designing Model Objects ................................................................................................ 125 Recommended Build Approach ...................................................................................... 127 Business Components Packages.................................................................................... 128 Entity Objects.................................................................................................................. 128 Entity Associations (Association Objects) ....................................................................... 135 View Objects and View Rows ......................................................................................... 138 View Links ...................................................................................................................... 147 Application Modules ........................................................................................................ 150 Entity Objects, Entity Experts, 'Validation' Application Modules and 'Validation' View Objects ........................................................................................................................... 165 Validation View Objects ............................................................................................... 165 Validation Application Modules (VAMs) ....................................................................... 165 Entity Experts .............................................................................................................. 166 Reusing Business Objects .............................................................................................. 167 Implementing the View ......................................................................................................169 Designing the User Interface........................................................................................... 169 Pages ............................................................................................................................. 170 Reusable Components ................................................................................................... 172 4
  • 5. Table of Contents Attribute Sets .................................................................................................................. 176 URL Parameters: Tokens, Encryption, Encoding ............................................................ 180 Style Sheets ................................................................................................................... 182 Accessibility .................................................................................................................... 183 Internationalization .......................................................................................................... 183 Model Interaction ............................................................................................................ 184 Menus and Page Security ............................................................................................... 191 Implementing the Controller .............................................................................................196 Designing an OA Controller ............................................................................................ 196 Creating an OA Controller ............................................................................................... 199 Handling an HTTP GET .................................................................................................. 202 Modifying Bean Properties .......................................................................................... 204 Creating Beans Programmatically ............................................................................... 206 Handling an HTTP POST (Form Submit) ........................................................................ 209 Model Interaction ............................................................................................................ 213 Disabling Validation ........................................................................................................ 218 Javascript ....................................................................................................................... 220 Error Handling ...................................................................................................................221 Creating Attribute Sets......................................................................................................239 Designing Attribute Sets ................................................................................................. 239 Creating Attribute Set Packages Manually ...................................................................... 240 Creating Attribute Sets Manually ..................................................................................... 240 Generating Attribute Sets Automatically (Only on Linux) ................................................. 240 Internationalization............................................................................................................246 5
  • 6. Oracle Application Framework Developer's Guide User Preferences ............................................................................................................ 246 Language........................................................................................................................ 247 Timezone ........................................................................................................................ 248 Client Character Encoding .............................................................................................. 249 Date and Time ................................................................................................................ 249 Numbers/Currency .......................................................................................................... 252 Text and Component Alignment ...................................................................................... 255 Localized Layouts ........................................................................................................... 256 Calendar Support............................................................................................................ 256 Character Encoding of BC4J XML Files .......................................................................... 258 Files in a Typical OA Framework Application..................................................................259 CHAPTER 4: IMPLEMENTING SPECIFIC UI FEATURES ..................................................................263 Accelerator Keys ('Hot Keys') ...........................................................................................263 Attachments .......................................................................................................................266 Auto-Repeating Layout (ARL) ...........................................................................................300 BI Publisher Integration - Printing A Report From Within an OA Framework Page ......305 Bound Values ....................................................................................................................307 Branding.............................................................................................................................318 Bulleted List .......................................................................................................................325 Buttons (Action/Navigation) .............................................................................................329 Buttons (Global) ................................................................................................................342 Charts and Graphs ............................................................................................................352 Component-Level Function Security (Dynamic User Interface) .....................................381 Concurrent Processing: Request Submission and Monitoring......................................409 6
  • 7. Table of Contents Content Containers ...........................................................................................................416 Contextual Information .....................................................................................................420 Controlling UIX Rendering Output ...................................................................................423 Custom HTML ....................................................................................................................427 Daily Business Intelligence / OA Framework Integration ...............................................431 Data Export ........................................................................................................................436 Date Picker .........................................................................................................................443 Declarative Page Flow .......................................................................................................449 Dialog Pages ......................................................................................................................465 Dynamic User Interface .....................................................................................................381 File Upload and Download ................................................................................................470 Flexfields ............................................................................................................................475 Forms / OA Framework Page Integration.........................................................................508 Headers and Subheaders ..................................................................................................512 HGrid ..................................................................................................................................520 Hide/Show ..........................................................................................................................539 Images in Your Pages .......................................................................................................551 Include Content (URL and Servlet) ...................................................................................560 Inline Messaging, Tips, Hints and Bubble Text ...............................................................563 Instruction Text..................................................................................................................569 Links ...................................................................................................................................572 List of Values (LOV) ..........................................................................................................576 Locator Element: Breadcrumbs .......................................................................................606 Locator Element: Page/Record Navigation......................................................................620 7
  • 8. Oracle Application Framework Developer's Guide Locator Element: Train......................................................................................................632 Message Box .....................................................................................................................637 Mobile Applications...........................................................................................................642 Notifications (Workflow Worklist).....................................................................................643 Page Access Tracking.......................................................................................................647 Page Contents Bottom Line (the 'Ski') .............................................................................650 Page Footer........................................................................................................................652 Page Layout (How to Place Content) ...............................................................................655 Page Security .....................................................................................................................676 Page Stamps ......................................................................................................................686 Partial Page Rendering (Dynamic User Interface) ...........................................................381 Personalizable Pages ........................................................................................................691 Creating a Configurable Page ......................................................................................... 691 Creating an End-User Personalizable Page .................................................................... 708 Developer Information for Admin-Level Personalizations ................................................ 709 OA Framework Personalization Caveats......................................................................... 713 Pop-Ups .............................................................................................................................714 Portlets ...............................................................................................................................721 Printable Page ...................................................................................................................730 Processing Page................................................................................................................733 Quick Links ........................................................................................................................739 Record History ...................................................................................................................742 Related Links / Shortcuts..................................................................................................748 Rich Content Container.....................................................................................................751 8
  • 9. Table of Contents Rich Text Editor .................................................................................................................757 Save Model ('Warn About Changes') ................................................................................770 Separator Line ...................................................................................................................775 Search ................................................................................................................................777 Shuttle ................................................................................................................................837 Standard Web Widgets......................................................................................................844 Submitting the Form..........................................................................................................862 SubTab Navigation ............................................................................................................870 Switchers (Application and Context) ...............................................................................878 Tables - Advanced .............................................................................................................882 Tables - Classic .................................................................................................................947 Tabs / Navigation .............................................................................................................1009 Tree...................................................................................................................................1030 CHAPTER 5: IMPLEMENTING SERVER-SIDE FEATURES ..............................................................1045 Java Entity Objects .........................................................................................................1045 Create ............................................................................................................................1046 Update / Validate ...........................................................................................................1059 Delete ............................................................................................................................1068 Lock ...............................................................................................................................1072 Rollback .........................................................................................................................1074 Transaction Undo ..........................................................................................................1077 Object Version Number Column.....................................................................................1080 Standard WHO Columns ...............................................................................................1084 Error Handling................................................................................................................1084 9
  • 10. Oracle Application Framework Developer's Guide Entity Experts, Validation Applications Modules and Validation View Objects ................1084 Calling PL/SQL Functions and Procedures ....................................................................1087 Entity Objects for Translatable (_TL) Tables ..................................................................1089 Standard Validation Patterns and Examples ..................................................................1091 PL/SQL Entity Object Design and Development ...........................................................1097 Create ............................................................................................................................1098 Insert .............................................................................................................................1100 Lock ...............................................................................................................................1102 Update / Validate ...........................................................................................................1105 Delete ............................................................................................................................1107 Rollback .........................................................................................................................1110 WHO Column Support ...................................................................................................1110 Error Handling................................................................................................................1110 PL/SQL Entity Objects for _TL Tables ...........................................................................1111 Business Service Objects ...............................................................................................1112 Business Service Objects Architecture...........................................................................1112 Business Service Objects in Detail.................................................................................1121 Developing Services ......................................................................................................1134 Methods in Detail ..........................................................................................................1176 Testing Services ............................................................................................................1191 Deploying Services ........................................................................................................1206 Using Services ...............................................................................................................1207 Service FAQ ..................................................................................................................1227 Oracle Application Web Services ...................................................................................1229 10
  • 11. Table of Contents RESTful Service Interface ...............................................................................................1233 View Objects in Detail .....................................................................................................1246 Application Modules in Detail .........................................................................................1273 Entity Object and View Object Attribute Setters ...........................................................1281 CHAPTER 6: ADVANCED OA FRAMEWORK DEVELOPMENT TOPICS ............................................1291 Supporting the Browser Back Button ............................................................................1291 Browser Back Button Support Use Cases .....................................................................1316 OA Framework State Persistence Model (Passivation) ................................................1372 Advanced Java Entity Object Development Topics ......................................................1403 Controlling UIX Rendering Output .................................................................................1417 OA Framework and AOL/J Caching ...............................................................................1421 Application Module and Connection Pooling ................................................................1422 Advanced View Object Development Topics .................................................................1440 JTT/OA Framework Interoperability ...............................................................................1463 Cross-Site Scripting ........................................................................................................1470 Accelerated Validation ....................................................................................................1473 CHAPTER 7: TESTING AND DEBUGGING ...................................................................................1489 Discovering Page, Technology Stack and Session Information ..................................1489 Inspecting the MDS Repository Content........................................................................1500 Debugging OA Framework Applications .......................................................................1509 JDeveloper Debugging ..................................................................................................1509 Remote Debugging w/ Apache Installation.....................................................................1511 Remote Debugging w/ Quik Apache ..............................................................................1513 Examining Page Content ...............................................................................................1513 11
  • 12. Oracle Application Framework Developer's Guide Examining the Validation Failure Message Log Output ..................................................1514 Logging ............................................................................................................................1517 Testing .............................................................................................................................1523 Running in 'Test' Modes .................................................................................................1523 Using the Business Component Browser (BC4J Tester) ................................................1533 Verifying HTML Page Size .............................................................................................1534 Verifying SQL Performance (Enabling a Database Trace) .............................................1535 Monitoring the Application Monitor / JDBC Connection Pools ........................................1536 Running Oracle Accessibility Checker (OAC).................................................................1536 CHAPTER 8: STANDARDS AND GUIDELINES ..............................................................................1537 Oracle E-Business Suite Java Coding Standards .........................................................1537 OA Framework File Standards (Naming, Package Structure and Standard Content).1544 OA Framework Model Coding Standards ......................................................................1570 OA Framework View Coding Standards.........................................................................1594 OA Framework Controller Coding Standards ................................................................1608 CHAPTER 9: EXTENDING AND DEPLOYING OA FRAMEWORK APPLICATIONS ..............................1621 Extending OA Framework Applications .........................................................................1621 Deploying Customer Extensions ....................................................................................1632 Deploying Personalizations ............................................................................................1640 CHAPTER 10: INTEGRATING WITH OTHER PRODUCTS ...............................................................1655 Portlets ...............................................................................................................................721 Integrating with Oracle ADF............................................................................................1655 Embedding OBIEE Analytics in an OA Framework Page .............................................1656 BI Publisher Integration - Printing A Report From Within an OA Framework Page ......305 12
  • 13. Table of Contents JTT/OA Framework Interoperability ...............................................................................1463 Forms / OA Framework Page Integration.........................................................................508 APPENDICES ..........................................................................................................................1657 Summary of OA Component Properties ........................................................................1657 Oracle Application Framework Profile Options .............................................................1658 OA Framework ToolBox Technical Reference Manual (TRM) ......................................1688 OA Framework Development Frequently Asked Questions (FAQ) ..............................1698 OA Framework Known Key Issues Release 12..............................................................1699 Oracle Application Framework Troubleshooting ..........................................................1708 Oracle Application Framework URL Parameters...........................................................1709 Oracle Application Framework Extensible Regions......................................................1715 Oracle Application Framework: JDeveloper 9.0.3 IDE vs JDeveloper 10.1.3 IDE ........1716 Sample Code....................................................................................................................1725 GLOSSARY .............................................................................................................................1731 13
  • 15. 15
  • 16. Oracle Application Framework Developer's Guide 16
  • 17. Oracle Application Framework Developer's Guide, Release 12.1.3 Oracle Application Framework Developer's Guide, Release 12.1.3 Preface This manual describes how to set up your development environment, build, test and deploy Oracle E-Business Suite OA Framework applications. It also includes the coding standards followed by the Oracle E-Business Suite development staff, instructions for creating pages that comply with the Oracle Browser Look and Feel (BLAF) UI Guidelines, and information on extending the products shipped by Oracle E-Business Suite development. Note: Some of the screenshots used in this Guide were captured using Release 11.5.10 which displayed the BLAF Look-and-Feel. Although the colors and interface elements of these images have the 11.5.10 appearance, the functionality that they illustrate also applies for Release 12 (and the Oracle Look-and-Feel). Contents • Audience • Related Publications • Typographic Conventions • Send Us Your Comments Audience This documentation is written for the application developer and assumes familiarity with Java and SQL. Related Publications Additional Oracle JDeveloper 10g helpsets that apply to OA Framework application development include: • OA Framework ToolBox Tutorial • OA Component Reference • Getting Started with the OA Extension • Getting Started with JDeveloper • Developing Business Components As an application designer, you should also be familiar with the Oracle Browser Look and Feel (BLAF) UI Guidelines and the documentation for the Oracle 10g Database. For a full list of documentation resources for the Oracle E-Business Suite Release 12, see Oracle E-Business Suite Documentation Resources, Release 12, OracleMetaLink Document 394692.1. 17
  • 18. Oracle Application Framework Developer's Guide Typographic Conventions This manual uses the following typographic conventions to distinguish important elements from the body of the manual. Command and Example Syntax Commands and examples appear in a monotype font, as follows: Syntax: OAPageContext.getParameter("<parameterName>"); Example: /* ** Creates a SupplierEOImpl entity object and a corresponding row in the SuppliersVO. */ public void createSupplier() { OAViewObject vo = getSuppliersVO(); vo.insertRow(vo.createRow()); } Command and example syntax adhere to the following conventions: Convention Explanation plain monotype Used for code fragments and examples. < Italic monotype in Indicates developer-supplied values. angle brackets > ... An ellipsis indicates that the actual code extends beyond the example shown. /* A C-style comment. */ /** A Javadoc comment. */ // A Java comment. Indentation Oracle standard indentation helps to show code structure. Send Us Your Comments 18
  • 19. Oracle Application Framework Developer's Guide, Release 12.1.3 Oracle Corporation welcomes your comments and suggestions on the quality and usefulness of this manual. Your input is an important part of the information used for revisions. • Did you find any errors? • Is the information clearly presented? • Do you need more information? If so, where? • Are the examples correct? Do you need more examples? • What features did you like most? If you find any errors or have any other suggestions for improvement, please indicate the document title, and the chapter, section, and page number (if available). You can send comments to us in the following ways: • Electronic mail: [email protected] • FAX: (650) 506-7200 Attn: Oracle E-Business Suite Documentation Manager • Postal service: Oracle Corporation Oracle E-Business Suite Documentation Manager 500 Oracle Parkway Redwood Shores, CA 94065 USA If you would like a reply, please give your name, address, telephone number, and (optionally) electronic mail address. If you have problems with the software, please contact your local Oracle Support Services. 19
  • 20. Oracle Application Framework Developer's Guide Oracle Application Framework Support Guidelines for Customers Overview The Oracle Application Framework Developer's Guide documents the extensive set of features and capabilities made available by the Oracle Application Framework. The information included in this book is intended to provide our customers with a complete understanding of the technology, tools, and standards upon which OA Framework based applications in the E- Business Suite are built. With Release 12, we now provide customers with tools to perform certain types of customizations to OA Framework based applications that were not available with prior releases. In reviewing the capabilities and methods presented in this document, it is very important that you take into consideration that the type of resources available to support your work, depend upon the extent and type of customization that you are planning to perform. This document is intended to provide guidelines to customers regarding what support options will be available, primarily for customizations with OA Framework Release 12. We expect that this document will be updated with additional information and details on an ongoing basis. The most current version of this document is published in My Oracle Support Note 395441.1. Before starting any customization work, it is essential that you review the latest version of this document. Contents • Understanding the Support Options Available • Important Limitations and Guidelines Understanding the Available Support Options Release 12 of the Oracle Application Framework (OA Framework) provides significant new capabilities to perform personalizations, and extend OA Framework based web applications, in a variety of ways. For a full description of available options, please refer to the Customization Primer in the Oracle Applications Framework Personalization Guide. In this note, the use of the term customizations collectively refers to those capabilities. The objective of this note is to assist Oracle E-Business Suite customers with understanding the level of support provided for the different types of customizations possible, including alternative resources that are available for certain types of work, which fall beyond the scope of standard support processes that customers may already be familiar with. Personalizations Personalizations performed within the scope of the OA Personalization Framework are a fully supported means of customizing OA Framework based applications. 20
  • 21. Oracle Application Framework Developer's Guide, Release 12.1.3 Due to its declarative nature and durable architecture, the OA Personalization Framework continues to be recommended as the primary means for customizing OA Framework based applications. The supported capabilities, methods and tools for performing personalizations are documented in the Oracle Application Framework Personalization Guide. The most current version of this Personalization guide is published in the Oracle E-Business Suite Documentation Library, which is supplied on a physical CD in the Oracle E-Business Suite Release 12 software bundle. This document may also be obtained in hard copy format from the Oracle Store. Access the latest content from the Oracle E-Business Suite Online Documentation CD. Methods or capabilities that not detailed in the Oracle Application Framework Personalization Guide, fall beyond the scope of the OA Personalization Framework, and are not supported for Oracle E-Business Suite installations. Customers leveraging the capabilities of the OA Personalization Framework must ensure their Release 12 instance is kept current with the latest OA Framework patchset applied. When reporting issues against Personalization, Oracle Support will as a first step, require you to check and confirm you have applied the most current patchset to ensure that the latest fixes for known issues have been applied to your instance. You can find more information about the current patchset, if available, including known issues addressed in that patchset by referring to the Oracle Application Framework Documentation Resources, Release 12 (Metalink Note 391554.1). Extensions Release 12 of the OA Framework and the accompanying Oracle 10g JDeveloper release provide features for developing a new class of Oracle applications extensions not available to customers in prior releases. Assistance with customer-developed extensions is available via the following resources: • Oracle Application Framework Developer's Guide The Developer's Guide fully documents the capabilities of the Framework including instructions, examples and essential standards for implementing business-tier objects, UI components and server-side features. Specifically, Chapter 9 of the Developer's Guide under the section Extending OA Framework Applications, provides instructions on how to extend OA Framework based applications with custom business logic, including detailed guidelines for BC4J code extensions. • Oracle Application Framework ToolBox Tutorial Application The ToolBox Tutorial application is a sample application accompanied by extensive examples with step-by-step instructions that demonstrate the usage of business objects and UI components to build OA Framework based application pages, against a simple Purchase Order type application schema, installed on your Release 12 instance. The ToolBox includes a specific tutorial lab on Extending OA Framework Applications. • OA Framework Javadoc Documents all core Oracle Application Framework packages and classes, including UIX and BC4J objects extended by the Framework. • OA Framework Discussion Forum on the Oracle Technology Network OTN (http://otn.oracle.com) hosts a discussion forum for OA Framework Extensions and the OA Extension to Oracle JDeveloper 10g. Navigate to OTN Forums 21
  • 22. Oracle Application Framework Developer's Guide under the E-Business Suite (http://forums.oracle.com/forums/index.jsp?cat=3). You can use the forum to post questions and exchange information with other customers on the OTN community working on extensions. The OA Framework Development team and Oracle Support will monitor and participate in some of the discussion threads on this forum. Additionally, you may also consider participating in the OTN JDeveloper forum for usage questions concerning Oracle JDeveloper 10g. • Oracle E-Business Suite Product Documentation Some products may provide additional information on extending application specific business objects and functionality. Consult My Oracle Support (http://support.oracle.com) under the respective product for more information. For issues logged with Oracle Support to address questions concerning OA Framework based extensions or usage of the OA Extension tool, Oracle Support will evaluate the nature of the question, and in most cases refer the customer to one or more of the resources outlined above. Important Limitations and Guidelines Before starting work on any customizations, it is essential that customers be aware of the following limitations and guidelines: • Customers who intend to work with Oracle JDeveloper 10g OA Extension, and develop extensions to their installed OA Framework-based self-service applications must use the specific build of the Oracle JDeveloper 10g that corresponds to the OA Framework Release 12 installed in their runtime environment. Please consult the corresponding "About Oracle E-Business Suite Technology Update" document for the JDeveloper ARU that corresponds to the Release 12 ATG patchset you install. • Oracle does not provide access to Java source code for OA Framework or products. You should consider the Developer's guide and available Javadoc for the classes you are working with as the only documented sources of information available to determine the characteristics of the object you are extending. • Design-time options and expected run-time behavior of OA Framework components are fully documented in the Developer's Guide and Javadoc mentioned above. • In order to log issues with Oracle Support concerning components, such as unexpected run-time behavior of a component, customers will be required to provide a simple reproducible test case written against the OA Framework ToolBox Tutorial schema or an E-Business Suite product schema. The test case must not rely on any custom schema elements or custom class libraries, and must be runnable by Oracle Support without any custom dependencies. • Oracle does not recommend that customers extend controller objects associated with regions or web beans in shipped E-Business Suite product pages. Controller class (oracle.apps.fnd.framework.webui.OAControllerImpl) methods should effectively be considered private, since their implementation is subject to change. Controller extensions are therefore not considered to be durable between upgrades. If it is absolutely essential to handle custom form submit events on a shipped product page, 22
  • 23. Oracle Application Framework Developer's Guide, Release 12.1.3 processFormRequest() is the only method that should be overriden in a controller class, although the risks outlined above still apply. • Customers are fully responsible for all custom code written to support customer- developed extensions. Oracle Support and E-Business Suite development will not review custom code. Questions such as those relating to design, and usage of components to develop extensions, will generally be redirected to the OTN forums mentioned above. • To facilitate transparent upgrades and new feature uptake, custom code must comply with the Oracle E-Business Suite OA Framework coding standards described in Chapter 8 of the OA Framework Developer's Guide. Note: Information about the forthcoming passivation feature is provided throughout the Developer's Guide (including the coding standards) for preview/planning purposes only; passivation is not supported in Release 12. • Customers planning to undertake advanced or complex extension projects may consider engaging services available from Oracle Consulting or Oracle Partner resources. Oracle Consulting and Partner organizations offer an alternative means of support through consulting resources who have been specially trained or certified on OA Framework and Oracle E-Business Suite technology. For more information on what options are available, please refer to the information under Oracle Consulting Services (http://www.oracle.com/consulting) and the Oracle Partner Network (http://www.oracle.com/webapps/opus/pages/SimpleSearch.jsp). 23
  • 24. Oracle Application Framework Developer's Guide 24
  • 25. Oracle Application Framework Developer's Guide, Release 12.1.3 Chapter 1: Getting Started Introduction to OA Framework This document provides an overview of OA Framework and discusses: • Architecture • Key features • Summary Overview Oracle Application Framework (OA Framework) is the Oracle E-Business Suite development and deployment platform for HTML-based business applications. OA Framework consists of a set of middle-tier runtime services and a design-time extension to Oracle JDeveloper called Oracle E-Business Suite Extension (OA Extension). During the first few years after the Internet evolution, the software industry witnessed an influx of rapidly changing technologies. These technologies matured, yet there are still a myriad of low-level and complex technologies that are hard to learn and implement. Under these circumstances, OA Framework has emerged as an integrated platform for developing and deploying Oracle E-Business Suite HTML-based applications, leveraging technological advances without taking on associated complexity. Since its inception, OA Framework embraces the following principles: End User Productivity The shift from client-server to multi-tier deployments comes with many cost savings, but not without compromise. HTML-based applications started out very much like old mainframe terminals; actions on the client side resulted in a round trip to the middle tier. Over time, user interface interactivity improved. OA Framework has always kept user interface interactivity a top priority with features such as partial page rendering (PPR), hot keys, smart choice lists and auto-completion of fields with lists of values. In addition, Oracle focuses a wealth of resources and expertise on user behavior and psychology, to develop a set of user interface layout and interaction standards, commonly known as the BLAF (Browser-Look-And- Feel) guidelines. BLAF is the default look and feel that all OA Framework applications assume, but can be personalized in many ways to meet customer branding and style requirements. OA Framework's implementation of BLAF standards yields a consistent user experience and further enhances user productivity. Enterprise-Grade Performance and Scalability OA Framework has aggressive performance and scalability targets. Most Oracle E-Business Suite application pages have sub-second response times to most user interactions. It takes a bit longer the first time a page is accessed within the same Java Virtual Machine, but thereafter, most of the commonly needed information (such as user information) is cached in the middle 25
  • 26. Oracle Application Framework Developer's Guide tier, allowing faster response. Resources are conserved through a number of resource pooling mechanisms and the swapping of idle resource data between memory and database. Developer Productivity OA Framework is designed around the simple Model-View-Controller (MVC) architecture. To shield application developers from costs associated with the rapidly changing technological landscape, Oracle has adopted a declarative flavor of the MVC architecture. Key building blocks of an application are defined in a descriptive manner using a simple JDeveloper user interface and then saved in an industry standard XML format. Oracle extends access and benefits of the OA Framework development environment to all Oracle E-Business Suite customers and partners. Customers and partners can leverage the proven OA Framework technology to add extensions to their Oracle E-Business Suite applications. Application Customizability Oracle is able to exploit its twenty plus years of experience in building and deploying business applications, to architect OA Framework with durable and economical customizations. Oracle has kept that goal in focus and produced a very compelling solution with plenty of flexibility to tailor the user interface (look-and-feel) and business logic. Thanks to the declarative and object oriented nature of OA Framework, application personalization and extensibility is readily available at a fraction of the industry startup cost and at a very minimal maintenance cost, if any. Open Standards Oracle continues to be a champion of industry standards and an active participant in the development of several emerging standards. OA Framework technologies have driven several industry standards and have adopted several others as they were published. Several Oracle technology architects are active members on a number of standards drafting committees. OA Framework is J2EE based and features several industry standards such as XML, HTML, Java, JSP, SQL and Web Services. Architecture OA Framework is based on the industry-standard J2EE MVC design pattern. Developers manipulate the application's metadata using Oracle JDeveloper OA Extension, while OA Framework uses the most efficient manner to execute the application. The MVC architecture is a component-based design pattern with clean interfaces between the Model, View, and Controller. The Model is where the application implements its business logic. The View is where the application implements its user interface and the Controller is where the application handles user interaction and directs business flow. Figure 1: OA Framework MVC architecture. 26
  • 27. Oracle Application Framework Developer's Guide, Release 12.1.3 OA Extension offers the following design time tools: • UML tools to model and generate business logic. • Guided user interface (and visual editors in a future release) to lay out client user interfaces. • Code generation for Controller classes. The OA Framework Model is implemented using Oracle Business Components for Java (BC4J). BC4J provides optimized, ready-to-use implementations of the J2EE design patterns that developers otherwise would have to code, debug, and test by hand. By leveraging BC4J's combination of tested code and productivity tools inside the Oracle JDeveloper IDE, development teams can focus immediately and only, on writing business logic and user interfaces instead of on designing, coding, and debugging handcrafted application "plumbing" code. OA Framework View is implemented using UI XML (UIX). UIX uses XML to describe the components and hierarchy that make up an application page. UIX also provides runtime 27
  • 28. Oracle Application Framework Developer's Guide capabilities to translate that metadata into HTML output so that it can be shown on a Browser or a mobile device. The metadata used to describe the UI is loaded into a database repository, called Meta Data Services (MDS), at deployment time and optionally at design time as well. The OA Controller, which is a pure Java class implementation, handles user and application- driven interactions. Simple page flows (such as a 2-step transaction) are implemented directly into the Controller object; others are implemented using Oracle Workflow. In a future release, business flows will be implemented in a declarative manner similar to that used to define model and view objects. Key Features This section the following key features of OA Framework: • Integrated development environment • Durable personalizations and extensions • Consistent and compelling user interface • User interface interactivity • Object oriented reuse • Oracle portal interoperability • Built-in security • Deployment environment Integrated Development Environment Oracle JDeveloper with OA Extension (OA Extension) is a world-class J2EE-based integrated development environment. Oracle customers and third party consultants have access to the same tools used by Oracle E-Business Suite developers to build complementary applications as well as extend the Oracle E-Business Suite applications. OA Extension provides features such as easy-to-use wizards, a hierarchy navigator, and a property sheet. These features enable developers to populate the metadata for declarative application business logic and user interfaces. JDeveloper offers a wealth of productivity tools such as the UML modeler, code coach, integrated debugger, local testing environment and documentation generator. With the OA Extension software comes a wealth of documentation and learning aids including a Developer's Guide, Javadoc, Online Help, a Sample Library and a rich set of Tutorials. Durable Personalizations and Extensions Personalization is about declaratively tailoring the UI look-and-feel, layout or visibility of page content to suit a business need or a user preference. Examples of personalization include: • Tailoring the color scheme of the UI. • Tailoring the order in which table columns are displayed. • Tailoring a query result Extensibility is about extending the functionality of an application beyond what can be done through personalization. Examples of extensibility include: 28
  • 29. Oracle Application Framework Developer's Guide, Release 12.1.3 • Adding new functional flows. • Extending or overriding existing functional flows. • Extending or overriding existing business logic. OA Framework is designed with durable personalization and extensibility capabilities, achieved through the declarative architecture and the underlying object oriented implementation. Declarative UI component definitions are stored in the form of metadata in a database repository. Personalizations are translated into offsets from the base metadata definition and stored separately. At runtime, all applicable personalization metadata is loaded from the repository and layered over the base metadata definition to produce the net effect. Product upgrades and patching only affect the base metadata definition so that customer personalizations are preserved and continue to function properly. Personalizations can be implemented at several levels by one of three authors: application developer, application administrator and end user. An end-user can create a personalization to be applied to specific user interface components that is only visible in the context of that authoring user. For example, an end user may save an employee search result sorted by manager and hide the employee's date of birth column. Once this personalized view is saved under a given name, the user can retrieve that view again in the future by that name. Application administrators and application developers have the flexibility to tailor the user experience at several levels. They can author personalizations that affect all users, users of a particular locale, users of a particular organization, users with a particular role and in the context of a particular function. Several levels can apply at the same time with a predetermined precedence order that yields a very personalized user experience. Using a combination of OA Extension wizards and built-in personalization screens, several user interface and business logic extensions are made possible at a minimal cost to development with little-to-no maintenance cost. In addition, Oracle E-Business Suite customers continue to enjoy the extensibility features offered by Oracle Flexfields, Oracle Workflow and Business Events. Consistent and Compelling User Interface OA Framework offers developers a wide range of user interface components that make the building of applications into a more assembly process, freeing developers from the repetitive composition of common user interface constructs. Moreover, OA Framework's declarative approach to building application user interfaces frees developers from the need to learn a vast array of changing technologies, while offering end users a consistent application look and experience. OA Framework user interface components range from simple widgets such as buttons and fields to compound components such as tables-in-tables and hierarchical grids. User Interface Interactivity OA Framework is always exploring the technology frontiers to enrich the interactivity of HTML- based user interfaces. Along those lines, OA Framework provides several features: 29
  • 30. Oracle Application Framework Developer's Guide Partial Page Rendering (PPR) PPR is a means by which designated parts of a page, rather than the whole page, is refreshed when the user performs certain actions. OA Framework supports PPR on actions such as: table record-set navigation, table sorting, table column totaling, adding a row to a table, row-level and cell-level detail disclosure, toggling the visibility of a Hide/Show component, populating a LOV, subtab navigation, Gantt chart refreshing and descriptive Flexfields context switching. Moreover, developers can declaratively enable PPR events on several components. For example, a developer can: • Configure the selection of a poplist to cause related fields to render, be updatable, be required or be disabled based on the selected value. • Configure the value change of a text field to set related field values (for example, if you set a Supplier value and tab to the next field, the dependent Supplier Site defaults automatically). • Configure the selection of a master table's record to automatically query and display related rows in a detail table. Accelerator (Hot) Keys OA Framework supports mnemonic accelerator keys for selected buttons and enables developers to assign numeric access keys to product specific user actions. Enhanced Save Model OA Framework provides a default implementation to warn users when they are about to lose changes such as when they click on a link that takes them outside the context of the current transaction. Developers can override the default behavior on a component-by-component basis. Smart Poplist OA Framework supports a personalizable hybrid between a static poplist and a searchable list of values. The poplist includes the most popular values a user uses to populate a particular attribute. The user can personalize the values that show up in the poplist by picking new values from a list of values. Moreover, the user can personalize the order in which values are listed in the poplist as well as remove less popular values. This feature is also referred to as a LOV Choicelist. LOV Auto Completion Lists of values (LOVs) are used when the list of possible values is long and the user may want to conduct a search before picking a value. In some business scenarios, especially with clerical jobs, the user uses a small set of values or may find it faster to type a partial value. If the user enters a partial value in a field that is associated with an LOV, OA Framework conducts a search before bringing up the LOV window. If the search leads to a unique record, OA Framework completes the rest of value for the unique record and saves the user from having to use the LOV window. Object Oriented Reuse 30
  • 31. Oracle Application Framework Developer's Guide, Release 12.1.3 OA Framework applications can be abstracted into a series of concentric layers, like an onion. The core layer represents the database and the surface layer represents the application pages. In between is a number of business logic and user interface layers. This layering allows for generic code and components to be implemented at the inner layers to maximize their reuse across the outer layers. For example, attribute validation is implemented at the Entity Object (a BC4J object-oriented representation of a database table in the middle tier) level. All application pages that provide the user with the ability to populate or update the value of the subject attribute would receive attribute validation for free through the underlying entity object. On the user-interface side, reusable components can be saved as shared regions in the metadata services (MDS) repository and reused across several pages. An administrator can choose to personalize the shared region such that the personalization impacts all instances of the same region across pages or personalize the shared region only in the context of the current page. Oracle Portal Interoperability OA Framework offers developers a simple approach to publishing OA Framework components (commonly known as regions) as Oracle Portal-compatible portlets. Oracle Portal provides you with a common, integrated starting point for accessing all your data. Since Oracle Portal lets you personalize the content and look of your page, you can also personalize the application region that is displayed as a portlet. Any personalizations you make to that portlet region appear only when you display that region from the same portlet. Built-in Security HTML-based applications offer great user and administrator convenience, but special care must be taken to ensure that these applications are secure. Developing HTML applications that are truly unbreakable is very difficult, historically requiring application developers to also be security experts. In fact, most application developers are not security experts, and they should not need 31
  • 32. Oracle Application Framework Developer's Guide to be. It is the responsibility of the application framework to ensure that HTML transactions are authorized, private, and free from tampering. OA Framework provides built in protection against known HTML hacking strategies, leaving the application developer free to concentrate on application functionality. Also, since UI components are defined in metadata rather than in code, the security protection offered by OA Framework can be advanced to keep up with the state of the art, without requiring applications to be rewritten. Deployment Environment OA Framework applications are deployed using standard Oracle 10g AS / Apache and Oracle10g Database servers. Application pages can be rendered on Internet Explorer 5.0 or above, Netscape 4.73 or above and Mozilla 1.5 or above. The data and middle tiers can be deployed on several platforms including Linux, UNIX and Windows. Summary Based on the Model-View-Controller (MVC) architecture, OA Framework lets application developers focus on the business requirements rather than on the underlying technologies. By using declarative and guided-coding (and soon visual) techniques, OA Framework allows application developers who are not necessarily J2EE experts to quickly become productive. OA Framework-based applications offer a highly consistent user experience with the highest levels of user interactivity without a client footprint. Applications are optimized for sub-second response to most user interactions and competitive scalability trends. OA Framework exploits its declarative and object-oriented architecture to offer the most durable personalization and extensibility capabilities on the market, at a fraction of the cost. OA Framework features translate to lower costs of ownership, better user experience and competitive deployments. 32
  • 33. Oracle Application Framework Developer's Guide, Release 12.1.3 Setting Up Your Development Environment This document describes how to configure and test an OA Framework Release 12 development environment for the following use cases: • Customer, Consultant or Support Representative Using JDeveloper on Windows. • Customer, Consultant or Support Representative Using JDeveloper on Linux. Note: Oracle employees who have installed Oracle JDeveloper OA Extension and want to set up and test this environment should select the Customer link. Customer, Consultant or Support Representative Using JDeveloper on Windows This section contains instructions to configure and test OA Framework if you are a customer, consultant or support representative using JDeveloper on Windows. It provides an overview of the directory structure and discusses how to: • Configure the JDEV_USER_HOME environment variable. • Obtain a database connection file. • Create a desktop shortcut to JDeveloper. • Assign Toolbox responsibilities. • Launch JDeveloper and configure the database connection and user. • Test the setup. Overview These instructions assume you have successfully installed the JDeveloper OA Extension zip file which creates the following directory structure on your drive of choice. Directory Description Tip: To open any of the documentation in the jdevdoc directories, open the jdevdocindex.htm. jdevdocjavadocfwk Includes OA Framework Javadoc. jdevdocjavadocaolj Includes AOL/J Javadoc. jdevdocjavadocbc4j Includes BC4J Javadoc. jdevdocjavadocuix Includes UIX Javadoc. jdevdoctoolbox Includes OA Framework ToolBox Tutorial lesson/lab documentation. jdevdocdevguide Includes the OA Framework Developer's Guide. jdevbin Includes an extended version of the Oracle JDeveloper 10g executable and OA Framework class libraries. jdevhome Includes the OA Framework ToolBox Tutorial source and developer working area. 33
  • 34. Oracle Application Framework Developer's Guide Task 1: Configuring the JDEV_USER_HOME Environment Variable Warning: This is a requirement for JDeveloper. Do not skip this task. Configure the JDEV_USER_HOME environment variable using Windows XP or Windows 2000: 1. Go to your desktop and select My Computer, right-click and select Properties. 2. On the System Properties dialog, select the Advanced tab. 3. On the Advanced page, select the Environment Variables... button. 4. On the Environment Variables dialog, select the New... button from the User variables for <username> box. 5. On the New User Variable dialog, enter JDEV_USER_HOME in the Variable Name field. Set the Variable Value field to <drive>:jdevhomejdev where <drive> is the drive where you installed the JDeveloper OA Extension zip file. For example: c:jdevhomejdev. 6. Select OK in each of the dialogs you opened to save the new user environment variable. Warning: The variable value should not contain a leading space before the drive name. If it does, your environment will not work properly. Task 2: Obtaining a Database Connection File Obtain the FND database connection (.dbc) file from the system administrator who installed the OA Framework database where you want to do your development. Place this file in the <JDEV_USER_HOME>dbc_filessecure directory. Task 3: Creating a Desktop Shortcut to JDeveloper To facilitate launching JDeveloper, create a desktop shortcut to jdevbinjdevbinjdevw.exe. Task 4: Assigning ToolBox Responsibilities If you have not already done so as part of your installation verification, assign the following ToolBox Tutorial responsibilities to a test user. Refer to the Oracle E-Business Suite System Administrators Guide for information about creating users and assigning responsibilities to users. Note: Use an existing user in your system or create a new test user. • OA Framework ToolBox Tutorial (responsibility key is FWK_TBX_TUTORIAL). • OA Framework ToolBox Tutorial Labs (responsibility key is FWK_TOOLBOX_TUTORIAL_LABS). Task 5: Launching JDeveloper and Configuring the Database Connection and User 34
  • 35. Oracle Application Framework Developer's Guide, Release 12.1.3 Use this procedure to launch JDeveloper and configure the database connection and user: 1. Select the desktop shortcut created in Task 3 to launch Oracle JDeveloper. 2. Select File > Open from the main menu, then navigate to <JDEV_USER_HOME>myprojects. Open the OA Framework ToolBox Tutorial workspace file (toolbox.jws). 3. Expand the toolbox.jws in the JDeveloper System Navigator, to display its contents. Select the Tutorial.jpr project, then select Project > Project Settings. 4. Expand the Oracle Applications node, which is In the Project Settings dialog, and select Runtime Connection. 5. Locate the DBC file that you saved in Task 2 by using the Browse... button, which is In the Connection box. The file should be in the <JDEV_USER_HOME>dbc_filessecure directory. 6. Specify the User Name and Password for the test user. This is the user that you assigned the ToolBox responsibilities to in Task 4. Select OK. 7. Repeat Steps 3 - 6 for the LabSolutions.jpr project. 8. Expand the Connections node in the JDeveloper System Navigator and then expand the Database node. Right-click on the Database node and select New Connection... to open the Connection Wizard. Follow the JDeveloper instructions to define a new database connection for the Oracle E-Business Suite database identified by the DBC file you selected above. 9. Select the Tutorial.jpr project In the System Navigator. Right-click and select Edit Business Components Project.... 10. Select the Connection option in the Business Components Project Wizard and set the Connection Name to the connection you just defined. Select OK to save your changes. 11. Repeat steps 8 - 10 for the LabSolutions.jpr project. Task 6: Configuring the Environment Encoding of JDeveloper • Confirm the environment encoding of your JDeveloper if it is appropriately set. To see the environment encoding, see your preferences of JDeveloper. If Encoding is not set to "UTF-8", set it to "UTF-8". Task 7: Test your Setup Perform the following steps to test your setup: Tip: If you want pages to look as they do in the OA Framework ToolBox Tutorial / Sample Librar, use Internet Explorer 5.0+ as your default browser. 1. Open the toolbox.jws workspace in the JDeveloper Navigator using the instructions in Task 5 above. 2. Go to the System Navigator, select toolbox.jws and then select Project > Rebuild toolbox.jws from the main menu. You should get 0 errors (warnings are okay and expected). 3. Go to the System Navigator, expand the Tutorial.jpr project again, then select Project > Show Categories from the main menu. 35
  • 36. Oracle Application Framework Developer's Guide Note: this helps to organize the files in a large project. 4. Expand the HTML Sources category beneath Tutorial.jpr. Select test_fwktutorial.jsp, then select Run > Run test_fwktutorial.jsp from the main menu. Perform the following: o Select Hello, World! from the list of lesson links displayed on the Test Framework ToolBox Tutorial page. This runs a very simple page. Note: If you can't run the Hello, World! page; revisit the steps listed above to ensure that you completed everything correctly. If the problem persists, follow the support procedure described in the Release Notes accompanying this ARU. You are now ready for hands-on experience with the Oracle JDeveloper OA Extension. The ToolBox Tutorial lessons can be launched from jdevdocindex.htm Customer, Consultant or Support Representative Using JDeveloper on Linux This section contains instructions to configure and test OA Framework if you are a customer, consultant or support representative using JDeveloper on Linux. It provides an overview of the directory structure and discusses how to: • Configure the JDEV_USER_HOME and JDEV_JAVA_HOME environment variables. • Obtain a database connection file. • Assign Toolbox responsibilities. • Launch JDeveloper on Linux. • Configure the database connection and user. • Test the setup. Overview These instructions assume you have successfully installed the JDeveloper OA Extension zip file which creates the following directory structure on your drive of choice. Directory Description Tip: To open any of the documentation in the jdevdoc directories, open the jdevdocindex.htm. jdevdocjavadocfwk Includes OA Framework Javadoc. jdevdocjavadocaolj Includes AOL/J Javadoc. jdevdocjavadocbc4j Includes BC4J Javadoc. jdevdocjavadocuix Includes UIX Javadoc. jdevdoctoolbox Includes OA Framework ToolBox Tutorial lesson/lab documentation. jdevdocdevguide Includes the OA Framework Developer's Guide. jdevbin Includes an extended version of the Oracle JDeveloper 10g 36
  • 37. Oracle Application Framework Developer's Guide, Release 12.1.3 executable and OA Framework class libraries. jdevhome Includes the OA Framework ToolBox Tutorial source and developer working area. Task 1: Configuring the JDEV_USER_HOME and JDEV_JAVA_HOME Environment Variables Attention: These commands must be executed from the bourne shell. 1. Assign a value to the JDEV_USER_HOME variable. For example: JDEV_USER_HOME=/home/<username>/jdevhome/jdev 2. Assign a value to the JDEV_JAVA_HOME variable. Example - OS Red Hat version 2.1: JDEV_JAVA_HOME=/jdevbin/linux/j2sdk1.4.2_03 Example - OS Red Hat version 3.0: JDEV_JAVA_HOME=/jdevbin/linux/j2sdk1.4.2_04 unset LD_ASSUME_KERNEL Note: Both Red Hat versions, (2.1 and 3.0); have been tested successfully by Oracle JDeveloper OA Extension. 3. Export the two variables: export JDEV_USER_HOME export JDEV_JAVA_HOME Task 2: Obtaining a Database Connection File Obtain the FND database connection (.dbc) file from the system administrator who installed the OA Framework database where you want to do your development. Place this file in the <JDEV_USER_HOME>dbc_filessecure directory. Task 3: Assigning ToolBox Responsibilities 37
  • 38. Oracle Application Framework Developer's Guide If you have not already done so as part of your installation verification, assign the following ToolBox Tutorial responsibilities to a test user. Refer to the Oracle E-Business Suite System Administrators Guide for information about creating users and assigning responsibilities to users. Note: Use an existing user in your system or create a new test user. • OA Framework ToolBox Tutorial (responsibility key is FWK_TBX_TUTORIAL). • OA Framework ToolBox Tutorial Labs (responsibility key is FWK_TOOLBOX_TUTORIAL_LABS). Task 4: Launching JDeveloper on Linux Run this command from the bourne shell to launch JDeveloper: /jdevbin/jdev/bin/jdev -verbose Task 5: Configuring the Database Connection and User Use this procedure to configure the database connection and user: 1. Launch JDeveloper and then select File > Open from the main menu. Navigate to <JDEV_USER_HOME>myprojects and open the OA Framework ToolBox Tutorial workspace file (toolbox.jws). 2. Expand the toolbox.jws in the JDeveloper System Navigator, to display its contents. Select the Tutorial.jpr project, then select Project > Project Settings. 3. Expand the Oracle Applications node, which is In the Project Settings dialog, and select Runtime Connection. 4. Locate the DBC file that you saved in Task 2 by using the Browse... button, which is In the Connection box. The file should be in the <JDEV_USER_HOME>dbc_filessecure directory. 5. Specify the User Name and Password for the test user. This is the user that you assigned the ToolBox responsibilities to in Task 3. Select OK. 6. Repeat Steps 2 - 5 for the LabSolutions.jpr project. 7. Expand the Connections node in the JDeveloper System Navigator and then expand the Database node. Right-click on the Database node and select New Connection... to open the Connection Wizard. Follow the JDeveloper instructions to define a new database connection for the Oracle E-Business Suite database identified by the DBC file you selected above. 8. Select the Tutorial.jpr project In the System Navigator. Right-click and select Edit Business Components Project.... 9. Select the Connection option in the Business Components Project Wizard and set the Connection Name to the connection you just defined. Select OK to save your changes. 10. Repeat steps 7 - 9 for the LabSolutions.jpr project. Task 6: Testing the Setup 38
  • 39. Oracle Application Framework Developer's Guide, Release 12.1.3 Tip: To use Mozilla as your default browser, create a symbolic link. For example, netscape = local/bin/mozilla. To test your setup: 1. Open the OA Framework ToolBox Tutorial workspace file by selecting File > Open from the main menu. Navigate to <JDEV_USER_HOME>myprojects and open the file toolbox.jws. 2. Select toolbox.jws and select Project > Rebuild toolbox.jws from the System Navigator main menu. You should get 0 errors (warnings are okay and expected). 3. Expand the Tutorial.jpr project and then select Project > Show Categories from the System Navigator main menu. (This helps to organize the files in a large project). 4. Expand the HTML Sources category beneath Tutorial.jpr. Select test_fwktutorial.jsp, and select Run > Run test_fwktutorial.jsp from the main menu: 5. Select Hello, World! from a list of lesson links displayed on the Test Framework ToolBox Tutorial page, to run a very simple page. Note: If you can't run the Hello, World! page; revisit the steps listed above to ensure that you completed everything correctly. If the problem persists, check the Oracle JDeveloper OA Extension FAQ for troubleshooting tips. If it still doesn't work, send an email to the OA Framework support mail list (see the OA Framework web site for additional information about this). 39
  • 40. Oracle Application Framework Developer's Guide Building and Running 'Hello, World!' Overview This tutorial leads you through using Oracle JDeveloper with OA Extensions to create a very simple page. This tutorial has minimal explanation, few steps and no BC4J. This tutorial also assumes a basic prior knowledge of working with JDeveloper. You should also have your development environment set up and working. For assistance in setting up your development environement see "Setting Up Your Development Environment" This lab takes approximately 1-3 hours. Hello, World Lab Goals After completing this exercise, you will have learned how to: • Create an Oracle Applications (OA) JDeveloper workspace and project. • Configure a project to enable Developer Mode testing and diagnostics. • Use the JDeveloper OA Extension to create a very simple page. • Create a controller and associate it with a region. • Handle a submit button press action (an HTTP POST request). • Run a page in regular and debug modes. The resulting page has the global links (such as Preferences, Logout, and Return to Portal), a header, a footer, a Personalize Region link, one empty field and one Go button. The finished "Hello World" page does nothing other than display a message when you enter a value in the field and click the Go button. Your final page and layout will look like the following: 40
  • 41. Oracle Application Framework Developer's Guide, Release 12.1.3 Note that there are several profile options that control features such as personalization, the visual appearance of global links, and other features, so what you see may be different from the picture above. Differences you are most likely to encounter are not seeing the Personalize Region link, seeing button icons above the corresponding global links, or not seeing certain global links such as Customize (if personalization is not enabled for your username). Step 1. Create a New OA Workspace and Empty OA Project with the New... Dialog. Select File > New... to open the New... dialog (shown in the following diagram). This dialog is also called the New Object Gallery. 41
  • 42. Oracle Application Framework Developer's Guide Choose General > Workspace Configured for Oracle Applications from the New... dialog, or highlight Workspaces in the Navigator and choose New OA Workspace... from the context menu (right mouse button menu that changes depending on the context). You'll be prompted to create an OA workspace. Verify that the default workspace directory name points to your own <JDEV_USER_HOME>myprojects directory, as shown in the following diagram. Modify the workspace file name as well (any name is okay for a workspace, such as HelloWorldOAWorkspace.jws). Check the Add a New OA Project check box. After you click OK, you will see the Oracle Applications Project Wizard after a Wizard Welcome screen. You can skip the welcome screen and select Next. 42
  • 43. Oracle Application Framework Developer's Guide, Release 12.1.3 In Step 1 of the wizard, verify that the default project directory name points to your own JDEV_USER_HOMEmyprojects directory, as shown in the following diagram. Modify the project file name as well (any name is okay for a project, such as HelloWorldOAProject.jpr). Set the default package name to the following (where "hello" is the component): oracle.apps.ak.hello Note: For this exercise and for all later lab exercises, you must use the exact package, page, region, item and variable names specified in the instructions, because the instructions depend on having these names. Specifically, you must use oracle.apps.... in your package names for the labs even if you are an Oracle E-Business Suite customer or partner (though you would use <3rd party identifier>.oracle.apps.... in production objects you create). In Step 2 of the wizard, verify that the XML Path points to your own JDEV_USER_HOMEmyprojects directory, as shown in the following diagram. You can include additional directories in the XML Path field if you have files in your project that do not reside under your myprojects directory. For your Hello World project, you do not use the Repository for metadata in the database (the Hello World example uses only the XML files). In regular development work, where you use 43
  • 44. Oracle Application Framework Developer's Guide standard components that have been imported into the Repository, you would check the Use Repository for Design Time check box and provide connection information in Step 2. In Step 3 of the wizard, adjust the runtime connection information, if necessary, for the database and Oracle E-Business Suite username, password, and responsibility you are using (it must be a valid user and responsibility for your installation). 44
  • 45. Oracle Application Framework Developer's Guide, Release 12.1.3 You will then have a screen after the one above that verifies the wizard is done, or you can select Finish on this page of the Wizard. When you select Finish, you will notice that JDeveloper will build some new files within your JDev Home directories. Step 2. Set Run Options in OA Project Settings To verify that your project includes all of the appropriate libraries, paths and other settings, select your project in the Navigator and choose Project Properties... from the context menu, or double-click on your project. Select the Oracle Applications > Run Options settings page. Select OADeveloperMode and OADiagnostic, and move them to the Selected Options List. OADeveloperMode provides extra code checking and standards checking at runtime. OADiagnostic enables the Diagnostics button in the global buttons at the top of the page, overriding any corresponding profile option set for the application. You should always have these two modes turned on during development. The other modes are generally used for testing towards the end of developing your page, and are fully described in Chapter 7 of the Developer's Guide. 45
  • 46. Oracle Application Framework Developer's Guide Step 3. Create the OA Components Page File Within your new workspace, select your new project (your .jpr file). To add an OA Components page file to your project, choose New... from the context menu or use File > New... on the main menu to open the New... dialog. 46
  • 47. Oracle Application Framework Developer's Guide, Release 12.1.3 Select Web Tier > OA Components in the Categories column. Then select Page, and press OK as shown in the following diagram: 47
  • 48. Oracle Application Framework Developer's Guide You will then see a dialog box that asks for the name and package file for your new page. This dialog box is shown in the following diagram: Name your page HelloWorldPG. Your page name cannot include any spaces. In the Package field, type the following: oracle.apps.ak.hello.webui 48
  • 49. Oracle Application Framework Developer's Guide, Release 12.1.3 Note: Be aware that the Wizard will populate a package name (the default package for the project) so be sure to check it carefully. Your package file name (which determines the location of the XML page file in the directory structure) should be set to oracle.apps.<application_shortname>.<optional_modulename>.<optional_subcomponent >.webui (to comply with Oracle E-Business Suite directory structure standards), where the application shortname is lowercase and is an existing Oracle E-Business Suite product shortname, such as INV. Note: Pages migrated from old AK pages may use a different directory structure (pages instead of webui). Be sure to follow the package name, directory location and object naming standards in the OA Framework File / Package / Directory Structure standards. Your initial page structure appears in the Structure window as shown below, with an initial pageLayout region called region1, and a folder called pageLayout Components. The pageLayout Components folder contains a standard corporate branding image ("Oracle") that you can change through personalizations and through profile options. Changing the logo is not part of this exercise. Step 4. Modify the Page Layout (Top-level) Region JDeveloper creates your top-level page layout region for you automatically when you create your page. 49
  • 50. Oracle Application Framework Developer's Guide If the Property Inspector is not already open, select View > Property Inspector from the main menu. You can alternate between the alphabetical list of properties and the categorized list by clicking on the Categories button at the top of the Property Inspector (shown above with categories enabled). Set the following properties for your page layout region: • Set the ID property to PageLayoutRN. • Verify that the Region Style property is set to pageLayout. • Verify that the Form property is set to True. • Verify that the Auto Footer property is set to True. • Set the Window Title property to <your name>: Hello World Window Title. This becomes the window title for the page. • Set the Title property to <your name>: Hello World Page Header. This becomes the page header for the page (it appears under the blue bar). 50
  • 51. Oracle Application Framework Developer's Guide, Release 12.1.3 • Set the AM Definition property to oracle.apps.fnd.framework.server.OAApplicationModule (you will have to type in the value). This is a generic application module supplied by the OA Framework. Step 5. Create the Second Region (Main Content Region) Create your second region under the page layout region by selecting the page layout region in the Structure window and choosing New > Region from the context menu. 51
  • 52. Oracle Application Framework Developer's Guide This region is merely going to provide a container for your items and ensure that the items are properly indented. Set the following properties for your second region: • Replace the default value in the ID property with MainRN. • Set the Region Style property to messageComponentLayout (this provides an indented single- or multiple-column layout for the child items of the region). If you want to, you can run your page at this point. You will see the global links, the copyright and privacy footer elements, and your page header text. Step 6. Create the First Item (Empty Field) Create your first item under the second region (main content region) by selecting the second region in the Structure window and choosing New > messageTextInput from the context menu. 52
  • 53. Oracle Application Framework Developer's Guide, Release 12.1.3 Set the following properties for your item: • Set the ID property to HelloName. • Verify that your Item Style property is set to messageTextInput (this style provides a text label and an input field). • Set the Prompt property to Name (in the later labs, you will use an attribute set to set the prompt). • Set the Visual Length to 20. • Set the Data Maximum Length to 50. 53
  • 54. Oracle Application Framework Developer's Guide If you want to, you can run your page at this point. Step 7. Create a Container Region for the Go Button To add a non-message*-type bean such as a submitButton to a messageComponentLayout region, you must first add the bean to a messageLayout region. Select the messageComponentLayout region and select New > messageLayout. 54
  • 55. Oracle Application Framework Developer's Guide, Release 12.1.3 Name this region ButtonLayout. Step 8. Create the Second Item (Go Button) 55
  • 56. Oracle Application Framework Developer's Guide Create your Go button item by selecting the messageLayout region, ButtonLayout, in the Structure window and choosing New > Item from the context menu. Set the following properties for your button item: • Set the value of the ID property to Go. • Set the Item Style property to submitButton. • Set the Attribute Set property to /oracle/apps/fnd/attributesets/Buttons/Go. Note: You can search for this attribute set, even though the attribute set file is not part of your project, by choosing the Search in: Entire MDS XML path option but not selecting the Show Components in Same Scope Only check box. You can use /oracle/apps/fnd/attributesets/ and Go% as criteria for your search. Verify that the Prompt property is now set to Go (this is your button label, inherited from the attribute set). 56
  • 57. Oracle Application Framework Developer's Guide, Release 12.1.3 If you want to, you can run your page at this point. Step 9. Save Your Work Save your work. Using the menu choice File > Save All will save your metadata changes to an XML file as well as save all your other file changes (such as to a .jsp or .java file). Tip: Though it usually will not be written out as a separate step in the exercises, you should save your work frequently. Step 10. Run Your Page Using the Run Option You can try out your page using the Run option on the context menu. If you are using a database other than what you already have in your project settings, you will need to modify the Runtime Connection project settings by selection your project file and choosing Project Properties... from the main menu. Specifically, you must use a combination of Username, Password, (Responsibility) Application Short Name and Responsibility Key that is valid for your database to enable your session to log in. 57
  • 58. Oracle Application Framework Developer's Guide You can use the Run option in the context menu to test your page in a standard browser. This option allows you to test your layout as well as functionality such as handling button presses. Select your page or page layout region in the Structure window, and choose Run from the context menu. 58
  • 59. Oracle Application Framework Developer's Guide, Release 12.1.3 Alternatively, you can select your page in the Navigator window, and choose Run <page name> from the context menu. You may have to wait a few minutes or more before you see your page in a separate browser window (it often takes longer the first time). 59
  • 60. Oracle Application Framework Developer's Guide If your page does not appear after a few minutes, or gives errors, check the messages in the Log window. See the Hello, World! Troubleshooting Guide or the Oracle JDeveloper OA Extension FAQ. Your page should look like the following picture (with your own name in the page header and window title). You should see your page header, your Name field, and your Go button, along with global links and buttons (some global buttons may not appear depending on profile option settings). You may or may not see a Personalize Region link below your page header, depending on profile option settings. Do not personalize this page, as personalizations are data driven and you will affect anyone else building the Hello World page on the same database. Each time you make changes to your layout (by adding regions or items, modifying properties, or changing code), you must run your page again to see your changes. If the Run process seems to hang for several minutes after you have already run your page previously, you may need to terminate the OC4J server using the Run > Terminate > Embedded OC4J Server main menu option, and then run again. Step 11. Add a Controller Add a controller to display a message when the user clicks on the Go button. Select your second region (MainRN) and choose Set New Controller... from the context menu. Give your controller the package name oracle.apps.ak.hello.webui and an appropriate class name, such as HelloWorldMainCO. Be sure you review the window before you click OK. 60
  • 61. Oracle Application Framework Developer's Guide, Release 12.1.3 Step 12. Edit Your Controller When you created a new controller, JDeveloper added files to your project in the package you created ( oracle.apps.ak.hello.webui). The controller file is called HelloWorldMainCO.java If you double click on HelloworldMainCO.java, the file will be editable in an adjacent screen. Edit your controller code as follows: Add the following line as the last line of the import section to make the OA Framework OAException routines available: import oracle.apps.fnd.framework.OAException; Within the comments section at the top of the controller source code, you can also fill out what this controller is used for. Doing so makes it easier to understand what a specific controller is used for since there will be potentially many controllers in the same package. In our case, we are going to create a single controller in this exercise. 61
  • 62. Oracle Application Framework Developer's Guide Note: You can sort your imports using the context menu in the code editor (Organize Imports > Sort Imports) as shown in the following picture. However, DO NOT organize the imports now because our import is unused (greyed out) and will be removed if we run the organize imports now. 62
  • 63. Oracle Application Framework Developer's Guide, Release 12.1.3 Code the processFormRequest() method to match the following (making sure to match the item IDs you chose): public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) 63
  • 64. Oracle Application Framework Developer's Guide { super.processFormRequest(pageContext, webBean); if (pageContext.getParameter("Go") != null) { String userContent = pageContext.getParameter("HelloName"); String message = "Hello, " + userContent + "!"; throw new OAException(message, OAException.INFORMATION); } } Note: Hardcoding a message text string is not translatable and would not be acceptable in a real Oracle E-Business Suite product. Normally you would define your message in Message Dictionary and call it from your code using its message name using the OAException routine. Step 13. Build Your Controller Build your controller by selecting Rebuild from the context menu within the code editor window. 64
  • 65. Oracle Application Framework Developer's Guide, Release 12.1.3 Step 14. Test Your Work Using the Run Option Save your work, and then test it using the Run option. Type something into your field and then click the Go button. You should see the your page with an informational message that contains what you typed into the field, as shown: 65
  • 66. Oracle Application Framework Developer's Guide Step 15. Test Your Work Using the Debugger First, go back to your controller window to set up a breakpoint. Click on the line number next to the code line where you want the breakpoint to occur. You may have to toggle on the line numbers in JDeveloper. The number changes to an icon indicating that it is a breakpoint in the source code. Set a breakpoint at the following line within your processFormRequest code: if (pageContext.getParameter("Go") != null) 66
  • 67. Oracle Application Framework Developer's Guide, Release 12.1.3 Now test your page by selecting your page name in the Navigator and choosing Debug HelloWorldPG.xml from the context menu (you can also do this in the Structure window). Tip: When you are trying to debug an OA Extension page avoid launching the debugger from the project file. Instead, launch from a specific JSP or XML file (which may itself be a launch page). When the debugger starts up, your JDeveloper layout changes to a debugging layout that includes additional windows, including a debugging toolbar, a Breakpoints window, Data and Smart Data windows, and a Stack window (these may appear as tab controls); this is only a partial list. In debug mode, your code executes as it normally would until you hit a breakpoint. So, in this example, the page renders as usual because the breakpoints are in the code that handles the Go button press. For the breakpoints above, you will need to enter a value in your page's Name field and select the Go button before you reach your breakpoint. Type something into the Name field on your page and then click the Go button. If you go back to the JDeveloper window, you should find your first breakpoint line highlighted; processing has stopped just before that line is executed. This first breakpoint occurs just before your code checks to see if the Go button has been selected. 67
  • 68. Oracle Application Framework Developer's Guide Now select Debug > Step Over from the main menu, or select the Step Over button, to continue to the next line of code. The debugger then highlights the following line of code: String userContent = pageContext.getParameter("HelloName"); If you hold your mouse hovering above userContent on that line, you will see userContent = (out of scope) because the line has not yet executed. Now select Debug > Step Over from the main menu, or select the Step Over button again, to continue to the next line of code. 68
  • 69. Oracle Application Framework Developer's Guide, Release 12.1.3 String message = "Hello, " + userContent + "!"; Now if you hold your mouse hovering above userContent on the new line, you will see its value as whatever you typed in (this only works for strings). In the screen captures above, you can see the value of userContent in the Data or Smart Data window. Note: If you hold your mouse over the word message on the same breakpoint code line, you will see message = (out of scope) because the line has not yet executed (and you will not see message at all in the data windows). 69
  • 70. Oracle Application Framework Developer's Guide Step over again. You then get to the following line of code: throw new OAException(message, OAException.INFORMATION); At this point, if you examine the message string (either in the code window or in the Data or Smart Data windows), you will see your entire message text. Select Debug > Resume from the main menu, or select the Resume button, to resume processing so your code runs to completion. You should see your page with an informational message that contains what you typed into the field, just as it looked when you ran your page using the Run option. Congratulations! You have finished your first page with Oracle JDeveloper and the OA Framework! 70
  • 71. Oracle Application Framework Developer's Guide, Release 12.1.3 OA Framework Development Runtime Configuration Overview This document briefly introduces some of ways that you configure your OA Framework runtime for pages in development, and some simple utilities that you might find useful. Contents • Page Test Modes • Profile Options • Technology Stack Information Page Test Modes As briefly mentioned in Building and Running "Hello, World!" there are several test modes that you can leverage at different points in the development/test cycle. See the associated links for each option for additional information about its use. Option Description Recommended Use OADeveloperMode Performs various code This should always be enabled standards checks as during development. outlined in Chapter 7. OADiagnostic Enables the global This should always be enabled Diagnostics button at the during development. top of the page (you would select this to view log messages for the page). Note that this overrides any corresponding profile option value set for the application. See Logging. OABackButtonTestMode Tests the page's browser This should be used only when Back button support. performing Back button support tests. See Testing OA Framework Applications. OAPassivationTestMode Tests the page's support This should be used only when for passivation. performing passivation tests. See Testing OA Framework Applications. 71
  • 72. Oracle Application Framework Developer's Guide OADumpUIXTree Writes out the component This should be used only when you tree for a page. need to diagnose a problem. See Debugging OA Framework Applications. Note: You can set page test modes two different ways, however, the back button and passivation test modes currently must be set as cookies in a test JSP. Project Settings 1. Select your project in the JDeveloper System Navigator and select Project > Project Settings... from the main menu. 2. In the Project Settings dialog, select the Common > Oracle Applications > Run Options page. 3. In the Run Options page, select the test modes that you want to enable in the Off Options List and shuttle them to the On Options List. 4. Select OK to save your changes. Test JSP Cookies The test_fwktutorial.jsp that you ran as described in Setting Up Your Development Environment includes the following cookie definitions. If you save this test JSP to create your own (the easiest way to create a test JSP), simply modify the following section as appropriate to enable or disable test modes. Note: Test JSP cookie values override any values that you set for the project. <SCRIPT LANGUAGE="JavaScript"> document.cookie = "OADiagnostic=1"; document.cookie = "OADeveloperMode=1"; document.cookie = "OABackButtonTestMode=0"; document.cookie = "OAPassivationTestMode=0"; document.cookie = "OADumpUIXTree=0"; </SCRIPT> Profile Options 72
  • 73. Oracle Application Framework Developer's Guide, Release 12.1.3 There are several profile options that you might want to set during development. See Appendix B: OA Framework Profile Options for a list of all the Oracle E-Business Suite profile options that affect the OA Framework. Warning: Be conservative when you change profile option values! You should be setting them at the responsibility, user, or application level as appropriate in order to avoid impacting other developers working on the same environment. Accessibility • The Self Service Accessibility Features profile options controls whether pages can be used with assistive technologies. If enabled, the OA Framework Partial Page Rendering (PPR) features are disabled -- which can be surprising if you're not expecting this behavior. Personalization • There are series of related profile options that control whether Personalization is enabled and accessible in a page. See the Personalization section in the profile options document (this also points you to additional information about the feature). Logging • There are a series of related profile options that control if and how logging is implemented. See the Logging section in the Profile Options document (this also points you to additional information about the feature). Passivation • There are a series of related profile options that control whether passivation is enabled. See the Passivation section in the Profile Options docment (this also points you to additional information about this feature). Technology Stack Information If you need to know what version of the OA Framework and Java you're running (among other things), see the instructions in Discovering Page, Technology Stack and Session Information. 73
  • 74. Oracle Application Framework Developer's Guide 74
  • 75. Oracle Application Framework Developer's Guide, Release 12.1.3 Chapter 2: OA Framework Essentials JSP Application Primer Overview If you do not have web application development experience, this document is intended to help you visualize -- in very simple terms -- how a generic JSP application is constructed, and what happens at runtime. It also identifies some key vocabulary/concepts used throughout the OA Framework Developer's Guide and ToolBox Tutorials. Contents • Key JSP Application Components • What Happens at Runtime? • Event Handling: Web UI vs. Classic Client UI • Page Navigation • What is a Cookie? • More About Servlet Sessions Suggested Reading For additional information about JSP applications and servlets (none of which is required reading for working with the OA Framework), you might want to review the following for tutorials, documentation and book suggestions: • Oracle Technology Network • JavaSoft Java Developer Connection Key JSP Application Components A typical JSP application involves the following components: a browser for client access, a database for enterprise data and a web application server ("middle tier") where the application objects live. • The browser communicates with the middle-tier using HTTP (Hyper Text Transfer Protocol), which involves sending a request message to which the middle-tier replies with a response message. • A JSP is a file with some HTML and Java code that executes top to bottom. At runtime, it is compiled into a Java class, which is actually a servlet. • A servlet is a Java-based web application server extension program that implements a standard API. • A servlet session is a mechanism for maintaining state between HTTP requests during a period of continuous interaction between a browser and a web application. A session may be initiated at any time by the application and terminated by the application, by the 75
  • 76. Oracle Application Framework Developer's Guide user closing the browser, or by a period of user inactivity. A session usually corresponds to an application login/logout cycle • A JavaBean (or "bean" for short) is simply a reusable component that implements specific design patterns to make it easy for programmers and development tools to discover the object's properties and behavior. • Any objects in the middle-tier that communicate with the database use a JDBC (Java Database Connectivity) driver. Figure 1: Key web application components and browser/server communication What Happens at Runtime? Step 1 When the user selects a link, a button or an active image, the browser sends an HTTP request to the web application server for processing. For the purposes of this introduction, we will focus on the two primary HTTP request methods (POST and GET) that are relevant for an OA Framework application. HTTP GET 76
  • 77. Oracle Application Framework Developer's Guide, Release 12.1.3 Whenever the user clicks a link or an image with an associated URL (like http://www.yahoo.com) the browser submits a GET request. You can think of a GET as a postcard: both the address (URL) and any information the sender wants to convey (URL parameters) are written on the card itself (which is inherently space- constrained; how much can you write on a postcard?). This means that all the information for the communication is visible externally (and in an HTTP GET, all the data sent to the server is visible as parameters on the URL). HTTP POST Whenever the user clicks a button, image or link that performs a form submit in an OA Framework application (see What is a Form? below), the browser submits a POST request to the server (technically, a form can be submitted with a GET, but for the purposes of working with the OA Framework, you can assume a form submit is a POST). You can think of a POST as an envelope: the address (URL) is written on the outside, but the content within has the information the sender wants to convey. There's no limit to the amount of information that can be stored inside the envelope. Furthermore, the submitted data is not visible on the URL -- just as the contents of an envelope are not externally visible (although the metaphor isn't absolutely accurate: a developer could also add some parameters to the URL when doing a form submit). What is a "Form?" In simple terms, a "form" lets you collect data entered by users into "form fields," and send that data to the server for processing. A form is an HTML construct that groups data entry controls such as fields (both hidden and visible), poplists, and so on with action controls (like buttons) that are capable of "submitting the form." When the user selects a submit button, for example, the browser issues a POST request, which sends the form's data to the server. Tip: People often use the terms POST and "submit form" interchangeably when talking about the OA Framework. Step 2 The HTTP listener in the web application server routes the incoming request to the JSP. The developer's code does not know or care whether the browser issued a POST or a GET. All it does is read request values to determine what to do. So, for example, one of the request values might tell the JSP that a Go button had been pressed, which means it must execute a query. Step 3 As shown in Figure 1 above, the JSP delegates to one or more JavaBeans, which implement various behaviors including database interaction. Once they have completed their work, the JSP prepares the appropriate HTML content to send back to the browser in the response. 77
  • 78. Oracle Application Framework Developer's Guide Note: We included the JavaBeans in this example just to make the point that in an application of any complexity -- and modularity -- the JSP does not do the application work on its own since you should not combine model, view and controller code in the same file. However, there is no absolute technical requirement for the JSP to work with any other Java classes, and if it does, there is no requirement that these classes be JavaBeans. Step 4 The browser displays the HTML it received in the response. Event Handling: Web UI vs. Classic Client UI In traditional client/server applications, you have the option of handling events ranging in granularity from very low-level mouse movements to field, region and finally, window-level scope. Furthermore, when you communicate from the client to the server, you can send a single value to be validated back to the server while expecting a single validation result back. You can then modify the user interface accordingly, which allows for a highly interactive experience for the user. In a web application, you essentially handle "page-level" events (unless you are using Javascript extensively to create a more interactive experience, and since the OA Framework Coding Standards and Oracle Browser Look and Feel (BLAF) UI Guidelines prohibit this, we will not consider it here). In this case, as users navigate from field to field and enter data, there are no events for you as a developer to handle. Tip: OA Framework provides partial page rendering (PPR ) support for some actions, which allows for a more interactive user experience. This is fully described in Chapter 4. When the browser finally sends a request as described above, all the page data is sent in that single communication -- including any user-entered values and information about what actions the user wants to perform. The developer reads request values to determine what happened (if the user pressed a button, which one was it?), does whatever work is required by the selected action, and then transmits a new HTML page back to the browser. Page Navigation So far, we've reviewed what happens (in general terms) when the browser communicates to the web server and vice versa, but we have not discussed the primary mechanisms for navigating from one page to another. Note: In the following generic descriptions, it does not matter whether the request sent by the browser is a POST or a GET. Standard Request Scenario 78
  • 79. Oracle Application Framework Developer's Guide, Release 12.1.3 A user selects a link on Page X to navigate to Page A. While on Page A, they select a link to navigate to Page B. Implementation The browser sends a request to Page A, which does its work and sends a response to the browser including the HTML to display. When the user indicates that they want to see Page B, the browser sends a new request to Page B, which does its work and sends a response so Page B can display. Figure 2: Standard request illustration 79
  • 80. Oracle Application Framework Developer's Guide JSP Forward Tip: You will code many JSP Forwards in your OA Framework application. You must understand this concept. Scenario While on Page A, a user selects an action from a dynamically defined list. The code in JSP A needs to handle that action to determine what page to display in response. 80
  • 81. Oracle Application Framework Developer's Guide, Release 12.1.3 Implementation In this case, while handling an incoming request as a result of the user's action selection, JSP A "forwards" to JSP B which does its work and sends a response including the HTML to display itself. Since the "forward" action happens on the server, the browser knows nothing about it and the two pages share the same request. Figure 3: JSP forward from one page to the next within a single request In another variation, which is very common in OA Framework pages for reasons, which will be described later in this chapter and the next, Page A could perform a JSP Forward back to itself as shown below. Figure 4: JSP forward from one page back to itself within a single request 81
  • 82. Oracle Application Framework Developer's Guide Client Redirect Scenario A user selects a link on Page X to navigate to Page A, but the link is old so the developer wants to automatically send the user to the new replacement, Page A2. Implementation In this case, while handling an incoming request, JSP A sends a special "redirect" message to the browser telling it to immediately access JSP A2. The browser sends a second request to JSP A2, which does its work and sends a response including the HTML to display. Figure 4: A client redirect from one location (page) to the next (the same page in a different location) 82
  • 83. Oracle Application Framework Developer's Guide, Release 12.1.3 What is a Cookie? To fully understand how the OA Framework maintains application context after a user logs in, you need to understand what a browser "cookie" is. A "cookie" is a nugget of information that a web application can give to a browser with the understanding that the browser will send it back to the server with each request. In other words, it is a mechanism for holding on to some small amount of state between requests. Cookies can be persistent or session-based: • The browser saves a persistent cookie to a file on the user's computer, and the information endures across browser sessions. Have you ever navigated to a web site that greeted you by name before you logged in? If so, this was accomplished with a persistent cookie. • Session-based cookies are held in the browser's memory, and when the browser is closed, the cookie is destroyed. More About Servlet Sessions In the same way that AOL/J pools JDBC connections because they are a precious resource (you will learn more about connection pooling later in this chapter), the servlet engine pools 83
  • 84. Oracle Application Framework Developer's Guide request-processing threads. As illustrated in Figure 5 below, the servlet engine allocates a thread to process each request it receives. When the request completes, the servlet engine returns the thread to its pool. Note: The following diagram assumes a user performs two actions resulting in two separate HTTP requests while working in the same browser window (the same browser session). It should not be interpreted to mean that two browser windows are open. Figure 5: Conceptual illustration of servlet engine request processing Since a single browser session can be served by numerous threads, (a different one for each request), the servlet session provides a resource for maintaining state across requests. 84
  • 85. Oracle Application Framework Developer's Guide, Release 12.1.3 • If a web application wants to establish a servlet session, it calls a method on the request object asking for a session to be created. • The servlet engine creates the session (specifically, a javax.servlet.http.HttpSession object), along with a special cookie that it returns to the browser with the response. This session cookie holds the servlet session ID. • When a new request is received with the session ID cookie, the servlet engine uses this ID to locate that particular browser's servlet session object. • Web application code can then access any data stored on the servlet session during previous requests within the same browser session. Note: You can track sessions two ways. The most common way, which is what the OA Framework does, is to use a session cookie. Alternatively, you can encode the cookie into request URLs. If you want to learn more about this, or any other concepts presented in this document, see the suggested reading section above. 85
  • 86. Oracle Application Framework Developer's Guide Anatomy of an OA Framework Page This document describes the basic elements of a typical OA Framework page. Contents • Page Basics • The Model • The View • The Controller • Web Bean Architecture • Guide to OA Framework Javadoc Prerequisite Reading If you are new to web application development, please read the short JSP Application Primer before proceeding. The OA Framework Developer's Guide assumes you are familiar with the concepts and vocabulary presented in the JSP Primer. Page Basics At the browser level, an OA Framework page, like any other web page, renders as standard HTML. In the middle tier, however, this page is implemented in memory as a hierarchy of Java beans -- very much like a classical Java client UI. Each UI widget, such as buttons, a table, the tabs, the application branding image and so on, that renders in the page corresponds to one or more web beans in the hierarchy. When the browser issues a request for a new page, OA Framework reads the page's declarative metadata definition to create the web bean hierarchy. For each bean with an associated UI controller, OA Framework calls code that you write to initialize the page. When page processing completes, OA Framework hands the web bean hierarchy to the UIX framework so it can generate and send HTML to the browser. When the browser issues a form submit (if, for example, the user selects a search region's Go button), OA Framework recreates the web bean hierarchy if necessary (the hierarchy is cached between requests, and typically needs to be recreated only in exceptional cases that we'll discuss in detail later), and then calls any event handling code that you've written for the page beans. When page processing completes, the page HTML is generated again and sent to the browser. The rest of this document introduces the specific model, view and controller code and declarative definitions that you create to implement a page. Figure 1: A conceptual illustration of the OA Framework model-view-controller architecture 86
  • 87. Oracle Application Framework Developer's Guide, Release 12.1.3 The Model The model encapsulates the underlying data and business logic of the application. It also provides an abstraction of the real-world business object(s) and application service(s) that it provides. The Implementing the Model document in Chapter 3 discusses all of the following in detail. Application Modules 87
  • 88. Oracle Application Framework Developer's Guide A BC4J application module is essentially a container that manages and provides access to "related" BC4J model objects. In this context, objects are "related" by virtue of participating in the same task. For example, all the BC4J objects that comprise a single transaction participate in the same task -- even if the corresponding user interface requires that the user visit multiple pages. Figure 2: Basic model architecture - Application Module associations All application modules that you create subclass the oracle.apps.fnd.framework.server.OAApplicationModuleImpl class. Each OA Framework page has a "root" application module, which is associated with the top- level page region (the pageLayout region). The root application module provides transaction context and establishes a database connection. • If multiple pages participate in the same physical or virtual transaction, they should share the same root application module. • If a page functions independently of any other, it should have its own application module. The OA Framework State Management document in this chapter discusses the relationship between root application modules and different kinds of pages in detail. Note: It is also possible for a root application module to contain one or more "nested" application modules, which can themselves nest children to any arbitrary level. In this scenario, the root application module has access to all the data/objects held by its children, and all children participate in the same transaction established by the root. You will use this feature whenever you want to create a reusable UI region that interacts with the database. 88
  • 89. Oracle Application Framework Developer's Guide, Release 12.1.3 Entity Objects (and Association Objects) BC4J entity objects encapsulate the business rules (validations, actions and so on) associated with a row in a database table. For example, the OA Framework ToolBox Sample Library includes a FWK_TBX_SUPPLIERS table for storing supplier definitions. We also defined an entity object for this table (SupplierEO) that implements all the business rules for inserting, updating and deleting a supplier. Note: Entity objects can also be based on views, synonyms or snapshots. OA Framework supports both Java and PL/SQL entity objects (Chapter 5 discusses business logic design and implementation in detail, including advice on choosing Java versus PL/SQL entity objects). Figure 3: Basic model architecture - Entity Objects associations Most entity objects that you create subclass the oracle.apps.fnd.framework.server.OAEntityImpl class (you will see a bit later that the PL/SQL entity objects extend specialized versions of OAEntityImpl). There is a one-to-one mapping between a table and an entity object, and all Oracle E-Business Suite entity objects should include all columns in their associated tables. Entity objects use a declarative mapping between their attributes and underlying database columns to automatically implement queries, inserts, updates and deletes. In most cases, all you need to do is add the validation logic. 89
  • 90. Oracle Application Framework Developer's Guide An entity object is intended to be used by any program (not just an OA Framework client) that needs to interact with a given table. As such, it should consolidate all the validation logic for the entity object so business rules are consistently implemented regardless of which client exercises them. Association Objects If you have complex objects (like a 3-level purchase order with a 1:many relationship between headers, lines and shipments) you can also define relationships between the corresponding entity objects by creating association objects. You can create weak associations (a purchase order header "references" a supplier which exists independently of any given purchase order) and strong composition associations (a purchase order header "owns" its lines, which cannot exist outside the context of their header). View Objects (and View Links) In the simplest terms, a BC4J view object encapsulates a database query. After a query is executed, a view object provides iteration over and access to its result set. The result set contains one or more view rows, where a view row comprised of individual attributes corresponds to a row returned by a database query. Figure 4: Basic model architecture - View Objects associations All view objects that you create subclass the oracle.apps.fnd.framework.server.OAViewObjectImpl class. Each view object can be configured to query data using one of the following strategies: 90
  • 91. Oracle Application Framework Developer's Guide, Release 12.1.3 • Its attributes map to columns in a simple SQL statement (commonly used for small, read-only view objects) • Its attributes map to entity object attributes (used to insert, update and delete entity objects) • Some attributes map to entity objects, and some are populated directly using SQL (used to augment the entity object data with transient columns that cannot be queried via an entity object -- a calculated value used exclusively for UI display purposes is a common example) In an OA Framework application, you will use view objects in each of the following scenarios (all of which are fully described in later topics): • Present data that is optimized for a particular user interface. If the user interface supports entity object inserts, updates and deletes, you will interact with the view object to perform these tasks. • Create simple queries for poplists, lists of values and other supporting UI components • Create efficient "validation queries" that can be used in your business logic. For example, in a purchase order header entity object you might use a validation view object to get the current maximum purchase order line number from the database so it can cache and increment this value as new lines are created. Finally, you will not only define view objects declaratively, but you will write code for them. In a typical case, the code will implement data bindings for complex queries and execute the query (so a view object knows how to "query" itself). View Links Just as you can relate entity objects, you can also create view object associations called view links. For example, you can create a view link between a purchase order header view object and a purchase order lines view object. This can be used at runtime to automatically query the lines when a header is accessed. OADBTransaction Figure 5: Basic architecture model - OADBTransaction 91
  • 92. Oracle Application Framework Developer's Guide * Note: To be completely accurate and consistent, this diagram should include the implementation oracle.apps.fnd.framework.server.OADBTransactionImpl instead of the oracle.apps.fnd.framework.OADBTransaction interface, however, we have chosen to include latter since you will exclusively use the interface in your code. As shown in the diagram above, the OADBTransaction plays a central role in your model code since it encapsulates the JDBC connection/database session associated with a root application module, and directly owns any entity objects that you create (your view objects, owned by the root application module, hold references to their entity objects in their view rows). You will also make regular use of the OADBTransaction in your model code for the following common actions: • Creating a callable statement for executing PL/SQL functions and procedures • Accessing session-level Applications context information like the user's name, id, current responsibility and so on • Accessing an oracle.apps.fnd.framework.OANLSServices object if you need to perform NLS operations like converting server date/time into user date/time and so on Access to the OADBTransaction is provided by the root application module. The View The view formats and presents model data to the user. The Implementing the View document in Chapter 3 discusses all of the following in detail. 92
  • 93. Oracle Application Framework Developer's Guide, Release 12.1.3 Defining the Page At development time, you specify the bean hierarchy for every page using the declarative JDeveloper tool that we introduced in Building "Hello, World!". In Oracle E-Business Suite development, you will work with (and source control) XML file page definitions. When your product is deployed at a customer's site, the OA Framework runs the page definitions out of a database repository. To quickly recap, you use JDeveloper to define pages comprised of regions and items. • Items are simple widgets like buttons, fields, images and so on which contain no children. • Regions are container objects that can hold items and other regions. Examples of regions include headers, tables, and special layout components. • Each region and item that you define has a style property that tells the OA Framework what web bean object to instantiate for it at runtime (and this in turn dictates what HTML is generated for the bean). For example, if you define a region whose style property is "table," the OA Framework will instantiate an oracle.apps.fnd.framework.webui.beans.table.OATableBean. • All pages must have a single top-level region (often called the "root region") whose style is pageLayout. This is instantiated as an oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean. • The sequence in which regions and items appear in JDeveloper page tree (and the corresponding XML file) tells the Framework where to add these objects to the runtime bean hierarchy. Figure 3 below gives a behind-the-scenes look at the kinds of web beans that are instantiated for a simple page. The labels that you see name the underlying web beans. For example, a poplist is instantiated as an oracle.apps.fnd.framework.webui.beans.message.OAMessageChoiceBean, and a submit button is instantiated as an oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean. Figure 4 shows the corresponding page definition. Figure 3: Page with UI components showing names of corresponding web beans 93
  • 94. Oracle Application Framework Developer's Guide Note: The region and item names shown below do NOT comply with the Oracle E-Business Suite naming standards; instead, they are intended to help you translate from the structure to the corresponding web beans. Figure 4: page structure in JDeveloper 94
  • 95. Oracle Application Framework Developer's Guide, Release 12.1.3 Attribute Sets Each region or item can inherit groups of property settings by using attribute sets. An attribute set is a named, reusable collection of properties that can be used by any type of UI object, including regions, items, and other attribute sets. Whenever you create a UI that uses attribute sets, you can override the inherited properties (although this is discouraged in the OA Framework coding standards). To illustrate this concept, in Applications development, each table must have associated attribute sets for each displayable column. These attribute sets include properties like prompt, display width, and so on. • In the OA Framework ToolBox Sample Library/Tutorial, we have a purchase orders table (FWK_TBX_PO_HEADERS) with a primary key column HEADER_ID of type NUMBER that is also displayed to users as the purchase order number. 95
  • 96. Oracle Application Framework Developer's Guide • This table has an associated attribute sets XML package file called FwkTbxPoHeaders that includes all the attribute sets for the table's displayable columns (one attribute set per column). One of the attribute sets is called HeaderId. • The HeaderId attribute set has the Prompt property set to Order Number and the Display Length set to something reasonable like 15. • When we create a page that includes the purchase order number item, we would specify the Attribute Set property to the fully qualified attribute set name /oracle/apps/fnd/framework/toolbox/attributesets/FwkTbxPoheaders/ Headerid Figure 5: Using an attribute set in JDeveloper Component Reuse If you want to incorporate shared objects into your page, you can simply extend them. For example, in the OA Framework ToolBox Sample Library/Tutorial we created a common region (named PoSummaryRN) so the same content could be included in multiple pages without recoding. To add this shared region to a page, we simply created a new region, and 96
  • 97. Oracle Application Framework Developer's Guide, Release 12.1.3 then set its Extends property to the fully qualified name of the shared region: /oracle/apps/fnd/framework/toolbox/tutorial/webui/PoSummaryRN Note: The shared region is not editable in the referencing page, so its items are grayed out in the JDeveloper Structure pane. Figure 6: Extending a region JDeveloper Data Source Binding For beans with any database interaction (query, insert, update and/or delete), you also specify a data source binding to a View Instance Name and associated View Attribute Name. This binding is crucial because the OA Framework uses it to get queried data from, and write user-entered data to, the underlying view object. • The View Instance Name references the underlying view object within the context of its containing application module (all view objects "live" within an application module and are identified by an instance name within its container). For example, if a SuppliersVO view object is identified by the instance name "MySupVO" within your page's root application module, "MySupVO" is the name you would specify here. 97
  • 98. Oracle Application Framework Developer's Guide • The View Attribute Name references the underlying view object attribute that maps to a column. For example, if your SuppliersVO has an attribute "SupplierId" (which maps to the underlying column SUPPLIER_ID), "SupplierId" is the name you would specify here. Defining the Menu All OA Framework applications include menus as described in the Oracle Browser Look and Feel (BLAF) UI Guideline: Tabs/Navigation [ OTN Version ]. You define these menu structures declaratively using Oracle E-Business Suite menu and function definition forms. We'll discuss this in detail later in the Developer's Guide. Just as the OA Framework translates your declarative UI layout into the runtime bean hierarchy, it also includes web beans for the declarative menu definition. Defining Page Flow When dealing with multipage transaction flows, the OA Framework provides a declarative (thereby customizable) alternative to complex, hard-coded controller logic. See Chapter 4: Declarative Pageflow Using Workflow for additional information about this feature. Personalizing Pages The OA Framework also includes a declarative customization infrastructure called the OA Personalization Framework. This is intended to support the customization needs of end users and the product delivery chain (changes for localization, verticalization and so on). Note: As you'll see throughout the Developer's Guide, creating regions and items declaratively is always preferable to creating them programmatically. In fact, you should create components programmatically ONLY if you cannot create them declaratively so customers can personalize your work. The Controller The controller responds to user actions and directs application flow. The Implementing the Controller document in Chapter 3 discusses all of the following in detail. Controllers can be associated with the view at the region level (in more general terms, any OA Framework web beans that implement the oracle.apps.fnd.framework.webui.beans.OAWebBeanContainer interface can have associated controllers). All controllers that you create subclass oracle.apps.fnd.framework.webui.OAControllerImpl as shown in Figure 7 below. The controller class is where you define how the web beans behave. Specifically, you write controller code to: 98
  • 99. Oracle Application Framework Developer's Guide, Release 12.1.3 • Manipulate/initialize the UI at runtime (including any programmatic layout that you are unable to do declaratively) and • Intercept and handle user events like button presses Request Handling When the browser issues an OA.jsp request for one of your pages: 1. The oracle.apps.fnd.framework.webui.OAPageBean (the main OA Framework page processing class) uses the page name to determine which root application module it needs so it can check it out from the application module pool. This application module also checks out a JDBC connection from the connection pool, and the transaction context for the page is established. 2. The user session is validated; if invalid, a login page is displayed (note that this is a simplification; additional details are provided later in the Developer's Guide). 3. Assuming the user is valid, the OAPageBean evaluates request parameters to figure out if it is dealing with an HTTP POST or a GET. Handling a GET Request When the browser issues a GET request to the server for a page (or you manually forward to it), the OA Framework uses the declarative UI definition to build the web bean hierarchy: 1. The OAPageBean calls processRequest() on the page's top-level pageLayout bean, and the entire web bean hierarchy is processed recursively as follows to initialize the web beans (including any associated model components): 1. Each web bean instantiates its controller -- if it has one -- and calls processRequest(OAPageContext pageContext, OAWebBean webBean) on the controller. This is the method you use to construct/modify your page layout, set web bean properties and do any manual data initialization (if, for example, you need to perform an autoquery when you navigate to the page). 2. Some complicated web beans (like the oracle.apps.fnd.framework.webui.beans.table.OATableBean and oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBe an) perform post-controller processing by calling their prepareForRendering() methods (this method is described in the corresponding bean Javadoc). 3. Each web bean calls processRequest() on its children. 2. The oracle.apps.fnd.framework.webui.OAPageBean gives the web bean hierarchy to UIX to render and send to the browser. Handling a POST Request When the browser issues a POST request to the server for a page: 1. The OAPageBean checks to see if the web bean hierarchy is in memory. If not (because resources were reclaimed, the user navigated with the browser Back button, or a POST 99
  • 100. Oracle Application Framework Developer's Guide is issued to the main page from a dialog message page), it recreates the hierarchy as described in the GET processing above. 2. The OAPageBean calls processFormData(OAPageContext pageContext, OAWebBean webBean)on all the beans in the hierarchy to write the form data to the model (specifically, it calls processFormData() on the pageLayout region, and then each web bean recursively calls processFormData() on its children). Writing the form data to the underlying model automatically invokes attribute and entity-level validations, and if you throw any validation exceptions, processing stops and error messages are displayed to the user. 3. If no exceptions are thrown during the processFormData() phase, OAPageBean calls processFormRequest(OAPageContext pageContext, OAWebBean webBean) on all the beans in the hierarchy using the same approach described above. This pass gives your controller code the opportunity to respond to user actions. 4. If no JSP forwards or page redirects were issued -- or exceptions were thrown in processFormRequest() -- then the page is refreshed. OAPageContext When the OA Framework receives an OA.jsp request, the OAPageBean creates an oracle.apps.fnd.framework.webui.OAPageContext, a class that exists only for the duration of page processing. Each of the three key methods described above (processRequest(), processFormData() and processFormRequest()) takes an OAPageContext as a parameter, and any controller code that you write will invariably make use of this crucial class. Figure 7: Relationship between the OAPageContext and other key classes As illustrated in the diagram above, the OAPageContext has a reference to both the request and the root application module. Given these relationships, and the fact that an OAPageContext is passed to each of your controller response-processing methods, you can see how you would use the OAPageContext for the following list of common tasks: 100
  • 101. Oracle Application Framework Developer's Guide, Release 12.1.3 Accessing Request Parameters Perhaps most importantly, this is the class that you use to read request values by calling a simple getParameter(String name) method (remember that the request includes any URL parameters plus -- if it is a POST -- any form field values plus the names and events associated with any action/control widgets selected by the user). Tip: For individual web beans on your page (buttons, fields, and so on) the name value passed to getParameter() is the corresponding unique ID that you assign when defining your page. So, for example, you can tell if the user pressed a button that you named "GoButton" in JDeveloper by writing the following code in a controller: processFormRequest(OAPageContext pageContext, OAWebBean webBean) { if (pageContext.getParameter("GoButton") != null) { // The user pressed the "Go" button, do something... } } Accessing the Root Application Module The OAPageContext caches a reference to the root application module, which in turn provides access to its view objects and the transaction. If you need access to an application module, ask the OAPageContext: processFormRequest(OAPageContext pageContext, OAWebBean webBean) { OAApplicationModule am = (OAApplicationModule)pageContext.getRootApplicationModule(); } Issuing Navigation Instructions 101
  • 102. Oracle Application Framework Developer's Guide You use methods on this class to tell the OA Framework to perform a JSP forward or a client redirect. For example (we'll review this method in greater detail later in the Developer's Guide): processFormRequest(OAPageContext pageContext, OAWebBean webBean) { if (pageContext.getParameter("CreateButton") != null) { // The user pressed the "Create Supplier" button, now perform a JSP forward to // the "Create Supplier" page. pageContext.setForwardURL("OA.jsp?page=/oracle/apps/dem/employee/webui /EmpDetailsPG", null, OAWebBeanConstants.KEEP_MENU_CONTEXT, null, null, true, // Retain AM OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // Show breadcrumbs OAWebBeanConstants.IGNORE_MESSAGES); } } Accessing Application Context Information 102
  • 103. Oracle Application Framework Developer's Guide, Release 12.1.3 Like the OADBTransaction in your model code, the OAPageContext provides access to servlet session-level Oracle E-Business Suite context information like the user's name, id, current responsibility and so on. For example, the following code snippet shows how to get the user's name: processRequest(OAPageContext pageContext, OAWebBean webBean) { String userName = pageContext.getUserName(); } Web Bean Architecture First and foremost, all OA Framework web beans subclass corresponding beans in the UIX framework. For example, an OATableBean extends an oracle.cabo.ui.beans.table.TableBean ("cabo" was an earlier name for the UIX framework, and the package definitions still use this old name). Each OA Framework web bean also implements a group of interfaces whose implementations collectively define the behaviors that the OA Framework adds to the base UIX beans. • oracle.appps.fnd.framework.webui.beans.OAWebBean - defines core behavior common to all web beans (for example, among other key behaviors, this defines the processRequest, processFormData, and processFormRequest methods that individual beans implement for themselves). • oracle.apps.fnd.framework.webui.OAWebBeanConstants - a collection of constants used in the view/controller modules • oracle.apps.fnd.framework.webui.beans.OAWebBeanData - defines common personalization definition and data source management behavior • oracle.apps.fnd.framework.webui.beans.OAWebBeanContainer - defines the characteristics of all web beans that can act as containers for other web beans. For instance, all the layout web beans implement this interface. Only beans which implement this interface can have associated controllers. • OAWebBean<Type> - defines a bean's inherent behaviors within the context of the OA Framework. For example, the OATableBean implements the oracle.apps.fnd.framework.webui.beans.OAWebBeanTable interface. Figure 8: Example of a container web bean (OATableBean) 103
  • 104. Oracle Application Framework Developer's Guide Internal Bean Structure Each web bean maintains the following information about itself: • _indexedChildren - child web beans • _namedChildren - child web beans that UIX tags for special behavior • _attributes - web bean characteristics (descriptive properties) as illustrated in Figure 9 below Figure 9: Illustration of web bean use of a Dictionary to track key/value pairs of its attributes 104
  • 105. Oracle Application Framework Developer's Guide, Release 12.1.3 Data Bound Values Instead of literal values as illustrated in Figure 9 above, OA Framework web bean attributes are actually implemented as data bound values, meaning that the value is provided by an underlying data source that is resolved to the component at rendering time. You will see a bit later how to define and use custom bound values in your code. Rendering At page rendering time, the UIX framework processes the web bean hierarchy to generate the page HTML. For each web bean attribute, UIX calls its getAttributeValue() method while passing it a rendering context (a rendering context is basically all the information that UIX needs to resolve bound values). For a given attribute, for example, the rendering context knows what the underlying view object instance, view attribute and current row are. The data bound value uses the information supplied by the rendering context to interrogate its data source, and returns the actual value to UIX so it can generate the corresponding HTML. Guide to OA Framework Javadoc You've probably already noticed that the Developer's Guide links directly to the OA Framework Javadoc for individual classes. Given that you now have a high-level understanding of the components that you'll be using when you build a page, this section briefly summarizes the purpose of each OA Framework package and describes when you're likely to use the Javadoc for the corresponding classes/interfaces. oracle.apps.fnd.framework Contains classes and interfaces which can be safely accessed from model (server) and user interface controller or view (client) code. For example, if you need to access a root application module in your page, you will use the oracle.apps.fnd.framework.OAApplicationModule interface (you will never access an implementation on the client). Among other things, this package also includes: • All OA Framework exceptions that you might have occasion to throw • The OANLSServices class that you will use to perform internationalization operations oracle.apps.fnd.framework.server Contains classes and interfaces for implementing the model in an OA Framework Model-View- Controller application. These classes are intended to be used with any client user interface (not just OA Framework HTML pages), and as such should have no direct references to any classes and interfaces 105
  • 106. Oracle Application Framework Developer's Guide published in the oracle.apps.fnd.framework.webui package and subpackages, or in any application-specific webui packages and subpackages. When building an OA Framework application model, you should always work with the classes in this package instead of the BC4J classes they extend. Warning: Never call any classes in this package from controller or view code. oracle.apps.fnd.framwork.webui Contains core classes for building and manipulating OA Framework HTML user interfaces. Some of the most commonly used classes/interfaces in this package include: • OAController • OAPageContext • Any class in the beans subpackages described below Warning: Never call any classes in this package from model code. oracle.apps.fnd.framework.webui.beans Contains web bean classes for user interface components that don't fit neatly into the various bean subpackages (for example: image, switcher, static instruction text, key flexfield, descriptive flexfield and more). You should use these classes when writing a user interface controller that needs to programmatically manipulate the web beans. This package also contains core OA Framework interfaces implemented by all web beans. The classes in this package and its subpackages correspond to the UIX components they extend as shown below. When building OA Framework application pages, you should always work with the OA Framework classes unless a new feature that you want to use has been introduced in UIX, and is not yet supported by the framework. Note: OA Framework classes are always instantiated for MDS pages that you build declaratively in JDeveloper. UIX Package OA Package oracle.cabo.ui.beans oracle.apps.fnd.framework.webui.beans oracle.cabo.ui.beans.form oracle.apps.fnd.framework.webui.beans.form oracle.cabo.ui.beans.include oracle.apps.fnd.framework.webui.beans.include oracle.cabo.ui.beans.layout oracle.apps.fnd.framework.webui.beans.layout oracle.cabo.ui.beans.message oracle.apps.fnd.framework.webui.beans.message oracle.cabo.ui.beans.nav oracle.apps.fnd.framework.webui.beans.nav oracle.cabo.ui.beans.table oracle.apps.fnd.framework.webui.beans.table 106
  • 107. Oracle Application Framework Developer's Guide, Release 12.1.3 Warning: Never call any classes in this package from model code. oracle.apps.fnd.framework.webui.beans.form Contains web bean classes for HTML form components including a submit button and various data entry/specification controls (checkbox, radio group, shuttle, text input field and more). You should use these classes when writing a user interface controller that needs to programmatically manipulate the web beans. For many of the web beans in this package there are variants in the oracle.apps.fnd.framework.webui.beans.message package (the message web beans have the ability to display error, information, and warning icons with an explanatory message whereas corresponding data entry/specification web beans in this package do not). When you create your pages declaratively in JDeveloper, the OA Framework automatically instantiates message beans for any of those components that exist in both packages. You should use the classes in this package only in the following cases: • The class doesn't have a message bean alternative (for example, the OASubmitButtonBean exists only in this package) • You cannot use the message bean alternative Warning: Never call any classes in this package from model code. oracle.apps.fnd.framework.webui.beans.include Contains web bean classes for including user interface fragments from external sources (servlets, JSP pages, and plain HTML) in OA Framework application pages. You should use these classes when writing a user interface controller that needs to programmatically manipulate the web beans. Warning: Never call any classes in this package from model code. oracle.apps.fnd.framework.webui.beans.layout Contains web bean classes for laying out content in an OA Framework application page, including special layout components like hide/show, content containers, bulleted lists, headers, standardized templates for single/double column layouts and more. You should use these classes when writing a user interface controller that needs to programmatically manipulate the web beans. Warning: Never call any classes in this package from model code. oracle.apps.fnd.framework.webui.beans.message Contains web bean classes for HTML form data entry/specification components that are capable of displaying associated error, warning or information icon(s) with an explanatory message (for example, if a user enters the wrong value in a text input field an error icon renders 107
  • 108. Oracle Application Framework Developer's Guide next to its prompt). You should use these classes when writing a user interface controller that needs to programmatically manipulate the web beans. Many of the web beans in this package are also included in the oracle.apps.fnd.framework.webui.beans.form package without the ability to display the supplemental message icons and text. When you create your pages declaratively in JDeveloper, the OA Framework automatically instantiates message beans for any of those components that exist in both packages. You should use the classes without the message capability only if you cannot include message beans in your page. Warning: Never call any classes in this package from model code. oracle.apps.fnd.framework.webui.beans.nav Contains web bean classes for HTML user interface navigation components (links, trees, menu elements, quick links, breadcrumbs and more). You should use these classes when writing a user interface controller that needs to programmatically manipulate the web beans. Warning: Never call any classes in this package from model code. oracle.apps.fnd.framework.webui.beans.table Contains web bean classes for tables (which present data to the user in a tabular format) and HGrid components (a hybrid of tabular data display with treelike hierarchical structure). You should use these classes when writing a user interface controller that needs to programmatically manipulate the web beans. Warning: Never call any classes in this package from model code. oracle.apps.fnd.framework.webui.laf Contains utilities that can be used for controlling HTML rendering characteristics including the page's look-and-feel and context-specific behavior (for example, content can be optimized for printing versus display in a regular browser or in an e-mail). Warning: Never call any classes in this package from model code. 108
  • 109. Oracle Application Framework Developer's Guide, Release 12.1.3 OA Framework State Management Overview This document describes the OA Framework state management architecture, including the mechanisms used for caching application custom data and communicating values from one page to the next. Contents • Architectural Overview • Root Application Modules (Database Session and Transaction State) • Servlet Session • Oracle E-Business Suite User Session • Page Context • Request • State Persistence Model ("Passivation") • Application Module Pooling Architectural Overview Figure 1 provides a conceptual application developer's view of the OA Framework state management components. Each component shown in the illustration is discussed below. Note: It is not intended to reflect all internal OA Framework details. Figure 1: OA Framework primary state management components 109
  • 110. Oracle Application Framework Developer's Guide Root Application Modules (Database Session and Transaction State) 110
  • 111. Oracle Application Framework Developer's Guide, Release 12.1.3 As described in the OA Framework Page Anatomy document, each OA Framework page is associated with a root application module that provides its transaction context and JDBC database connection. Note: In terms of OA Framework, a database session is associated with a JDBC connection. The root application module is the backbone of any OA Framework module because the core application data (as stored in BC4J view objects, entity objects, and so on) and the page's web bean hierarchy are automatically cached on the root application module's oracle.apps.fnd.framework.OADBTransaction object. Warning: The use of the browser Back button can cause the loss of application module state. Be sure to review the advanced topic Supporting the Browser Back Button before you start coding. The OA Framework coding standards published in Chapter 8 also include specific recommendations for dealing with this. Any data stored on the transaction is accessible to all pages that share the same root application module instance (assuming that navigation between them involves retaining this application module as described below). OA Framework provides methods that you can use to store, retrieve and remove custom application values to/from a transaction. Since a single transaction can be accessed from both controller (client) and model (server) code, these utilities are provided in both the oracle.apps.fnd.framework.webui.OAPageContext (for the controller) and OADBTransaction (for the model) classes. Root Application Module Retention By default , when the user navigates from one page to the next (such as with a GET request or a JSP forward), and OA Framework renders the new page, the application module instance associated with the previous page is "released," and a new instance is requested from an application module pool. (See Application Module Pooling below). Figure 2: Conceptual illustration of default root application module release when navigating to a new page 111
  • 112. Oracle Application Framework Developer's Guide Note: OA Framework never releases application modules during form submit (POST) requests unless you explicitly release the application module in a controller. For example, if a user sorts a table or navigates the result set within a table -- two actions that implicitly submit the page form -- the page's root application module instance is automatically retained. Retaining the Application Module Across Pages The default behavior as described above is desirable for individual pages that comprise an isolated, complete task. However, it is not appropriate for a multi-page flow that implements a single task, or a series of related pages participating in a virtual transaction. In these cases, the different pages should be associated with the same root application module instance. Figure 3: Conceptual illustration of related pages sharing a root application module (and transaction) 112
  • 113. Oracle Application Framework Developer's Guide, Release 12.1.3 To achieve this, you must do the following: • Declaratively associate the same root application module type with each page in the multi-page flow. (See Implementing the View for additional details on specifying this page property in JDeveloper) • Set the application module retention flag for a page by specifying the URL parameter retainAM=Y. For GET requests. This flag is evaluated when a new page is rendered (as mentioned above, OA Framework always retains the application module for POST requests regardless of the retainAM parameter value). If set to "Y," the previous page's application module instance will be retained. If set to "N" (or not specified, which implies "N"), OA Framework releases all application modules -- including any that might have been explicitly retained before reaching this point. You also set this parameter when calling JSP forward OAPageContext methods. See Implementing the Controller for additional details on controlling this programmatically. Warning: It is not enough to simply associate the same root application module with each page. If you forget to set the retainAM flag, each page will have a different application module instance -- and transaction -- even though they are associated with the same application module type. Note: Technically, depending on the state of the application module pool, Page B could get a reference to the same physical application module instance that Page A used. However, the object's state will be completely reset as if created anew. For the purposes of this discussion, consider it a "new instance." 113
  • 114. Oracle Application Framework Developer's Guide Figure 4: Conceptual illustration of two pages referencing the same root application module type, but the Retain AM flag is not properly set Similarly, setting the retainAM flag to "Y" -- but associating a different root application module type with each of the page -- accumulates several different application module instances (one for each page), each with its own transaction. Conditionally Retaining/Releasing an Application Module In some situations, you need to make a conditional determination about whether an application module should be released or not. In these cases, you can implement the oracle.apps.fnd.framework.webui.OAReleaseListener interface for individual application modules as described in the Javadoc. Warning: Oracle E-Business Suite developers should not use this interface without first alerting the OA Framework development team. The incorrect use of this interface can lead to inadvertent memory leaks, and the OA Framework team is currently tracking all implementations. Explicitly Releasing an Application Module There are also times when you will want to explicitly release a root application module before OA Framework would normally do this. Specifically, when you call the OAPageContext.releaseRootApplicationModule() method in one of your page's controllers, OA Framework releases the page's root application module as soon as it finishes rendering the page, instead of waiting until the next application module request. 114
  • 115. Oracle Application Framework Developer's Guide, Release 12.1.3 Root Application Module Retention Use Case Scenarios The following use cases illustrate recommended approaches to application module retention/release. Use Case Recommendation Unrelated, Discrete When navigating between unrelated pages that present complete, Tasks discrete tasks do not retain the application module. For example, a series of unrelated administration tasks that are typically performed in isolation (even if they are associated with the same menu item) are unlikely to benefit from application module retention. Multi-page Flow When navigating between related pages that cooperatively comprise a complete task within a single transaction, retain the application module. Related Pages (Virtual When navigating between related pages that perform different tasks Transaction) associated with the same business object (even if the pages present different commit points to the user), retain the application module if the pages are closely associated in the UI. For example, a module that lets you query, view, update, delete and print purchase orders benefits from application module retention. Multi-page Flow with Having a multi-page flow with a branch transaction such as, creating a Branch Transaction supplier while creating a purchase order, retain the application modules in the main purchase order flow and use the OAPageContext.releaseRootApplicationModule method in the Create Supplier page. Note: Before passivation and JDBC connection pooling/harvesting was introduced in OA Framework, developers were urged to release the application module with greater frequency because it was expensive to hold on to the JDBC connections. This is no longer a consideration if you are leveraging the passivation feature. Servlet Session As mentioned in the JSP Application Primer, a servlet session is a mechanism for maintaining state between HTTP requests during a period of continuous interaction between a browser and a web application. A session may be initiated at any time by the application, and terminated by the application by the user closing the browser or by a period of user inactivity. A session usually corresponds to an application login/logout cycle, but that is not strictly true in the case of OA Framework applications. (See the Oracle E-Business Suite User Session below). You have the option of caching small, serializable objects (the OA Framework restricts this to Strings, Numbers and Dates) on the servlet session; any data that you cache is accessible to all pages rendered within the session. For example, use this approach if you want to use information that is too expensive to retrieve from the database each time it is required. Note: Use the session cache only when you need to set and access simple values in many pages, which have different root application modules. (The transaction cache discussed above isn't an option). Be aware that servlet session values are not cleared automatically 115
  • 116. Oracle Application Framework Developer's Guide unless the user logs out, returns to the global Home page to start a new transaction flow, or the servlet session times out. Therefore, you must explicitly remove the session values that are no longer needed. For this reason, consider the session a last choice for caching since there is no good event point for freeing memory if the user simply abandons the session without logging out. Tip: Experienced JSP developers may wonder why hidden form fields aren't recommended instead. Due to the way that OA Framework currently implements menus (some menu selections issue a GET instead of a POST), it is not always possible to add values to the corresponding request when a user navigates by making a menu selection, and root application module boundaries are crossed. If you want to store, retrieve and remove values from the servlet session, see the OAPageContext put*(), get*() and remove*() methods for session values. Oracle E-Business Suite User Session When the user logs in to an OA Framework application, the OA Framework creates an AOL/J oracle.apps.fnd.common.WebAppsContext object and a browser session-based cookie that together keep track of key Oracle E-Business Suite context information like the current responsibility, organization id and various user attributes such as user name, user id, employee id and so on. • The cookie contains an encrypted key identifier for a session row stored in the Applications database. Specifically, this is the servlet session ID which, in its decrypted form, serves as the primary key in the ICX_SESSIONS table. • The WebAppsContext retrieves this key value after each request and uses it to query the current session state. • The Oracle E-Business Suite user session is associated with a servlet session, however, it has its own life cycle and time-out characteristics. (See Appendix B: Profile Options for additional information about configuring the user session characteristics): o Generally, the Oracle E-Business Suite user session has a longer life span than the servlet session. The servlet session should time-out sooner. o An Oracle E-Business Suite user session might be associated with multiple servlet sessions. For example, the servlet session times out while the user takes a phone call in the middle of creating an OA Framework expense report, then resumes work before the Oracle E-Business Suite user session times out. • If the Oracle E-Business Suite user session times out, as long as the user does not close the browser window (so the browser session-based cookie isn't lost) and no one deletes the corresponding session row in the ICX_SESSIONS table, the user can resume her transaction at the point where she stopped working after being prompted to log back in. If you need access to any of the information stored with the Oracle E-Business Suite user session, obtain it from OAPageContext (in your controller code) or OADBTransaction (in your model code). Applications Context State 116
  • 117. Oracle Application Framework Developer's Guide, Release 12.1.3 You can also use the Applications context to store some state when you don't have access to an OAPageContext (this is the case for Java server tier code or PL/SQL). To do this, use the WebAppsContext.setSessionAttribute(java.lang.String pName, java.lang.String pValue) method. For additional information, see the WebAppsContext Javadoc. Page Context Each time a request is received for a page, OA Framework creates an OAPageContext that persists until a new page finishes processing. Specifically, the OAPageBean -- which is the primary force behind page processing -- creates the OAPageContext. Request and Page Boundaries As described in the JSP Application Primer document, a web application's unit of work is a request/response pair: the browser submits a request, the servlet processes the request and returns a response. The transmission of a response signifies the end of a single request, or the "boundary" between the completed request and a new one. Similarly, when the OAPageBean finishes processing a page, this is the "boundary" between the current page and a new one. So, in the following simple scenario where a user navigates from Page X to Page A and then to Page B, there are two request boundaries: the first is between Page X and Page A, the second is between Page A and Page B. There are also two page boundaries in the same conceptual location between Page X and Page A, and Page A and Page B. Figure 5: Conceptual illustration of request and page boundaries being the same 117
  • 118. Oracle Application Framework Developer's Guide In some situations, however, the request and page boundaries are not the same. Consider the following JSP Forward case: • The user navigates from Page X to Page A as illustrated in Figure 5 above. • While on Page A, the user selects a control that the Page A code must evaluate before deciding which page to display in response. The browser issues a request to Page A, which OA Framework processes, including creating an OAPageContext for the page. 118
  • 119. Oracle Application Framework Developer's Guide, Release 12.1.3 Once Page A finishes processing, the first page boundary is reached as illustrated in Figure 6 below. • Within the Page A code, the developer evaluates which control the user selected and issues a JSP Forward to Page B. Instead of providing an HTTP response at this point since we don't want to redisplay Page A, OA Framework begins processing for Page B, including creating a new OAPageContext for this page. Once Page B finishes processing, the second page boundary is reached. • Since Page B must now be displayed to the user, an HTTP response it sent to the browser. The request boundary is now reached. Figure 6: Conceptual illustration of request and page boundaries differing in the JSP Forward case It is important to understand this distinction for several reasons: • Request parameters exist throughout the life span of the request -- which can span multiple page boundaries. This can be somewhat surprising for new OA Framework developers who simply assume that a request and a page are the same thing, and therefore do not account for request parameters "hanging around" after performing a JSP Forward. Consider the following example: o A user selects a link in Page X that navigates to Page A. The Page A URL includes the parameter foo=bar. 119
  • 120. Oracle Application Framework Developer's Guide o Page A issues a JSP Forward to Page B. Now, even though we are in a new page, the request still includes the value foo=bar. o If you don't want a parameter value on the request after doing a JSP Forward, you must explicitly replace it. For example, in this case, simply reset the value to something like foo=X when you call the OAPageContext's setForward*() method. Note: You cannot actually remove parameters from a request. Tip: It is preferable to replace the unwanted parameter value with a new one that your code can use as an "ignore" value. Do not simply set the value to "". • Since there isn't a one-to-one mapping between the page context and the request, some people find it a bit confusing that you access request parameters from the OAPageContext. Just remember that each page is a distinct entity, and from its "point of view," the OAPageContext represents the request. • When you get into the details of passivation in Chapter 6, you'll see that page and request boundaries are distinct event points with different passivation implications. Request Although short-lived, an object is created for each HTTP request. This object contains the following application state: • Any URL parameters, regardless of whether the browser issued a POST or a GET request • Assuming the browser issues a POST request: any form field data values such as, the data a user enters into a text field or the data a developer stores in a hidden field. • Assuming the browser issues a POST request: the web bean and event names associated with a user's selection of action/control components. For example, if the user selects a "Go" button to execute a query, the request includes the web bean name of this button so you can ascertain that it was pressed and respond accordingly. To access any of these request values, use OAPageContext getParameter*() methods. You will not interact directly with the request itself. To put values on the request (the preferred way of communicating between pages) you can do any of the following. See Implementing the View and Implementing the Controller for additional information about working with request parameters. Note: The following is a general description of the request-passing mechanisms; there are browser Back button considerations related to each of these techniques that you should fully understand before building your pages. See Supporting the Browser Back Button in Advanced OA Framework Development Topics. Use Hidden Fields 120
  • 121. Oracle Application Framework Developer's Guide, Release 12.1.3 A "hidden" field is a tool for developers to get/set values on a form that can't be accessed by the user. Just as the user's field values are added to the request during a form submit, so are the developer's field values -- assuming your page issues a POST. You can create hidden fields declaratively in JDeveloper by selecting the formValue item style. At runtime, these are instantiated as an oracle.apps.fnd.framework.webui.beans.form.OAFormValueBean. Specify Values During JSP Forward/Client Redirect When you explicitly forward to a new page using the OAPageContext setForward*() methods or issue a client redirect by calling OAPageContext.sendRedirect(), you can optionally set request parameter values. For example, Page A includes a submit button. When this button is selected, the user navigates to Page B using a JSP Forward. Page A needs to pass a "mode" value to Page B, which can be accessed several different ways so it knows how to behave. 1. The user selects the submit button. 2. In the Page A controller that handles this button press, we call OAPageContext.setForwardURL() in the processFormRequest() method. As part of this method call, we pass a request parameter named queryMode with a value of automatic. 3. In a Page B controller we check for the queryMode parameter value in the processRequest() method by calling getParameter("queryMode"). 4. Page B's controller then responds to the fact that the queryMode value is automatic by immediately querying the data the page should display. Specify Values by Calling OAPageContext.putParameter() OAPageContext includes a putParameter() method that is used for passing values down the web bean hierarchy during page processing. Values specified with a call to putParameter() are not technically added to the request, but are stored in a special page cache. Tip: For those familiar with the HttpServletRequest.setAttribute() method in the Java servlet 2.1 API, which is simply a way of stashing some information on the HTTP request, consider this its equivalent. Set URL Parameters Declaratively Specify request parameter values when defining URLs declaratively in JDeveloper or by setting the URL programmatically on web beans that have associated URLs. Warning: The URL is space-constrained; be cautious about adding numerous URL parameters, particularly if they are lengthy. Since the URL is visible to users, encrypt any sensitive values as described later in Chapter 3. 121
  • 122. Oracle Application Framework Developer's Guide State Persistence Model ('Passivation') OA Framework applications are largely transaction-oriented. Many transactions span multiple pages, and these multi-page transactions require a certain amount of state to be preserved until the user completes the associated task. For example, consider a multi-page purchase order creation flow where the user describes the order in the first page, enters one or more line items in the second page, and reviews the order before submitting it in the third page. The purchase order data (its state) must remain intact between each of the browser requests for the transaction to be completed successfully. The HTTP protocol is inherently stateless; it does not retain any application-specific state information or guarantee any support for state persistence. Furthermore, if the JVM instance that provides the servlet session fails (in a stateful web application server deployment mode) -- or the servlet session times out -- application state is permanently lost, and pending transactions cannot be recovered. OA Framework incorporates the ability to transparently save and restore client state while the user works -- even if the servlet session times out (a future release will provide JVM failover support): • The process of saving application state to a secondary medium (in the case of OA Framework, database tables) is called passivation. • The process of restoring this state from the secondary medium is called activation. Specifically, OA Framework currently provides the following state management features. • Scalable Applications - when resource consumption is high, rather than creating a new dedicated resource instance for each new server thread, OA Framework saves application state for idle threads and reclaims their resources for use by others. When the idle user thread wakes up, the saved application state is restored. In short, memory is reclaimed for idle JDBC connections, application modules, and user sessions without adversely affecting the user experience. • Servlet Session Time-Out Recovery - servlet sessions can time out without forcing the user to restart an incomplete transaction. (In the future, this feature will be extended to provide middle-tier failover support. For information about enabling/configuring passivation in your system, including a detailed explanation of what data is -- and is not -- passivated, see Chapter 6 - OA Framework State Persistence Model (Passivation). Application Module Pooling To improve performance and scalability, OA Framework pools (caches and reuses) application modules. Reuse is much more efficient than recreation. In simple terms: • Each Java Virtual Machine (JVM) has an application module pool manager that contains and manages individual application module pools. • Each application module pool contains multiple instances of the same application module. For example, if an application uses two root application modules 122
  • 123. Oracle Application Framework Developer's Guide, Release 12.1.3 (oracle.apps.fnd.framework.toolbox.tutorial.server.Lesson3AM and oracle.apps.fnd.framework.toolbox.tutorial.server.Lesson4AM), there would be two application module pools as shown in Figure 7 below. In other words, a pool is created for each root application module type in your product. • Application module instances within the pool are designated as being available for use, or unavailable (currently "checked out"). • Only root application modules are pooled; nested application modules are pooled as children of the root application module. To learn more about how this works for both application modules and connections, including how to configure, monitor and optimize pool performance in an OA Framework application deployment, see the Chapter 6 advanced topic Application Module and Connection Pooling. In particular, focus on the sections titled Architectural Overview and Application Module Pooling in this topic. Figure 7: Conceptual illustration of application module pool 123
  • 124. Oracle Application Framework Developer's Guide 124
  • 125. Oracle Application Framework Developer's Guide, Release 12.1.3 Chapter 3: Building an OA Framework Application (the Basics) Implementing the Model Overview This document describes how to implement your model objects in generic terms. Contents • Designing Model Objects • Recommended Build Approach • Business Components Packages • Entity Objects • Entity Associations (Association Objects) • View Objects and View Rows • View Links • Application Modules • Entity Objects, Entity Experts, 'Validation' Application Modules and 'Validation' View Objects o Validation View Objects (VVOs) o Validation Application Modules (VAMs) o Entity Experts • Reusing Business Objects Prerequisite Reading This document assumes that you have read the following in the OA Framework Developer Guide: • Building 'Hello, World!' • JSP Application Primer • Anatomy of an OA Framework Page • OA Framework State Management Designing Model Objects 'Client' / 'Server' Code Separation Within the Model-View-Controller architecture, OA Framework draws a clear distinction between "client" and "server" classes, a distinction that on the surface may seem to conflict with JSP application architecture as described in the JSP Application Primer. In Chapter 2, we say that a typical JSP application has 3 physical tiers: 125
  • 126. Oracle Application Framework Developer's Guide • The browser (the client where our HTML renders and users interact with the UI) • The web application server (the middle tier where our UI web bean hierarchy is constructed and our application business logic executes) • The database server Within the middle tier, OA Framework draws a further distinction between "client" and "server" classes as follows: • Client classes (View and Controller code) drive the HTML user interface • Server classes (Model code) supports any client (not just OA Framework) user interfaces This distinction is important because it preserves the ability to use server code with different clients. Consider the following image which illustrates the relationships between a page's UI controllers, application modules, UI-specific view objects, and the underlying entity objects: Figure 1: OA Framework "onion" showing code layers and boundaries In general, to enable reuse at the layer boundaries, objects reference down the dataflow stack, but not up. • Model code should never reference controller code directly. For example, view objects and application modules should not call methods in your UI controllers, and entity objects should not reference UI application modules and view objects, as discussed later. However, entity objects can and do make use of server-side validation application modules and view objects. • Never reference/import any server-side implementation classes or interfaces on the client-side (classes/interfaces that are in the oracle.apps.fnd.framework.server 126
  • 127. Oracle Application Framework Developer's Guide, Release 12.1.3 package). For example, do not call methods on an oracle.apps.fnd.framework.OADBTransaction in your UI controller. • If you need the server code to do some work for you, always route your calls through the root application module using the generic "remoteable" invokeMethod() method on the oracle.apps.fnd.framework.OAApplicationModule interface, or create an interface for your application modules so you can call typed methods, whose invocation can be checked at compile time. The application module can delegate or implement the logic as required. • Note: The OAApplicationModule interface is in the oracle.apps.fnd.framework package and therefore, does not violate the rule stated in the first sentence of this bullet- point. All classes, interfaces, and exceptions in the oracle.apps.fnd.framework package can safely be used in both client and server code. If you opt to create an interface for your application module instead of using invokeMethod(), create this interface in the package directory immediately above your implementation. For example, the EmployeeAM interface for the oracle.apps.fnd.framework.toolbox.labsolutions.server.EmployeeAMI mpl application module should be created in the oracle.apps.fnd.framework.toolbox.labsolutions package. • Never include JDBC or other server-side processing directly in your client code. Again, if the UI client needs information from this server it should ask the application module, which can then delegate or implement the request appropriately. Coding Standards Compliance Before defining any model objects or writing supporting code, read the following documents carefully. While this topic mentions several key model standards, it is not intended to be a comprehensive checklist. For any OA Framework code that you write, the documents in Chapter 8 should be considered the single source of truth for coding standards. • Chapter 8: Oracle E-Business Suite Java Coding Standards • Chapter 8: OA Framework Naming / File / Package / Directory Structure Standards • Chapter 8: OA Framework Model Coding Standards Recommended Build Approach If you are preparing to build your first OA Framework application , you might find it easiest to proceed as follows for a small module (a single page, or a few simple, related pages that participate in the same transaction). Note: This assumes you have completed your design work, and are ready for implementation. It also assumes that you are building a complete module, not just the UI, or just the business logic. 1. Create any business components packages that you need for your BC4J model objects. 2. Implement declarative BC4J application module, entity object, entity association, view object and view link definitions needed for your page(s). Add view objects to your root application module(s) as appropriate. Don't worry about writing code at this stage. 127
  • 128. Oracle Application Framework Developer's Guide 3. Create the menu definition for your application (discussed in Implementing the View). 4. Create the OA user interface components for your page(s) (discussed in Implementing the View). 5. Create and implement controller code (discussed in Implementing the Controller). 6. Implement UI application module code supporting your pages. 7. Implement entity object business logic. Business Components Packages All BC4J model components must belong to a Business Components (BC4J) package. Note: This section assumes that you have set up your development environment, created an OA Workspace, and defined a working datasource as described in Building and Running "Hello, World!". 1. In the JDeveloper Navigator, select the OA Project where you want to create your package. 2. From the main menu, choose File > New to open the New Object Gallery. 3. In the Categories tree, expand the Business Tier node, and select Business Components (BC4J). 4. In the Items list, select Business Components Package to open the Business Components Package Wizard. You can also right-click on the OA Project and select New Business Components Package to navigate directly to the Business Components Package Wizard. 5. In Step 1 of 3, enter a Package Name that complies with the OA Framework File / Directory / Package Structure standards. Also select Entity Objects mapped to database schema objects in the business entity modeling section. Select the Next button. 6. In Step 2 of 3, verify your Connection Name (it should point to the database where you want to work; JDeveloper uses this information in all of the BC4J component wizards). Set the SQL Type and the Type Map to "Oracle." 7. Select the Finish button to save your changes. To change the database connection associated with an existing BC4J package, which you need to do if you change your development environment: 1. Select the OA Project with the business components package you want to edit. 2. Right-click and select Edit Business Components Project. 3. In the Business Components Project Wizard, select Connection. 4. Specify your new database. 5. Select OK to save your changes. Entity Objects This introduces the basics of entity object creation/usage. See Java Entity Objects and PL/SQL Entity Objects in Chapter 5 for additional information about working with these objects. As described in Anatomy of an OA Framework Page, an entity object implements the business rules for a given table, view, or snapshot. Entity objects are intended to be used in many clients 128
  • 129. Oracle Application Framework Developer's Guide, Release 12.1.3 (not just an OA Framework UI), and as such, should consolidate all of the relevant validation/behavior for the table. • Each table should have at most one entity object. • Entity objects should include attributes for all columns in its table. • You can subclass your own common entity objects (for example, see the Advanced Model Development Topics in Chapter 6 to learn how to create polymorphic entity objects that extend a common base class). • You will commonly add object initialization, attribute validation, entity-level validation, and other functional behaviors to your entity objects. • You can also create "entity expert" singletons to perform work shared by multiple related entity objects in a composite business object, such as a purchase order which has a header, lines and shipments. Other referencing entity objects can also use the entity expert to perform lightweight validations (for example, a purchase order might ask a supplier's entity expert if a supplier id that it wants to reference is valid). Entity experts are discussed later. • Finally, you can create server "helper" objects and interfaces as needed to create modular code. For example, as illustrated in the OA Framework ToolBox Tutorial, you can create one or more helper objects to perform processing on multiple entity object types. Declarative Implementation For additional information about Entity Object Wizard properties not specifically described here, see the JDeveloper documentation. Note: You can access context-sensitive Help while in any of the BC4J wizards by selecting the F1 key on your keyboard. To create a new entity object in a Business Components (BC4J) package: 1. In the JDeveloper Navigator, select the BC4J package where you want to create your entity object. 2. From the main menu, choose File > New to open the New Object Gallery. 3. In the Categories tree, expand the Business Tier node, and select Business Components (BC4J). 4. In the Items list, select Entity Object to open the Entity Object Wizard. You can also right-click on the BC4J package and select New Entity Object to navigate directly to the Entity Object Wizard. 5. In the Name page (Step 1 of 5): Figure 2: Entity Object Wizard Name Page (Step 1 of 5) 129
  • 130. Oracle Application Framework Developer's Guide o Specify the entity object's Name in accordance with the OA Framework File / Directory / Package Structure standards. o Verify that you have selected the right BC4J Package. o Do not enter a value in the Extends Entity Object field unless you are deliberately subclassing one of your own entity objects. o Specify a Schema Object (the exact name of the table for the entity object) as shown in Figure 2, to improve the wizard's performance. You do not need to check the Synonyms or Tables checkboxes. o Select Next to proceed. 6. In the Attributes page (Step 2 of 5), you should see all the columns in the table that you specified in the Name page. Figure 3: Entity Object Wizard Attributes Page (Step 2 of 5) 130
  • 131. Oracle Application Framework Developer's Guide, Release 12.1.3 o Do not remove any entity attributes so as to include all of the table's columns, o Select New... to create a transient attribute that is used in the business logic, such as a calculated OrderTotal in a purchase order that is used for approval checking. Note: To display a calculated value for an entity object that isn't really relevant to the business logic itself (it is very UI-specific), you can always create an attribute for it in the view object as described below. o Select Next to proceed. 7. In the Attribute Settings page (Step 3 of 5), verify or set the following information for each of the entity object's attributes: Figure 4: Entity Object Wizard Attribute Settings Page (Step 3 of 5) 131
  • 132. Oracle Application Framework Developer's Guide o The Attribute and Database Column Name and Type properties default correctly from the table definition. o All database column attributes have the Persistent and Queriable checkboxes selected as shown. o For primary key columns, ensure that the Primary Key and Mandatory checkboxes are selected. Warning: If you fail to define your primary keys, BC4J will generate a ROWID key for you. You should explicitly define your primary key instead of relying on ROWID as your primary key because this can lead to problems. For example, in a Real Application Cluster with database partitions, the same database row can have a different ROWID in different partitions. Similarly, if a table is partitioned, the ROWID can change inside a transaction if the row is migrated. o For columns that are never updateable, or updateable only when new, select the appropriate Updateable radio button. o For columns whose values change after database triggers execute, select the Refresh After update or insert as appropriate. o Never select the Unique checkbox; uniqueness checking should always be performed programmatically (the state of this checkbox has no impact on runtime behavior; BC4J uses it to create a database constraint if you generate a table from the EO wizard). o Note: The Unique property has no effect if the EO is created on an already existing database table. o The Discriminator column is used for polymorphic entity objects as described in Chapter 6 Advanced Model Development Topics. 132
  • 133. Oracle Application Framework Developer's Guide, Release 12.1.3 o If you are using an Object Version Number column, select the Change Indicator checkbox for it. See Chapter 5 for information about this. o Select Next to proceed. 8. In the Java page (Step 4 of 5) page: o Check the option for generating an Entity Object Class. In the Generate Methods box, opt to generate Accessors, a Create Method and a Delete Method. o Select the Extends... button to verify that you will be subclassing oracle.apps.fnd.framework.server.OAEntityImpl for the Row (the entity object). 9. Select Finish to save your entity object definition and implementation. BC4J will create an XML definition file and a Java implementation file for your entity object as shown in Figure 5. Note that you can quickly view the underlying table and attributes included in the entity object by simply selecting it in the System Navigator. 10. Select your entity object, right-click and select Edit<EntityName>... Navigate to the Tuning page and check the Use Update Batching property. Set the Threshold value to 100. See the OA Framework Model Coding Standard M68 for additional information about batch DML updates, including a list of situations in which this feature cannot be used. Figure 5: JDeveloper System Navigator and Structure pane showing a selected entity object 133
  • 134. Oracle Application Framework Developer's Guide 134
  • 135. Oracle Application Framework Developer's Guide, Release 12.1.3 Multilanguage "_TL" Entity Objects To create a multilanguage "_TL" entity object, follow the special instructions published in Java Entity Objects for Translatable Tables. PL/SQL Entity Objects To create a PL/SQL entity object, follow the special instructions published in PL/SQL Entity Objects. Programmatic Control For detailed information about coding entity object business logic, see Java Entity Objects and PL/SQL Entity Objects. Entity Associations (Association Objects) Associations let you create declarative relationships between entity objects. At runtime, BC4J uses these relationships to coordinate the related objects. There are two basic types of associations: • Composition - A strong association where the source entity object owns the destination entity object. In other words, the destination cannot exist independent of its source. For example, a purchase order header is comprised of purchase order lines, which have no meaning or life span outside the context of their header. • Reference - A weak association where the source entity object only references the destination entity object. For example, a purchase order header references a supplier, but the supplier can still exist regardless of whether a purchase order references it or not. Create composition associations as appropriate for all your entity objects and ensure that they are properly created, initialized and managed at runtime. BC4J automatically treats compositions as a logical unit, so for example, a purchase order header is automatically locked even if you make changes only to its lines). Create reference associations for any entity objects that you're likely to update or instantiate at runtime. For example, create associations between a purchase order header and its supplier if you can update a supplier while editing a purchase order, but don't create associations between purchase orders and a freight terms lookup code entity object. Declarative Implementation For additional information about Association Wizard properties not specifically described here, see the JDeveloper documentation. Note: You can access context-specific Help while in any of the BC4J wizards by selecting the F1 key on your keyboard. 135
  • 136. Oracle Application Framework Developer's Guide 1. In the JDeveloper Navigator, select the BC4J package where you want to create your association object. 2. From the main menu, choose File > New to open the New Object Gallery. 3. In the Categories tree, expand the Business Tier node, and select Business Components (BC4J). 4. In the Items list, select Association to open the Association Wizard. You can also right- click on the BC4J package and select New Association Object to navigate directly to the Association Wizard. 5. In the Name page (Step 1 of 3): o Specify the association's Name in accordance with the OA Framework File / Directory / Package Structure standards. o Verify that you have selected the right BC4J Package. o Do NOT enter a value in the Extends Association field unless you are deliberately subclassing one of your own associations. o Select Next to proceed. 6. In the Entity Objects page (Step 2 of 3), specify the association's cardinality (for example, is it a one-to-many relationship?) and select the source and destination join attributes as shown in Figure 5. Select the Add button to create the join (repeat as necessary for a multi-key relationship). Select Next to proceed. Figure 5: Selecting source and destination entity objects and attributes in the Entity Object (Step 1 of 3) page 136
  • 137. Oracle Application Framework Developer's Guide, Release 12.1.3 7. In the Association Properties page (Step 3 of 3): o Check the Expose Accessor options as appropriate for the source and destination objects (an accessor lets the object get a reference to the other end of the association). o Select the Composition Association checkbox if the destination object cannot exist outside the context of the source object. Note: For compositions, always check the Expose Accessor option on the destination object. Optionally, enable this for the source object as required in your code. o Do not select any of the other page options. 8. Select Finish to save your association. BC4J creates an XML definition file as shown in Figure 6. Note: You can quickly view the underlying relationship by simply selecting the association in the System Navigator. Figure 6: JDeveloper System Navigator and Structure pane showing a selected association object 137
  • 138. Oracle Application Framework Developer's Guide Programmatic Control Association objects have no implementation, so you will not write any code for them. In Chapter 5, we discuss how to access an entity object using an association. View Objects and View Rows This introduces the basics of view object and view row creation/usage. See View Objects in Detail in Chapter 5 for additional information about working with these objects. Design Considerations As described in Anatomy of an OA Framework Page, view objects encapsulate database queries and provide access to associated entity objects. One of the most important view object design decisions is whether it should be based on plain SQL, or on entity objects. • All trivial UI view objects for things like Lists of Values (LOV) and poplists are based on plain SQL. • Any validation view objects, created to implement simple business rules for an entity object, are based on plain SQL. See the Entity Objects, Entity Experts, "Validation" Application Modules and "Validation" View Objects topic below for additional information. • All other view objects created for the UI, regardless of whether they are updateable, are based on entity objects. 138
  • 139. Oracle Application Framework Developer's Guide, Release 12.1.3 For performance reasons, view objects need to be optimized for a given use case. Creating several small, task-specific view objects is preferable to sharing a single, large view object in a range of UIs. View objects should be considered UI-specific. Avoid using dynamic WHERE clauses wherever possible (view objects support the ability to modify their declarative definitions programmatically). If possible, statically define 3 different view objects for the same SELECT -- each with a declarative WHERE clause to which you can simply bind at runtime. However, It is appropriate to modify the WHERE clause in view objects used with complex query criteria because it is impractical to create individual definitions for every possible query criteria combination. View objects, like any BC4J objects, can be created declaratively and programmatically. For performance reasons it is preferable, if you can, to declaratively define the view object. Declarative Implementation For additional information about View Object Wizard properties not specifically described here, see the JDeveloper documentation. Note: You can access context-specific Help while in any of the BC4J wizards by selecting the F1 key on your keyboard. Important: Whenever you create a view object, always generate a view row implementation class. You should generate a view object implementation class only if you intend to write any code for the view object. You can create a shared view object, which subclasses oracle.apps.fnd.framework.server.OAViewObjectImpl, that you can then subclass to create more specific behaviors. SQL View Objects To create a new view object in a Business Components (BC4J) package that is based entirely on a SQL query: 1. In the JDeveloper Navigator, select the BC4J package where you want to create your view object. 2. From the main menu, choose File > New to open the New Object Gallery. 3. In the Categories tree, expand the Business Tier node, and select Business Components (BC4J). 4. In the Items list, select View Object to open the View Object Wizard. Note that you can also right-click on the BC4J package and select New View Object to navigate directly to the View Object Wizard. 5. In the Name page (Step 1 of 7): o Specify the view object's Name in accordance with the OA Framework File / Directory / Package Structure standards. o Verify that you have selected the right BC4J package. o Do NOT enter a value in the Extends View Object field unless you are deliberately subclassing one of your own view objects. 139
  • 140. Oracle Application Framework Developer's Guide o Select Next until you get to Step 5. 6. In the Query page (Step 5 of 7): o Enter your query in the Select Statement field (do not include a semicolon). Note that you must always use Oracle-style bindings (select emp_name from emp where emp_id = :1) if you expect to bind variables at runtime. o Select the Test... button to verify that your query is correct. o Select Next to proceed. 7. In the Attribute Mappings page (Step 6 of 7): o Verify that Query Columns you defined in your SELECT match the View Attributes. If they don't match, click the View Attribute value that is in error to activate a poplist. Select the correct attribute. o Select Next to proceed. 8. In the Java page (Step 7 of 7): o Always check the option to generate a View Row Class (including accessors). o Check the option to generate a View Object Class only if you anticipate writing any code for your view object (you can always generate this class later if you need to, or delete it if you generate it now and find later that you don't have a need for it). o Select the Extends... button to ensure that you are subclassing the OA Framework classes oracle.apps.fnd.framework.server.OAViewObjectImpl and oracle.apps.fnd.framework.server.OAViewRowImpl as appropriate. If you need to correct the default values, select Browse... to open the Find Superclass window. 9. Select Finish to save your new view object. BC4J will create an XML definition file and Java implementations as shown in Figure 7. Note: You can quickly view the underlying attributes and view links by selecting the view object in the System Navigator. Figure 7: JDeveloper System Navigator and Structure pane showing a selected view object 140
  • 141. Oracle Application Framework Developer's Guide, Release 12.1.3 At this point, you are not quite finished with the creation process. To proceed, you need to edit the view object as follows: 1. In the JDeveloper Navigator, select the view object that you just created, right-click and select Edit <viewobject_name>.... 2. In the View Object Wizard, select Tuning. 141
  • 142. Oracle Application Framework Developer's Guide 3. In the Tuning page, deselect the Enable Passivation checkbox. Select OK to save your changes. Entity Object View Objects To create a new view object in a Business Components (BC4J) package that is based entirely on entity objects: 1. In the JDeveloper Navigator, select the BC4J package where you want to create your view object. 2. From the main menu, choose File > New to open the New Object Gallery. 3. In the Categories tree, expand the Business Tier node, and select Business Components (BC4J). 4. In the Items list, select View Object to open the View Object Wizard. Note that you can also right-click on the BC4J package and select New View Object to navigate directly to the View Object Wizard. 5. In the Name page (Step 1 of 6): o Specify the view object's Name in accordance with the OA Framework File / Directory / Package Structure standards. o Verify that you have selected the right BC4J package. o Do NOT enter a value in the Extends View Object field unless you are deliberately subclassing one of your own view objects. o Select Next to proceed. 6. In the Entity Objects page (Step 2 of 6): o In the Available list, select the entity objects that you want to include in the view object and shuttle them to the Selected list. o Indicate whether the entity objects are Read Only, and if they should be treated as a Reference (see the JDeveloper documentation for additional information about this page). o Select Next to proceed. 7. In the Attributes page (Step 3 of 6) select the attributes that you want to include from the Available list and shuttle them to the Selected list. Select Next to proceed. 8. In the Attribute Settings page (Step 4 of 6), verify that the default information is correct. Select Next to proceed. 9. In the Query page (Step 5 of 6): o Verify that the query BC4J generated for you is correct. If not, select the Expert Mode checkbox to make the query editable. Note: For expert mode view objects, do NOT try to set a value in your SELECT statement for an EO attribute. For example, do not assume the flag column is based on an EO attribute as this results in a locking failure because BC4J tries to compare this value with the original database value and complains that they are different. See Java Entity Objects for valid approaches to setting attribute default values. SELECT x pk1, y pk2, z status, 'Y' flag, .... o Select the Test... button to verify that your query is correct. o Select Next to proceed. 10. In the Java page (Step 6 of 6): o Check the option to generate a View Row Class (including accessors). 142
  • 143. Oracle Application Framework Developer's Guide, Release 12.1.3 o Check the option to generate a View Object Class only if you anticipate writing any code for your view object (you can always generate this class later if you need to, or delete it if you generate it now and find later that you don't have a need for it). o Select the Extends... button to ensure that you are subclassing the OA Framework classes oracle.apps.fnd.framework.server.OAViewObjectImpl and oracle.apps.fnd.framework.server.OAViewRowImpl as appropriate. If you need to correct the default values, select Browse... to open the Find Superclass window. 11. Select Finish to save your new view object. Once you have created an entity object-based view object, you must edit it to tune its passivation properties as described above. For example, for a view object used to update entity objects, the Passivation option should be checked in the Tuning page. See Chapter 6 OA Framework State Persistence Model (Passivation) for additional information. Hybrid View Objects (Expert-Mode View Objects) You can also create view objects that are based on entity objects, and include SQL attributes. In this case, create the view object as described in the entity object case above, with a few small modifications: • In the Attributes page, select the New button to create attributes for the non-entity object values that you want to query directly. • In the Query page, select Expert Mode to edit the generated SQL as needed to retrieve these "calculated" values. • In the Attribute Mappings page (displayed only if you have SQL-based attributes), ensure that the Query Columns and View Attributes match. Primary Keys Per the OA Framework Model Coding Standard M39, almost all view objects require primary keys. You can specify primary keys declaratively when defining attributes, or you can set them programmatically by calling setKeyAttributeDefs() on OAViewObjectImpl. Programmatic Control Query Handling Each view object implements its own search, and if necessary, should be capable of translating incoming parameters to bind variables and WHERE clause phrases. As a general coding practice, all methods that perform this work should be named initQuery() or some descriptive variant like initNewEmployeesQuery() if you need multiple "init" methods. Note: You must also use "Oracle-style" binding ( FOO >= :1 ) instead of ANSI-style binding ( FOO >= ? ). Although the code is a little more complex, the OA Framework team plans to desupport the ANSI-style bindings in the Fusion release. 143
  • 144. Oracle Application Framework Developer's Guide The following example illustrates how to modify a WHERE clause and bind search criteria based on the values passed to the initQuery method. // Initialize and execute the query public void initQuery(String name, String onHold, String number) { StringBuffer whereClause = new StringBuffer(100); Vector parameters = new Vector(3); int clauseCount = 0; int bindCount = 0; setWhereClauseParams(null); // Always reset if ((name != null) && (!("".equals(name.trim())))) { whereClause.append(" NAME like :"); whereClause.append(++bindCount); parameters.addElement(name + "%"); clauseCount++; } if ((number != null) && (!(""Equals(number.trim())))) { Number supplierId = null; // SUPPLIER_ID is a NUMBER; datatypes should always // match, and the parameter passed to this method is a // String. 144
  • 145. Oracle Application Framework Developer's Guide, Release 12.1.3 try { supplierId = new Number(number); } catch(Exception e) {} if (clauseCount > 0) { whereClause.append(" AND "); } whereClause.append(" SUPPLIER_ID = :"); whereClause.append(++bindCount); parameters.addElement(supplierId); clauseCount++; } if ((onHold != null) && (!(""Equals(onHold.trim())))) { if (clauseCount > 0) { whereClause.append(" AND "); } whereClause.append(" ON_HOLD_FLAG = :"); 145
  • 146. Oracle Application Framework Developer's Guide whereClause.append(++bindCount); parameters.addElement("Y"); clauseCount++; } setWhereClause(whereClause.toString()); if (bindCount > 0) { Object[] params = new Object[bindCount]; // the copyInto() is 1.1.8 compliant which, as of 4/02/03, is required by ARU parameters.copyInto(params); setWhereClauseParams(params); } executeQuery(); } // end initQuery( ) Business Logic View objects are not an appropriate home for business logic; you should not be writing validation rules in your view objects or view rows. View Rows 146
  • 147. Oracle Application Framework Developer's Guide, Release 12.1.3 Although you should always create a view row as mentioned above, for the most part, you won't need to write view row code. View row code is useful in cases where you want to calculate a transient attribute value, for example, but you can't or don't want to include the logic in your query (perhaps the performance cost is too high). You can also use view row code to perform simple validations of transient attributes used in the UI, or call custom entity object methods (see the "Approve" example in the Application Module section below for additional information). Custom view row methods may not be accessed directly on the client. The client must first invoke a method on the application module, which delegates to the view object. The view object provides access to the view row. Furthermore, to realize the performance benefit of having the view row class, always call the generated setters/getters (for example, setSupplier()) on the row if you need to programmatically access or set values. This is because it is much faster than calling the generic setAttribute("<AttributeName>") and getAttribute("<AttributeName>"). For example, the Entity Object Delete Example in the Application Module section below shows how to properly retrieve a view row attribute value. View Links As described above, an association defines a relationship between two entity objects. Similarly, a view link defines a relationship between two view objects that BC4J uses to automatically query and coordinate the destination view object based on the current source view object. View links can be based on an association or a declarative join relationship between two view objects. For example, suppose two tables have a master-detail relationship based on a foreign key. The corresponding entity objects are related via an association, and view objects based on those entity objects can be related by a view link based on the association. Although view links can be very convenient, use them sparingly in the web applications pages because they cache both the master and detail records as the user navigates from one master row to the next -- and this can be expensive. Use view links only in the following cases: • When specific beans (like the HGrid) require them. • When you have updateable master/detail view objects (on the same or different pages) whose underlying entity objects are related using composition, you must define a view link between them (we discuss this further in Chapter 5). • When you have a read-only master and detail view object on the same page, and navigating to a master row should cause the children to query automatically. Declarative Implementation For additional information about View Link Wizard properties not specifically described here, see the JDeveloper documentation. Note: You can access context-specific Help while in any of the BC4J wizards by selecting the F1 key on your keyboard. To create a new view link in a Business Components (BC4J) package: 147
  • 148. Oracle Application Framework Developer's Guide 1. In the JDeveloper Navigator, select the BC4J package where you want to create your view link. 2. From the main menu, choose File > New to open the New Object Gallery. 3. In the Categories tree, expand the Business Tier node, and select Business Components (BC4J). 4. In the Items list, select View Link to open the View Link Wizard. Note that you can also right-click on the BC4J package and select New View Link to navigate directly to the View Link Wizard. 5. In the Name page (Step 1 of 6): o Specify the view link's Name in accordance with the OA Framework File / Directory / Package Structure standards. o Verify that you have selected the right BC4J package. o Do NOT enter a value in the Extends View Link field unless you are deliberately subclassing one of your own view objects. o Select Next to proceed. 6. In the View Objects page (Step 2 of 6), select the Source and Destination view objects. Select Next to proceed. 7. In the Source Attributes page (Step 3 of 6), specify the join attribute or association object of the source object (if available) as shown in Figure 8. Select Next to proceed. Figure 8: View Link Wizard showing use of an association to obtain the source view object join attribute 8. In the Destination Attributes page (Step 4 of 6), specify the join attribute or association of the destination object. Select Next to proceed. 9. In the View Link SQL page (Step 5 of 6), review the WHERE clause that BC4J is going to create for you to ensure that it is correct. 148
  • 149. Oracle Application Framework Developer's Guide, Release 12.1.3 Tip: If there are no primary keys specified in the source and destination view objects, BC4J cannot properly create a WHERE clause. If these fields are disabled, check your view object definitions. Figure 8: View Link Wizard showing a generated WHERE clause 10. In the View Link Properties page (Step 6 of 6,) specify the cardinality between the view objects and indicate whether you want to generate accessors from the source to the destination and vice versa. 11. Select Finish to create your view link. BC4J will create an XML definition file as shown in Figure 9. Note that you can quickly view the underlying relationship by selecting the view link in the System Navigator. Figure 9: JDeveloper System Navigator and Structure pane view of a selected view link 149
  • 150. Oracle Application Framework Developer's Guide Programmatic Control Since view links have no implementation, you do not write any code for them. In Chapter 5, we discuss how to access a view object using a view link. You can however, create view links dynamically by using the oracle.jbo.ApplicationModule createViewLinkBetweenViewObjects API. Refer to the corresponding JavaDoc for an example of how to use this method. Note: Both the Master and Detail view objects participating in a programmatically created view link should belong to the same application module instance. Application Modules This introduces the basics of application module creation/usage. See Application Modules in Detail in Chapter 5 for additional information about working with these objects. Application Module Uses The following is a list the distinct roles that application modules can play in your application: 150
  • 151. Oracle Application Framework Developer's Guide, Release 12.1.3 • UI Root Application Module - Establishes the transaction context for one or several related UI pages. Every page has a root application module which includes any view objects and nested application modules used by the page. • UI Shared Region Application Module - Any UI region with created for use in multiple pages should have its own containing application module. When this region is used in a page, OA Framework automatically nests its application module beneath the page's root application module. See Implementing the View for additional information on creating shared regions. • UI List of Values Application Module - This is a special case of the previous role. When you create List of Values (LOV) view objects, you add these components to an application module dedicated to the job of aggregating LOVs for a given package. • Validation Application Module - A validation application module aggregates related view objects created for the purpose of performing lightweight SQL validations. Entity objects and experts make use of validation application modules, which have nothing to do with the user interface. See the Entity Objects, Entity Experts, 'Validation' Application Modules and 'Validation' View Objects topic below for additional information. Declarative Implementation For additional information about Application Module Wizard properties not specifically described here, see the JDeveloper documentation. Note: You can access context-specific Help while in any of the BC4J wizards by selecting the F1 key on your keyboard. Creating New Application Modules Note: Create a shared application module that subclasses oracle.apps.fnd.framework.server.OAApplicationModuleImpl, which you then subclass to create more specific behaviors. To create a new application module in a Business Components (BC4J) package: 1. In the JDeveloper Navigator, select the BC4J package where you want to create your application module. 2. From the main menu, choose File > New to open the New Object Gallery. 3. In the Categories tree, expand the Business Tier node, and select Business Components (BC4J). 4. In the Items list, select Application Module to open the Application Module Wizard. Note that you can also right-click on the BC4J package and select New Application Module to navigate directly to the Application Module Wizard. 5. In the Name page (Step 1 of 5): o Specify the application module's Name in accordance with the OA Framework File / Directory / Package Structure standards. o Verify that you have selected the right BC4J package. o Do NOT enter a value in the Extends Application Module field unless you are deliberately subclassing one of your own application modules. o Select Next until you get to Step 4. 6. In the Java page (Step 4 of 5), deselect the Generate Java File(s) checkbox ONLY if you are certain that you won't be writing any code for your application module (you can 151
  • 152. Oracle Application Framework Developer's Guide always delete the class later if you find that you don't need it, so it's probably best to simply generate it at this point unless you are creating a simple container for LOV view objects). If you do want to generate an implementation class for your application module, select the Extends... button to verify that you will be subclassing oracle.apps.fnd.framework.server.OAApplicationModuleImpl. 7. Select Finish to create your application module. BC4J will create an XML definition and implementation file as shown in Figure 10. Note: You can quickly view the underlying contents by selecting the application module in the System Navigator. Figure 10: JDeveloper System Navigator and Structure pane view of a selected application module At this point, you are not quite finished with the creation process. To proceed, edit the application module as follows: Important: Do not set the application module's Retention Level to MANAGE_STATE (steps 2 and 3 below) if you are not yet ready to fully implement and certify your page for passivation support. See Model Coding Standard M8 for more details . 152
  • 153. Oracle Application Framework Developer's Guide, Release 12.1.3 1. In the JDeveloper Navigator, select the application module that you just created, right- click and select Edit <appmodule_name>.... 2. In the Application Module Wizard, select Properties. 3. In the Properties page, create a passivation property as described in OA Framework State Persistence Model (Passivation). For example, the most common application module passivation configuration involves setting the application module's Retention Level to MANAGE_STATE. To do this: 1. Type RETENTION_LEVEL in the property Name field. 2. Type MANAGE_STATE in the property Value field. 3. Select Add to create the property. 4. Finally, while you are still in the application module wizard, navigate to the Tuning page. Verify that the Customize Runtime Instantiation Behavior checkbox is checked, and the Lazy Loading radio button is selected (note that you should also review Application Modules in Detail for a detailed description of the Lazy Loading feature and several use case considerations). 5. Select OK to save your changes. Generating Application Module Interfaces To generate an application module interface so you can invoke typed methods directly (with compile-time checking) instead of calling invokeMethod(), you must first create the methods that you want to expose to the client. Then: 1. In the JDeveloper Navigator, select the application module that you just created, right- click and select Edit <appmodule_name>.... 2. In the Application Module Wizard, select Client Methods. 3. Select the methods you want to be able to invoke remotely in the Available list and shuttle them to the Selected list. 4. Select OK to create your interface. JDeveloper automatically creates an interface in the correct package and with the correct name per the OA Framework File Standards. Adding View Objects Tip: When you create a view object for a particular purpose, immediately add it to the appropriate application module so you don't forget to do it later. All view objects are used in the context of a given application module. View objects are instantiated on an "as needed" basis (in previous releases, BC4J instantiated all the view objects associated with a given application module when the application module was created). For example, if you write code to find a specific view object so you can query it, or a UI page renders with items bound to view object attributes, BC4J automatically instantiates the necessary view objects. If a view object that is associated with an application module is not required at runtime, it is not instantiated. To create this relationship declaratively for a given view object and application module: 153
  • 154. Oracle Application Framework Developer's Guide 1. In the JDeveloper Navigator, select the application module that you just created, right- click and select Edit <appmodule_name>.... 2. In the Application Module Wizard, select Data Model . 3. In the Data Model page, select the view objects that you want to include from the Available View Objects list and shuttle them to the Data Model list. 4. Optionally change the default view Instance Name. A single view object can be added to the same application module multiple times (for example, you could perform the same query in multiple regions within the same UI task/module). Each view object instance has a unique identifier; this unique identifier is the Instance Name. When you add a view object to an application module, BC4J creates the default instance name by appending an integer to the view object's name as shown in the Figure 11. To edit this value, simply select the view object in the Data Model list and make your changes in the updateable field below the list. Figure 11: Application Module Wizard Data Model page showing a default view Instance Name Note: To add a detail view object (accessed via a view link) to the application module, follow these steps in the Edit Application Module dialog. You must adhere to these instructions to properly access the detail view object; it's not sufficient to simply add the detail view object as a peer to the master view object. 154
  • 155. Oracle Application Framework Developer's Guide, Release 12.1.3 1. Select the master view object in the Data Model view 2. Select the detail view object in the Available View Objects view and shuttle it to the Data Model view If you added the detail view object correctly, it will appear as shown in Figure 12. Figure 12: Application Module Wizard Data Model page showing a detail view object added to its master via a view link Adding Nested Application Modules You can nest application modules to any arbitrary level. Nested application modules are instantiated on an "as needed" basis (in previous releases, BC4J instantiated all the nested application modules when the containing application module was created). For example, if you do a findApplicationModule , BC4J will instantiate the object. If a nested application module is never accessed, it is not created. To add a nested application module to your application module: 1. In the JDeveloper Navigator, select the application module that you just created, right- click and select Edit <appmodule_name>.... 2. In the Application Module Wizard, select Application Modules . 3. In the Application Modules page, select the application module(s) that you want to include from the Available list and shuttle them to the Data Selected list. 4. Optionally change the default application module Instance Name as described for view objects above. 155
  • 156. Oracle Application Framework Developer's Guide Programmatic Control Do NOT code business logic, such as validations, in application modules; this should be coded in underlying entity objects instead. The application module is an appropriate place for logic that: • Provides access to any associated BC4J objects. For example, in Implementing the Controller, you will see that controllers should never access view objects directly when they need to execute a query. Instead, they must invoke methods on the page's application module asking for a particular query to be executed. • Performs multiple server-side actions, or spans multiple view objects as the result of a single event or method invocation. For example, code that copies all the rows from View Object A to View Object B belongs in this class. • Returns server side values to the client that cannot be accessed from an OAPageContext. If, for example, your page needs a specific server value to determine if a region should be rendered or an item should be read-only, the application module should provide this information. • Calls special PL/SQL routines. Tip: If the PL/SQL routines are used for validation and processing of individual rows (or a set of rows), then you should use PL/SQL-based entity objects instead. See Chapter 5 for additional information about using PL/SQL entity objects. Method Naming Any application module methods that directly supports the UI should be named for the corresponding UI "events." For example, if the user presses a Create button, the application module method should be named "create" and shown in the following examples. Note: Corresponding controller invocations of all the following examples are included in Implementing the Controller. Entity Object Create Example The following example illustrates an application module method that creates and inserts a row into the SuppliersVO view object. This particular view object is based on the SupplierEOImpl entity object, so BC4J instantiates this behind the scenes when the row is created. public void createSupplier() { OAViewObject vo = getSuppliersVO(); Row row = vo.createRow(); 156
  • 157. Oracle Application Framework Developer's Guide, Release 12.1.3 vo.insertRow(); // As specified in OA Framework Model Coding Standards, // set the new row state to STATUS_INITIALIZED. row.setNewRowState(Row.STATUS_INITIALIZED); } View Object Query Examples This shows an application module method that queries the SuppliersVO view object using search criteria passed from the client. public void query(String supplierName, String onHoldFlag, String supplierNumber) { SuppliersExpVOImpl vo = getSuppliersExpVO(); if (vo == null) { MessageToken[] tokens = { new MessageToken("OBJECT_NAME", "SuppliersExpVO")}; throw new OAException("ICX", "FWK_TBX_OBJECT_NOT_FOUND", tokens); } vo.initQuery(supplierName, onHoldFlag, supplierNumber); } // end query() 157
  • 158. Oracle Application Framework Developer's Guide This example illustrates a query that initializes a page when the user navigates to it. Note the browser Back button check to ensure that a query isn't executed needlessly. See Chapter 6 Supporting the Browser Back Button for additional information). public void init(String status) { PoSimpleSummaryVOImpl vo = getPoSimpleSummaryVO(); if (vo == null) { MessageToken[] tokens = { new MessageToken("OBJECT_NAME", "PoSimpleSummaryVO")}; throw new OAException("ICX", "FWK_TBX_OBJECT_NOT_FOUND",tokens); } // Follows Back Button standard of never performing a blind query without // checking to see if this is necessary. if (!vo.isPreparedForExecution()) { vo.initQuery(status); } } // end init() Entity Object Delete Example This illustrates how to search a view object row set for a single selected object so that the entity object can be deleted. /** 158
  • 159. Oracle Application Framework Developer's Guide, Release 12.1.3 * Deletes a purchase order from the PoSimpleSummaryVO using the * poHeaderId parameter. */ public void delete(String poHeaderId) { // First, we need to find the selected purchase order in our VO. // When we find it, we call remove( ) on the row which in turn // calls remove on the associated PurchaseOrderHeaderEOImpl object. int poToDelete = Integer.parseInt(poHeaderId); OAViewObject vo = getPoSimpleSummaryVO(); PoSimpleSummaryVORowImpl row = null; // This tells us the number of rows that have been fetched in the // row set, and will not pull additional rows in like some of the // other "get count" methods. int fetchedRowCount = vo.getFetchedRowCount(); // We use a separate iterator -- even though we could step through the // rows without it -- because we don't want to affect row currency. // Note that there are also convenience methods for finding matching rows // in a view object (see javadoc). 159
  • 160. Oracle Application Framework Developer's Guide RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter"); if (fetchedRowCount > 0) { deleteIter.setRangeStart(0); deleteIter.setRangeSize(fetchedRowCount); for (int i = 0; i < fetchedRowCount; i++) { row = (PoSimpleSummaryVORowImpl)deleteIter.getRowAtRangeIndex(i); // For performance reasons, we generate ViewRowImpls for all // View Objects. When we need to obtain an attribute value, // we use the named accessors instead of a generic String lookup. // Number primaryKey = (Number)row.getAttribute("HeaderId"); Number primaryKey = row.getHeaderId(); if (primaryKey.compareTo(poToDelete) == 0) { row.remove(); getTransaction().commit(); break; // only one possible selected row in this case 160
  • 161. Oracle Application Framework Developer's Guide, Release 12.1.3 } } } deleteIter.closeRowSetIterator(); } // end deletePurchaseOrder() Custom Action Example ("Approve") This illustrates how to search a view object row set for one or more selected objects to call a custom entity object event. /** * Steps through the POSimpleSummaryVO to look for selected rows. For * each selected row, this calls the approve( ) method on the * PurchaseOrderHeaderEOImpl class. */ public void approvePurchaseOrders( ) { // To call a custom method on an Entity Object you should add a wrapper // in the VO's *RowImpl class (see // oracle.apps.fnd.framework.toolbox.schema.server.PoSimpleSumaryVORowImp l). OAViewObject vo = getPoSimpleSummaryVO(); PoSimpleSummaryVORowImpl row = null; 161
  • 162. Oracle Application Framework Developer's Guide int matches = 0; // This tells us the number of rows that have been fetched in the // row set, and will not pull additional rows in like some of the // other "get count" methods. // Note that there are also convenience methods for finding matching rows // in a view object (see javadoc). int fetchedRowCount = vo.getFetchedRowCount(); // We use a separate iterator -- even though we could step through the // rows without it -- because we don't want to affect row currency. RowSetIterator approveIter = vo.createRowSetIterator("approveIter"); if (fetchedRowCount > 0) { approveIter.setRangeStart(0); approveIter.setRangeSize(fetchedRowCount); for (int i = 0; i < fetchedRowCount; i++) { // For every row with a selected checkbox, we want call 162
  • 163. Oracle Application Framework Developer's Guide, Release 12.1.3 // the approve( ) wrapper on the POSimpleSummaryVORowImpl which // in turn calls the approve ) method on the PurchaseOrderHeaderEOImpl. row = (PoSimpleSummaryVORowImpl)approveIter.getRowAtRangeIndex(i); // For performance reasons, we generate ViewRowImpls for all // View Objects. When we need to obtain an attribute value, // we use the named accessors instead of a generic String lookup. // String selectFlag = (String)row.getAttribute("SelectFlag"); String selectFlag = row.getSelectFlag(); if ("Y"Equals(selectFlag)) { row.approve( ); matches++; } } } approveIter.closeRowSetIterator(); // If the user didn't actually select any rows, display an error message. 163
  • 164. Oracle Application Framework Developer's Guide if (matches > 0) { getTransaction().commit(); } else { throw new OAException("ICX", "FWK_TBX_T_SELECT_FOR_APPROVE"); } } // end approve() Commit Example /** * Provides a "commit" wrapper so UI controller code doesn't need to * get a handle to the transaction itself which is a violation of the * client/sever tier separation rules. */ public void apply() { getTransaction().commit(); } // end apply() 164
  • 165. Oracle Application Framework Developer's Guide, Release 12.1.3 Testing Your Application Modules Once you finish adding your view objects to your application modules, you can use the Business Component Browser ( BC4J Tester) to run your view objects before you build an OA Framework UI for them, or write any code to support your BC4J objects. For example, you can query view objects (including the ability to navigate through master rows to query children linked with a view link). See Testing OA Framework Applications for instructions on how to enable this utility. Entity Objects, Entity Experts, 'Validation' Application Modules and 'Validation' View Objects For detailed information about using entity objects, entity experts, validation application modules and validation view objects together, see Chapter 5. This section simply introduces the objects and the roles they play in an application. Validation View Objects When you implement business logic in your entity objects, you will frequently find that you need to execute some simple SQL statements, and not just for pure validation purposes. For example, a purchase order header has many lines. Each line is assigned a unique line number. This number is defined as the current maximum line number for the entire purchase order + 1. At runtime, we need to query the database to find out what the maximum line number is for a given purchase order header: SELECT MAX(LINE_NUMBER) FROM FWK_TBX_PO_LINES WHERE HEADER_ID = :1; Whenever you need to execute SQL like this, you can create a view object dynamically from a SQL statement, or you can predefine a declarative view object for it. That being said, OA Framework Model Coding Standards require that you use the declarative strategy in this case since it is more performant: a view object is cached in its respective application module, which allows entity object code to reuse it (and the underlying JDBC prepared statement) by simply rebinding and re-execute the query. This is an important performance benefit since validation routines are called repeatedly. Implementation From an implementation standpoint, validation view objects are no different from regular view objects; they are differentiated only by the use case. However, always disable passivation for these view objects, which should never have associated state and should always be recreatable. See OA Framework Model Coding Standards. Validation Application Modules (VAMs) Predefined view objects must be assigned to an application module so that they can be accessed at runtime. In other words, view objects do not exist outside the context of an application module. 165
  • 166. Oracle Application Framework Developer's Guide Since entity objects (and their associated validation view objects) can be shared by multiple UI clients (and the root application modules should be considered UI-specific), it is not appropriate to use the root application module for a particular page to hold your validation view objects. Instead, to group these utility view objects into meaningful, reusable units, create a validation application module per business object to hold them. A business object is defined the top-level entity object in a composition, or a single entity object if it stands alone. For example, the OA Framework ToolBox Tutorial purchase order is comprised of 3 entity objects, but the PurchaseOrderHeaderEOImpl class represents the purchase order business object. For example, in the OA Framework ToolBox Tutorial, we created a business object-level validation application module called PurchaseOrderVAM and added all of the purchase order's validation view objects to it. Implementation From an implementation standpoint, validation application objects are no different from regular application objects; they are differentiated only by the use case. Create your validation application module declaratively and associate the appropriate validation view objects with it. Entity Experts The entity expert is a singleton defined to be a special affiliate of a business object (either the top entity object in a composition, or a standalone entity object). It includes common code called by the owning business object, or simple validation routines called by other entity objects that don't want the cost of instantiating the entity object itself. For example, a PurchaseOrderHeaderEOImpl class doesn't want to instantiate a whole SupplierEOImpl class just to find out if the supplierId foreign key it's about to set is valid. Instead, it calls an isSupplierIdValue(Number supplierId) method on the supplier's entity expert singleton -- a much lighter weight operation. Implementation To create an entity expert, first create a class that extends oracle.apps.fnd.framework.server.OAEntityExpert. The class should be named and packaged according to the standards published in the OA Framework File / Package / Directory Structure standards. Second, you need to associate this class with an entity object: Note: For composition business objects, associate the expert with the top-level object. Otherwise, simply associate it with the standalone entity object. 1. In the JDeveloper System Navigator, select the entity object to which you want to attach the expert. Right-click and select Edit <EntityOjectName>... 2. Navigate to the Properties page to create a new property with the following characteristics: o Set the Name to ExpertClass. o Set the Value to the fully qualified name of your expert class. For example: oracle.apps.fnd.framework.toolbox.schema.server.PurchaseOrd erEntityExpert. 3. Select Add to create your property. 166
  • 167. Oracle Application Framework Developer's Guide, Release 12.1.3 4. Select OK to save your changes. Reusing Business Objects Entity Objects, Associations, Validation AMs, Validation VOs, Entity Experts If you wish to create Entity Object, Association, Validation AM, Validation VO, or Entity Expert business objects for reuse, you should be aware of the following standards: • The owner of the underlying data schema solely owns the corresponding Entity Objects, Associations, Validation Application Modules, Validation View Objects, and Entity Experts. • The owner product team of these business objects must document and publish them for other product teams to reuse. • When you create a composite association that involves your EO (YourEO) and another product team's EO (OtherBaseEO), you must first extend the OtherBaseEO into your product space (OtherExtendedEO) before creating the association between YourEO and OtherExtendedEO. • Another product team who is consuming the business objects that you own may want to extend the validations that you provide. In such a case, the consumer product team should extend the Entity Object, Validation Application Module, Validation View Object and Entity Expert and include custom definitions and code in the extensions. When extending validation methods, make sure that you invoke super() at the top of the extended validation methods. Please see the Extending Business Objects subsection below for more details. Extending Business Objects The following diagram depicts objects that you deal with when creating business objects and the associated extensions that you want to make to extend validations. The first row of the above diagram represents an exhaustive list of all possible objects you might create when defining an entity object. The first box illustrates that when creating an entity object, two files get generated: the metadata definition XML file and the actual implementation Java class file. Entity Objects handle attribute level and record level validations. These validations often need to use Validation View Objects (VVO). Validation Objects are grouped under Validation Application Module (VAM). Like Entity Objects, creating VVO's and VAM's, generates a metadata definition XML file and an implementation java class file for each object. Finally, Entity Objects sometimes rely on a helping class to offer among other services, a validation 167
  • 168. Oracle Application Framework Developer's Guide service optimized for usage by other Entity Objects. This helping class is the Entity Expert and linked to the Entity Object through an entity object property. The above diagram illustrates a case where all business objects are extended. That is not necessarily always the case. In most cases, you may be satisfied with extending just some of these objects. Note that you should never edit the base definition of an object or make a copy of a base object. You should always extend the relevant object and use substitution/factory mechanisms to reference the extended objects. For example you may be satisfied with extending the Entity Expert to override a validation method such as isSupplierValid. In this case, note that it is not wise to reference the extended Entity Expert (MyEntityExpert) directly from the base entity object (EntityEO.XML) as such an approach does not survive upgrades. A better approach requires extending the base entity object using the JDeveloper entity object creation wizard and updating the entity expert property on the extended entity object to point to the extended Entity Expert. Another approach is to simply extend the entity object through the JDeveloper entity object creation wizard to add an extra validation to the OtherExtendedEOImpl class (make sure you invoke super() first) that doesn't require any additional validation view objects. Note that business object extensions are placed under the consumer product teams' package hierarchy. View Objects, View Links If you wish to create View Object or View Link business objects for reuse, you should be aware of the following standards: • View Objects and View Links are created for a particular user interface or business logic. Having said that, a product team that owns these objects may choose to publish certain View Objects and View Links for public consumption. • The owning product team of a public view object must provide the necessary documentation and must guarantee the objects' contract (WHERE clause, attributes, and so on). • Other product teams may extend a public base view object's capabilities by using the JDeveloper view object creation wizard. • You can also extend a public view object definition to include extra attributes, if desired. For more information on Extensibility, refer to Chapter 9: Extending and Deploying OA Framework Applications. 168
  • 169. Oracle Application Framework Developer's Guide, Release 12.1.3 Implementing the View Overview This document describes how to implement an application's view components in generic terms. It does not describe how to implement specific UI features. For this information, see individual topics in Chapter 4: Implementing Specific UI Features. Contents • Designing the User Interface • Pages • Reusable Components • Attribute Sets • URL Parameters: Tokens, Encryption, Encoding • Style Sheets • Accessibility • Internationalization • Model Interaction • Menus and Page Security Prerequisite Reading This document assumes that you have read the following in the OA Framework Developer Guide: • Building "Hello, World!" • JSP Application Primer • Anatomy of an OA Framework Page • OA Framework State Management • Implementing the Model Designing the User Interface All OA Framework applications must be designed in accordance with the Oracle Browser Look- and-Feel (BLAF) UI Guidelines [ OTN Version ] (note that you can find information about how to do the UI design, including instructions on using UIX as a prototyping tool, at this site). Compliance with these guidelines yields several benefits: • Users interact with a consistent, predictable, attractive interface as they navigate from one application to the next. • If properly designed for your target audience, your applications are likely to be intuitive and usable since the UI guidelines themselves have been usability tested. Furthermore, the results of product team usability testing are considered and addressed on an ongoing basis. 169
  • 170. Oracle Application Framework Developer's Guide • The underlying UIX beans that the OA Framework extends implement the UI guidelines. If your application complies with the UI guidelines, you can typically use the OA web beans "out of the box" without extensive programmatic effort. For Oracle E-Business Suite applications, any deviations from these guidelines must be approved by the corporate UI Design and Usability team. Generally, valid deviations are driven by unique product requirements (which often introduce designs that are eventually rolled into the general standards to the benefit of all product teams). It is not acceptable to ignore individual standards simply because you disagree with them. Designing Mobile Applications The OA Framework supports deployment of specially designed applications on wireless platforms (initially, PDA handheld devices like a Palm Pilot). For information on designing, building, testing and deploying mobile applications, see the Mobile Applications document in Chapter 4. Note that you should continue reading about OA Framework development basics as this information applies to mobile development as well. Pages The basic steps for creating pages, regions and items are outlined in Chapter 2: Building "Hello, World!", and in the JDeveloper OA Extension Help. For information about implementing feature-specific regions and items, see Chapter 4. Coding Standards Compliance Before creating any OA components, you should read the following documents carefully: • Chapter 8: OA Framework Naming / File / Package / Directory Structure Standards • Chapter 8: OA Framework View Coding Standards (this includes standards for components that you create declaratively) Key Page Layout Region Properties Whenever you create a pageLayout region , pay special attention to the following properties: • AutoFooter - always set this to true so the Applications-standard privacy and copyright links render in your page. • Help Target - if you want to display help text for this page when the user selects the Help global button in your page, you must specify the help target (often the name of the help file) to display here. See Global Buttons for additional information about this. • AM Definition - this is where you specify the root application module for your page. Note that you must specify the fully qualified name, such as: oracle.apps.fnd.framework.toolbox.tutorial.server.SearchAM • Function Name - always specify the securing function for the page (see the Menus section below for additional information). • Window Title - this text value is displayed in the browser's window title. 170
  • 171. Oracle Application Framework Developer's Guide, Release 12.1.3 • Title - this text value renders as the page header. It's also used as the page's name if breadcrumbs are displayed (see Chapter 4: Breadcrumbs for detailed information about this feature). • Form - always set this to true for a pageLayout region (this is the default setting), and never add additional child form beans to your page. The OA Framework supports only 1 form per page. • pageLayout Components - as mentioned in Anatomy of an OA Framework Page, pages include special "named" components (also called named children), one of which is the branding image . To associate a branding image with your page, select the pageLayout region or the pageLayout Components node in the Structure pane and use the right mouse button to select New > productBranding from the context menu. JDeveloper automatically creates an image item whose Image URI property should be set to <imageName>.gif. Key Item Properties Since each item type has a distinct set of properties (often including properties that are unique to the item), it's impossible to introduce each and every relevant property. Instead, this section introduces some of the common properties that you should understand since you will set them frequently. • Extends - For items (and regions as well), this indicates that the new item extends an existing item. This is discussed in more detail below. • Attribute Set - A named set of properties applied to quickly configure an item. This is discussed in more detail below. • Destination URI - For items that support navigation, this is the navigation target. For example: OA.jsp?page=/oracle/apps/fnd/framework/toolbox/tutorial/webui/PoD etailsPG&retainAM=Y. • (Client Action) Action Type - Indicates whether the item is capable of submitting the form, or causing a partial page rendering (PPR) event. See Chapter 4's Dynamic User Interface and Declarative Submit Form for additional information about these features. • CSS Class - Indicates which cascading style sheet class to apply to the item (for many items, UIX sets this value for you automatically to comply with the BLAF UI Guidelines). This is discussed in more detail below. • Rendered - Indicates whether the corresponding object is included in the web bean hierarchy, and the HTML that UIX sends to the browser for rendering. For most items, this indicates whether an item displays or not, but for some items that never actually display (like a hidden developer field), this indicates whether the object exists on the page. • View Instance - For items that bind to an underlying view object for reading and writing (if needed) data, this identifies the view object instance (within the context of a containing application module) to which the item binds. • View Attribute - This is the view instance's attribute to which the item binds. • Admin Personalization - Indicates whether the property is system administrator personalizable. See the OA Framework Personalization Guide for additional information about personalization. 171
  • 172. Oracle Application Framework Developer's Guide • User Personalization - Indicates whether the property is user personalizable. See the OA Framework Personalization Guide for additional information about personalization. • Initial Value - Default value for the item (note that this can be personalized by customers). See the Defaulting topic below for additional information. Simplest Possible Expression Language (SPEL) For selected properties, the OA Framework supports the use of SPEL expressions to quickly bind the property to an underlying data source that provides the property's value. For example, you could bind the Rendered property of a button to a view object attribute to ascertain whether it should be hidden or shown when the page renders. The SPEL syntax for this property looks like: ${oa.<ViewInstanceName>.<ViewAttributeName>} Tip: SPEL is an industry-standard expression language included in the JSP Standard Tag Library (JSTL). If you're interested in learning more about this (although this isn't necessary for the limited use in the OA Framework), searching for "simplest possible expression language (SPEL)" on the web returns numerous resources. The use of SPEL expressions is fully described in Chapter 4's Dynamic User Interface. Reusable Components One of the key advantages of the declarative OA Component development environment is the ease with which you can reuse common page, region and item definitions. See the Shared Regions section in this chapter to see how a common module with its own logic and application module is created and used. Shared Regions Comply with Reuse Standards If you want to create a shared region, you must comply with the following standards. Note: A shared region can include one or more subregions. • The top-level (shared) region must be saved in its own XML file. • You can design your shared region to accept values from a using region. Values may be passed on the request using any of the approaches described in OA Framework State Management, or as a cached value on the page's transaction (also described in the State Management document). • The shared region must be implemented to fail gracefully. For example, if appropriate parameters are not passed from a using region, the shared region should set acceptable defaults or raise a meaningful (and documented) exception. 172
  • 173. Oracle Application Framework Developer's Guide, Release 12.1.3 • If the region scope is set to Public (see Create a Shared Region below for additional information about this): o The top-level region must have its own application module. The application module should include only those view objects that are relevant for the shared region. o The top-level region must have its own controller. You may associate additional controllers with subregions as necessary. • The shared region must be fully documented as described below. Create a Shared Region To create a shared region : 1. In the JDeveloper Navigator, select the OA Project where you want to create your region. 2. From the main menu, choose File > New to open the New Object Gallery. 3. In the Categories tree, expand the Web Tier node, and select OA Components. 4. In the Items list, select Region to open the New Region window. 5. Enter a Name and a Package in accordance with the OA Framework File Standards, and specify the Style of region that you want to create (select your style carefully since you cannot change it once you create the region). Select OK to save create your <Package>.<Name>.xml OA Component document. 6. Select the new region in the JDeveloper Structure pane and set the Documentation Comment property with the content described below. 7. Set the Scope property as appropriate for your planned use of the shared region. For example, for a private region to be used exclusively within the current package, select the Current Package option (note that you can limit access to just your product if you wish). Alternatively, set this to Public to let anyone use it in any page. 8. Set the other properties in your region. 9. When it is time to package and ship your shared region, you must generate the region's Javadoc-like HTML documentation using the Developer Documentation Generator Tool in JDeveloper (see Getting Started with the OA Extension > Command Line Tools for the OA Extension > About the Developer Documentation Generator Tool in the Oracle JDeveloper online Help for additional information). Warning: Pay strict attention to the naming standards in the OA Framework File Standards document when naming your shared region and any of its items and subregions. Since all OA components in a page must have a unique name, adherence to the naming standards will help ensure that your reusable region truly can be reused. Note: Due to naming restrictions, a single region cannot be used more than once in a page. This restriction will be removed at some point in the future. Documentation Comment Content You must add the following content t in the region's Documentation Comment property: 173
  • 174. Oracle Application Framework Developer's Guide /** * Controller for: <shared page/region name including package> * * Scope: < private (for owning product team use only -- this is the default scope), * public (for use by anyone) or oracle (for Oracle E-Business Suite development use only)> * * Usage: < describe the component's purpose and use, including any error messages that * might be raised> * * @param <object parameter 1> <object parameter 1 description and acceptable values> * @param <object parameter 2> <object parameter 2 description and acceptable values> * @param <object parameter N> <object parameter N description and acceptable values> * @see <optionally include references to other objects such as other shared children controllers, if any> */ Note: When describing a parameter, clearly indicate whether the parameter should be passed to the region on the request, or on the application module transaction. The following example illustrates appropriate content for a shared component controller: Controller for: ford.oracle.apps.xyz.webui.FordDistributorAddressRN Scope: Public 174
  • 175. Oracle Application Framework Developer's Guide, Release 12.1.3 Usage: Implements a localized address region for distributors. @param: distID disitributor ID which is passed on the request; required to initialize the region @param: locale locale which is passed on the request; required to correctly localize the address @param: submit passed on the request; if specified, this region will commit its changes. Extend a Reusable Region As mentioned in Anatomy of an OA Framework page, to use a shared region in your page, you simply extend it: 1. In the JDeveloper Structure pane, select the region to which you want to add the shared region. 2. Use your right mouse button to select New > Region from the context menu. 3. Place your cursor in the new region's Extends field in the Property Inspector and select the ... button to open the component browser. Search or browse as you prefer, select the region you want to extend from the results list and select OK to make your choice. 4. JDeveloper enters the fully qualified name of the shared region in the Extends field (for example, /oracle/apps/fnd/framework/toolbox/tutorial/webui/PoSummar yRN). Note that you can edit most of the properties of the base region that you created (you can't change its Style), but the extended region cannot be modified. In fact, its contents render with a gray font in the Structure pane and in the Property Inspector. 5. Save your work. Tip: When you add a shared region with its own application module to your page, the OA Framework automatically nests the component application module beneath your root application module. You don't need to create any explicit design-time relationships between these application modules. To clear an extension, place your cursor in the Extends field and select the Property Inspector's Set to Default toolbar button. Special Case: List of Values (LOV) Although the implementation steps are described elsewhere (see the List of Values topic in Chapter 4), it's worth noting that the LOV can be implemented as a special kind of shared region (you can also create a single-use LOV): • You create a reusable List of Values using the same procedure as you would for any other other shared region, although it does not require an associated controller. 175
  • 176. Oracle Application Framework Developer's Guide • When you want to use the shared LOV in a page, you do not extend it as described above. Instead, you set the base page field's External LOV property and configure the data exchange between the base page and the LOV. Shared Pages A page is really just a shared region whose top-level region happens to be designated as a pageLayout component. As such, a shared page should follow all the region creation standards and instructions described above. • If you want to reuse a standalone page or page flow, simply create a new menu function and point it to the main page (menu functions are discussed below). • If you want to insert a shared page into another page flow with a different root application module, you must create a new page, and then extend the shared page's contents below the pageLayout region. Remember to set the correct root application module on your new page. Shared Items You can also extend individual items from any region, although we recommend that you place items that you intend to share in a reusable region. Sharing the containing region will help ensure that someone doesn't change properties in any arbitrary item without realizing that the change could adversely impact pages using the item. • In the JDeveloper Structure pane, select the item that will extend another item. • Place your cursor in the item's Extends field in the Property Inspector and select the ... button to open the component browser. Search or browse as you prefer, select the item you want to extend from the results list, and select OK to make your choice. • JDeveloper enters the fully qualified name of the item in the Extends field (for example, /oracle/apps/fnd/framework/toolbox/tutorial/webui/PoSummar yRN.OrderTotal). Note that you can edit most of the extended item's properties, but you can't change its Item Style. • Save your work. Sharing Logistics Oracle E-Business Suite product teams should produce internal ARUs to share reusable objects. For teams with a large number of sharable objects that are still changing rapidly, please contact the OA Framework team to investigate the possibility of leveraging the OA Framework daily freeze process. Attribute Sets Attribute sets are named, reusable collections of properties (prompt, maximum display length, data type and so on as appropriate for the attribute set type) that can be used by any type of OA component, including regions, items, and other attribute sets. They are designed to facilitate the 176
  • 177. Oracle Application Framework Developer's Guide, Release 12.1.3 reuse of these components throughout Oracle E-Business Suite, which yields a significant cost savings to both Oracle and its customers: • Oracle saves in translation and maintenance costs. • Customers can make quick, global personalizations to their applications. Additionally, fewer UI elements translates to less middle-tier memory consumption, and ultimately, this means better performance and scalability. In general terms, attribute sets are organized into OA component packages (individual XML package files), where you have one package file per database table in your application: • The package name matches the underlying database table name without underscores. For example, in the OA Framework ToolBox, we have a table called FWK_TBX_PO_HEADERS. The corresponding attribute set package is named FwkTbxPoHeaders. • Individual attribute sets are created for each displayable column in the table. TL translation column attribute sets are included with the base table, as are the displayable values for lookup codes (for example, if a table includes a lookup code for freight terms, the package would include an attribute set for the FreightTerms displayed value). • Column-based attribute sets are named for the corresponding column. For example, in the FWK_TBX_PO_HEADERS table we have a HEADER_ID column. The corresponding attribute set is named HeaderId (this is always used in the context of the fully qualified package name as shown below, so you don't have to worry about multiple tables having HeaderId attribute sets). If there are multiple attribute sets for the same column (so the value is commonly used in several different contexts with different prompts, for example) they are differentiated with prompt suffixes as illustrated for the HeaderId case in the FwkTbxPoHeaders example below. The most common use case for the header id uses the prompt "Purchase Order." The HeaderId_Order attribute set's prompt is "Order" and the HeaderId_Num prompt is "Number." • The table attribute set package may also include attribute sets for common region headers and buttons, which are named for their associated labels. Figure 1: Attribute sets in the FwkTbxPoHeaders.xml package. 177
  • 178. Oracle Application Framework Developer's Guide See Creating Attribute Sets for detailed instructions if you need to create or maintain your own attribute sets. Using Attribute Sets Oracle E-Business Suite developers should use attribute sets in all of the following cases: • All items associated with table.column data values (including any transient items that relate to table values). For example, both a Supplier name search field and a Supplier name data entry field should use the same attribute set. • All common buttons (Go, Apply, Cancel and so on). This also ensures that you correctly inherit the standard accelerator keys for these buttons. Tip: The OA Framework common buttons attribute set package is /oracle/apps/fnd/attributesets/Buttons/<AttributeSetName>. 178
  • 179. Oracle Application Framework Developer's Guide, Release 12.1.3 • All common table action columns (like Delete, Update and so on) should use the corresponding OA Framework button attribute set. • Any shared buttons in your product for which attribute sets have been created; you should not be creating or using attribute sets for single-use buttons • Any shared header regions in your product for which attribute sets have been created; you should not be creating or using attribute sets for single-use headers To use an attribute set for an item: • In the JDeveloper Structure pane, select the item for which you want to specify an attribute set. • Place your cursor in the item's Attribute Set field in the Property Inspector and select the ... button to open the component browser. Search or browse as you prefer, select the attribute set you want to extend from the results list and select OK to make your choice. • JDeveloper enters the fully qualified name of the attribute set in the Attribute Set field (for example, /oracle/apps/fnd/attributesets/Buttons/Apply). Although you can override attribute set properties when you associate them with your items, you should avoid doing this for translated values. If you find, for example, that you need a variant of a preexisting attribute set to display a new prompt, you should create an additional attribute set as described in the Creating Attribute Sets document. Overriding something like a display width is fine. To clear an attribute set, place your cursor in the Attribute Set field and select the Property Inspector's Set to Default toolbar button. Programmatic Access to Attribute Sets You can also access attribute sets in your controller . For example, the following code shows how to obtain a translated prompt from the common Create button attribute set: import oracle.apps.fnd.framework.webui.AttributeSet; ... public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); 179
  • 180. Oracle Application Framework Developer's Guide AttributeSet attrSet = new AttributeSet(pageContext, "/oracle/apps/fnd/attributesets/Buttons/Create"); String createPrompt = (String)attrSet.getAttributeValue(pageContext, PROMPT_ATTR); } URL Parameters: Tokens, Encryption, Encoding Tokens When you specify URL parameters in your declarative page definitions, you can specify both literal and token-substituted values that obtain their data from associated view object attributes at rendering time (in this case, the item must be bound to a view object). This is commonly used, for example, in a table column to pass a primary key value to a detail page for querying. Token Substitution Example (using the view object attribute name "OrderNum"): OA.jsp?OAFunc=FWK_TBX_T_PO_PAGE&order={@OrderNum} Literal Example: OA.jsp?OAFunc=FWK_TBX_T_PO_PAGE&order=123 Token Types Tokens use a special character prefix to tell the OA Framework how to resolve the value at runtime (note that the concepts of "encoding " and "encryption " are described below): • {!Attr} - encrypts the attribute value while leaving the {!} in the URL (for example, OA.jsp?...&ssn={!SSN}&...). Using OAPageContext.getParameter("ssn") will return the decrypted value. • {@Attr} - encodes the attribute value while leaving the {@} in the URL (for example, OA.jsp?...&addr={@EmpAdd}&...). Using OAPageContext.getParameter("addr") to get the parameter value will return the decoded value. • {$Attr} - plain token substitution (no encoding or encryption) so it's your responsibility to ensure that a substituted value does not break the URL. • {@@RETURN_TO_MENU} - Can be used exactly as shown to specify the Destination URI property of an application component if you want it to return the user to the E-Business Suite Personal Home Page. If you need to specify this when performing a JSP forward, the corresponding constant for this is OAWebBeanValues.RETURN_TO_MENU_URL. • {@@RETURN_TO_PORTAL} -- Can be used exactly as shown to specify the Destination URI property of an application component if you want it to return the user to a launching Portal page. If you need to specify this when performing a JSP 180
  • 181. Oracle Application Framework Developer's Guide, Release 12.1.3 forward, the corresponding constant for this is OAWebBeanValues.RETURN_TO_PORTAL_URL. Encoding Any value that you specify for a request parameter must conform to HTTP syntax rules. For example, you can't pass a URL parameter value with a blank space ; the following parameter value would cause a runtime error when the corresponding URL is accessed:buyerName=John Doe. To fix this, we encode these values, meaning that the encoding routine replaces problematic characters with standard substitutions as shown in this example:buyerName=John%20Doe. • When the OA Framework adds parameters to the request (form field values, for example), it automatically encodes them. • When you put parameters on the request during a call to a setForward* method, the OA Framework automatically encodes these values. • When you put parameters on a URL that you assemble yourself (if, for example, you set a bean's URL by calling its setDestination method), you must encode any part of the String that could include invalid characters. To do this, you pass the String to an encode method on the oracle.apps.fnd.framework.webui.OAUrl utility class. Tip: If you manually set a URL parameter value that can't include invalid characters (for example, "value=Y") then you don't need to bother with the encoding step. • When you put values on the request using OAPageContext.putParameter, you must encode the String if necessary. The OA Framework automatically decodes parameter values when you call the OAPageContext.getParameter* methods, except for the following cases: • When you use the "#" character for Javascript function tokens, the OA Framework encodes the token values, but it does NOT automatically decode them when you call pageContext.getParameter("<tokenName>"). To do this yourself, you'll need to use the OAUrl decode method on the value that getParameter returns. • When you call putParameter with an encoded value, the OA Framework does not decode it. You must also use the OAUrl decode method in this case on the value the getParameter returns. Encryption Encryption is the process of obfuscating data to make it illegible. Since URL request parameter values may be visible to the user (and hidden form field values if the user opts to view the HTML page source), you should always encrypt sensitive data if stored in a URL parameter or a hidden field. 181
  • 182. Oracle Application Framework Developer's Guide In addition to the declarative, token-based encryption described above, the OA Framework also provides methods in oracle.apps.fnd.framework.webui.OAPageContext for manually encrypting and decrypting any parameter values that you put on the request programmatically. Style Sheets One of the reasons why OA Framework applications have a pleasing, uniform user interface is the look and feel for each and every page is defined by the Oracle corporate Browser Look and Feel (BLAF) style sheet (blaf.xss). See the BLAF UI Guideline: Text and CSS Standards [ OTN Version ] for a quick reference to the styles. Using Styles All of the regions -- and most of the items -- that you add to the page have their styles set automatically; you don't need to do anything extra (nor should you). As described above, you should be setting region and item properties ONLY if you must override the default behavior. That said, there are several cases where you must set the CSS Class property for your items: • If you create a staticStyledText item to be used for instruction text, you must set its CSS Class to OraInstructionText. • For any text entry fields, checkboxes, poplists and radio buttons you must set the CSS Class to OraFieldText. Do not use OraPromptText for your radio buttons and checkboxes. • If you create a messageStyledText item for displaying read-only data, you must set the CSS Class to OraDataText for the data to render in bold (note that you don't need to set this value for table columns) Tip: New OA Framework developers often make the mistake of trying to significantly change "native" component rendering by changing the CSS style. If you find yourself falling into this trap (and you're frustrated because your style settings don't appear to have any impact on the bean's runtime appearance): • Make sure you're using the right bean (region or item style) for the job. • If you're certain you're using the right bean, check to see if it publishes a method that lets you achieve the desired result. For example, an oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean inherits a setSize(int size) method that lets you control the size of the header text (which is useful when rendering headers in Home page "At a Glance" regions or in side navigation "Search" regions, for example). You cannot achieve this effect by trying to set the header's CSS Class to OraHeaderSubSub as some are tempted to try after reading the BLAF specification that the beans implement. Creating Styles Customers 182
  • 183. Oracle Application Framework Developer's Guide, Release 12.1.3 The OA Framework automatically sets custom.xss to be its main style sheet. Any customizations that you have should be added to this style sheet. For detailed information about style sheets (including customization instructions), see Style Sheets. E-Business Suite Application Developers The custom.xss style sheet mentioned above includes oa.xss, which in turn includes blaf.xss. The oa.xss style sheet is intended to include any extensions that you have to the BLAF style sheet (contact the OA Framework team if you have additions that have been approved by the UI Design and Usability team). You should NOT try to create your own style sheet. Accessibility OA Framework applications are accessible, meaning they can be used by people with disabilities such as blindness, low-vision, color blindness and deafness. In simple terms, accessible products comply with the following guidelines: • the product must be usable without a mouse (keyboard only) • the product must be usable by a blind user (with a screen reader or Braille reader) • there must be no reliance on sound • there must be no reliance on color • there must be no reliance on animation or timing Note: Keyboard-only users should set their Accessibility mode to "Standard" to ensure that the keyboard-only accessible version of user interface enhancements introduced in Oracle E-Business Suite Release 12.1.3 are enabled. This can be done by setting the profile option Self Service Accessibility Features/ICX_ACCESSIBILITY_FEATURES to Standard Accessibility. To create accessible pages: • Oracle Developers must follow the Oracle Global HTML Accessibility Guidelines (OGHAG). The Oracle Global HTML Accessibility Guidelines checklist is a combination of United States Access Board Section 508 Standards and Web Content Accessibility Guidelines (WCAG) that Oracle has adopted to follow. To adhere to specific standards in those guidelines, you must comply with the accessibility guidelines described in the OA Framework View Coding Standards. You must also test your product for accessibility standards compliance before shipping it. See Testing OA Framework Applications for additional information. • Customers may follow the Section 508 Standards and the Web Content Accessibility Guidelines (WCAG). Internationalization 183
  • 184. Oracle Application Framework Developer's Guide OA Framework applications are designed be fully localized. For the most part, this is transparent to you as long as you comply with all the internationalization standards outlined in Chapter 8. Also see the Internationalization document in this chapter for detailed information about language, time zone, date and number support in the OA Framework. Model Interaction Assuming you have specified the appropriate data source bindings, the OA Framework automatically reads data from the model for display in the view, and writes user-entered data in the view back to the model. You don't need to write a single line of code (except for any validation you want to perform in the underlying entity objects, of course). Reading Model Data In simple terms, every time the OA Framework renders a page, it calls the current view object row's get<AttributeName> method for each web bean's associated view object attribute. Consider an example page with a "Suppliers" table, which binds to a SuppliersVO view object. The SuppliersVO maps to an underlying SupplierEOImpl, although it also includes one "calculated" transient attribute ("OnHoldDisplay") that does not have a corresponding entity object attribute. Figure 2: Illustration of how the OA Framework reads model data after a query is executed 184
  • 185. Oracle Application Framework Developer's Guide, Release 12.1.3 1. The user selects the "Search" region's "Go" button to populate search results in the "Suppliers" table. 2. The "Search" region's controller handles the button press by invoking a search method in the root application module, which in turn delegates to the SuppliersVOImpl class so it can query itself. 3. Within the executeQuery method, the SuppliersVOImpl view object performs its SQL SELECT in the database. 185
  • 186. Oracle Application Framework Developer's Guide 4. For each row returned in our example result set, the view object instantiates a SupplierEOImpl entity object and sets its attribute values with the query results. Note: Entity object-based attribute values aren't actually stored anywhere in the view object. They "live" in the entity object, and are retrieved as needed by the view object. "Calculated" (meaning the values are simply selected from a SQL statement and have no relationship to an entity object) or "Transient" view object attribute values are stored on the SuppliersVORowImpl object. See Chapter 5: Implementing Java Entity Objects for additional information about the entity object cache. 5. During page rendering (after all the query processing), the OA Framework uses the view object data bindings defined for each web bean to call the corresponding SuppliersVORowImpl object's getAttribute("<attributeName">) which in turns calls its get<AttributeName> method. 6. The SuppliersVORowImpl get<AttributeName> method in turn calls the corresponding SupplierEOImpl get<AttributeName> method to retrieve the value. For the "calculated" OnHoldDisplay attribute, the view object row retrieves the value from its own cache. Writing Model Data Whenever the browser issues a POST request , the OA Framework automatically writes any user-entered form values back to the underlying view objects, which in turn update any corresponding entity objects as shown below. Figure 3: HTTP POST Data Cycle 186
  • 187. Oracle Application Framework Developer's Guide, Release 12.1.3 Note: The following steps assume that the entity object for the row has already been successfully instantiated and initialized (such as in the create method on the underlying view object for the page when the user originally comes into a Create page. The view object create method calls the corresponding create method on the entity object behind the scenes). 1. UIX performs onSubmit Javascript validation (required fields, data types, formats) and issues the POST request only if this validation succeeds. 2. The browser sends a POST request and the OA Framework calls the processFormData methods on all the web beans in the hierarchy as described in Anatomy of an OA Framework Page. 3. Within processFormData, the OA Framework automatically calls setAttribute(String name, Object value) on the current row of the underlying view object for each bean. This executes any attribute-level validation that you've written in the view object row. 4. Within this setAttribute method, the view object row automatically calls the corresponding set<AttributeName> method in the underlying entity object. This executes any associated attribute-level validation in the entity object. 5. Once all the attribute values have been set, the OA Framework calls the view object validate for each row it modified to execute any associated row-level validation. 6. Finally, within the validate method, the view object row calls validateEntity for the underlying entity object which executes any associated entity-level validation. 187
  • 188. Oracle Application Framework Developer's Guide Note: The OA Framework automatically displays error messages for any exceptions thrown by the model layer during processFormData and does not proceed to the next phase of calling processFormRequest. See Error Handling for additional information about how the OA Framework displays error messages. Bypassing Validation As described above, the OA Framework writes model data for every form submit -- which means that all your attribute and entity level validation is executed. There are times when you need to "short-circuit" this process so errors aren't reported to the user at an inappropriate time. See Implementing the Controller: Model Interaction for specific instructions on preventing this. Defaulting When you create a new row to be used in a "Create" page as shown in Figure 3 above, you can specify default values in three places: • [ Model ] If your view object is based on one or more entity objects, you can override their create() method to programmatically set attribute-level defaults. See the Java Entity Objects Create topic for additional information. • [ Model ] You can also declaratively associate defaults with entity object attributes using the BC4J entity object wizard. Note that Oracle's internal E-Business Suite developers should not use this option. • [ View ] Alternatively, you can set default values for individual items by setting their Initial Value property in the Oracle JDeveloper 10g OA Extension. The advantage of this approach -- for static values that can be determined at design time -- is customers can easily personalize these defaults. This feature can be used with items that do, and do not, map to an underlying view object. For example, you could use this for a search criteria field even though it does not have an associated view object instance. Defaulting is turned off. You must set the value of the profile option FND:OA:Enable Defaults/FND_OA_ENABLE_DEFAULTS to Y to turn on defaulting. If the profile is enabled and a default value is specified in the view (whether in the OA Extension or as personalization) on a form element that is not a messageChoice or messageRadioGroup, then OA Framework sets the value of the item according to the following rules: • If the item has no associated view object data source, the profile option will have no effect and OA Framework automatically sets the default value directly on the item when the page is rendered. Note: If you are trying to set the "Initial Value" of a form bean with Data Type as "Date", then use the canonical format yyyy/MM/dd. Otherwise the default value will not apply. • If the item has an associated view object, OA Framework sets the default value when you call createRow() on your view object. 188
  • 189. Oracle Application Framework Developer's Guide, Release 12.1.3 If the profile is enabled and a default value is specified in the view (whether in the OA Extension or as personalization) on a form element that is a messageChoice or messageRadioGroup, then OA Framework sets the value according to the following rules: • If the value from the current row for the view attribute is not null, the default value specified is set as the default value of the selection. • If the value from the current row for the view attribute is null, the default value shown in the selection will be determined by the default value specified and will be applied to the view object. • Note: If the profile option is not enabled, and the value from the current row for the view attribute is null, the default value shown in the selection will also be determined by the default value specified and will not be applied to the view object. The following example shows typical code for creating a new row: public void createSupplier() { OAViewObject vo = getSuppliersVO(); // The OA Framework applies UI defaults during the scope of this // method call. Row row = vo.createRow(); vo.insertRow(); // As specified in OA Framework Model Coding Standards, // always set the new row state to STATUS_INITIALIZED // after you create it. row.setNewRowState(Row.STATUS_INITIALIZED); } Specifically, the createRow() method calls create() on each ViewRowImpl. In the scope of the create() call, the OA Framework calls the attribute setter for each UI-specified default it needs to apply. This ensures that any view row attribute validation -- and associated entity object attribute validation -- is executed as described in Figure 3 above. The OA Framework then resets the 189
  • 190. Oracle Application Framework Developer's Guide state of your view row to STATUS_INITIALIZED so it appears untouched to BC4J. This ensures that users can navigate to and leave pages having only default values without being warned about the potential loss of work. Any validation exceptions detected during the defaulting process are displayed as normal. Tip: Defaults are applied once and only once when the row is created. If you have a multipage flow with regions that bind to the same underlying view object -- and each region specifies a different Initial Value for one of the view attributes -- only the default associated with the first region that renders when the row is created is applied. The others are ignored. Similarly, if you create a new row on Page A, and then navigate to Page B where you have an Initial Value set for one of its attributes, the default isn't applied because the row was created before Page B renders (note that creating a row before navigating to the page where the user actually enters values for the new row is not consistent with the recommended Back button implementation for a Create flow). Assuming defaults are using each of these three approaches, the OA Framework observes the following precedence priority: 1. (Highest) Declarative item property defaults as specified in the OA Extension or in the Personalizations module 2. Programmatic entity object attribute defaults (these are applied during the scope of the vo.createRow() method call which in turn delegates to your entity object's create() method) 3. (Lowest) Declarative entity object attribute defaults If you want to ensure that a default value is always set regardless of what values might be specified declaratively, you can override the insertRow() method in your view object row as shown below: public void EmployeesVOImpl extends OAViewObjectImpl { ... public void insertRow(Row row) { // Always call super.insertRow() first. 190
  • 191. Oracle Application Framework Developer's Guide, Release 12.1.3 super.insertRow(); // Now call whatever attribute setters you need to call to ensure // that your defaults always take precedence. row.setAttribute("<attributeName>", <attributeValue>); ... } } Menus and Page Security In an OA Framework application, the menu of available pages is presented to the user in a tab- based model as illustrated in the following example from the OA Framework ToolBox Tutorial Application: Figure 4: OA Framework ToolBox Tutorial Application menus. Within this basic model, you are free to choose from a range of valid design options based on your application's complexity and expected usage patterns (when you're ready to start designing menus for your application, consult the Oracle Browser Look-and-Feel (BLAF) UI Guideline: Tabs/Navigation [ OTN Version ] first for a detailed introduction to the various menu configurations). This menu structure serves two distinct purposes in an OA Framework application: • It organizes content into meaningful units. • It lets users navigate easily between these meaningful units. Menu Implementation 191
  • 192. Oracle Application Framework Developer's Guide Behind the scenes, an OA Framework menu is actually comprised of Oracle E-Business Suite functions and menus. Navigation Functions Navigation functions represent the individual pages within your application; each page that a user accesses at runtime is associated with a predefined function, which is used solely for the purpose of navigating through your application. Perhaps most importantly, this function includes the Web HTML Call for the page. For example, in the ToolBox Tutorial Application, when the user selects the Lesson 3 menu entry, the Purchase Order Search page is displayed. We created a function for this page, and set its Web HTML Call to point to the XML page we want to display : OA.jsp?page=/oracle/apps/fnd/framework/toolbox/webui/PoSearchPG When the user selects the Lesson 3 menu entry, the request is routed to the OA.jsp which initializes an oracle.apps.fnd.framework.webui.OAPageBean object to process the corresponding page XML file as described in Anatomy of an OA Framework page (in case you're wondering, OA.jsp is the only JSP that is invoked when accessing any OA Framework application page). Note: A single page can be called by many functions (each potentially passing different parameters through the URL), which means it can be used in many different menus. Navigation Menus Navigation menus are reusable groupings of functions and submenus that ultimately create the tab structure that we described above. Each OA Framework menu that you create has an associated Type that determines how it should be rendered. For example, the Lesson 2 tab in Figure 1 above is of type "HTML Tab." Navigation menus include all functions that can display in your application. You can also selectively grant access to individual functions within this navigation menu. This is described more fully below in the Application Security section. For detailed instructions on designing and creating OA Framework navigation menus, see Chapter 4: Tabs/Navigation. Application Security The features of Application security are broad; in this introductory chapter we'll touch on some key concepts so you have a general idea of what is supported as it relates to menu definitions. When you're ready to start designing your application, we recommend familiarizing yourself with these features by reviewing Page Security in Chapter 4. Users and Responsibilities An Oracle E-Business Suite reponsibility is a collection of tasks that is granted to one or more users as a set. For example, you might create a Benefits Manager and a generic Employee 192
  • 193. Oracle Application Framework Developer's Guide, Release 12.1.3 responsibility, each with the appropriate HR-related applications. You would then assign these responsibilities to individual users to quickly grant access to these modules. All responsibilities are associated with the single top-level navigation menu for your application. As described above, the navigation menu ultimately includes all the tabs supported by your application. Previously, a responsibility was the primary mechanism for grouping users into role-based sets. You would then assign menus to responsibilities, and create security rules by excluding individual menu functions from your responsibility. At runtime, the current responsibility, organization and security group together comprised the security context. With Release 12, the concept of responsibility has been expanded to a more generic role. Users can belong to one or more roles. All users assigned to a particular responsibility are also assigned to a correponding role. Security rules are based on permission grants instead of function exclusion rules. At runtime, these grants are evaluated for the current security context, which now includes roles (also known as a "grantee") in addition to responsibility, organization and security group. The OA Framework recommends using permissions roles and grants for your security setup instead of responsibilities and exclusion rules. Grants and Permissions In addition to creating Navigation Functions, you must also create Authorization Functions (known as "permissions") for each of your pages. You then group these permissions into a "flat" menu structure (known as a "permission set") for the purpose of granting user access to the associated pages. The simplest way to introduce the use of permission sets is by walking through a small use case. For example, assume you have a very simple Benefits application including the following four pages: Page Description Benefits Employee Manager Access? Access? Administer View, update, approve and discontinue benefits. Yes No Benefits Create Benefit Create a new benefit. Yes No My Benefits View current benefit selections and make new Yes Yes selections as appropriate. Update Update designated beneficiaries. Yes Yes Beneficiaries As described above, you would create Navigation Functions for each of these pages and organize them into a comprehensive Navigation menu. To ensure that users have access to the right pages, you would then proceed as follows: 193
  • 194. Oracle Application Framework Developer's Guide Step 1 : Create permissions. Just like the Navigation functions, permissions are FND form functions, but in this context, they are used exclusively for application security. In our example, we can use the Navigation Functions that we created for each page as permissions. There is no need to create additional permission functions. Step 2 : Create roles or grantees. A grantee can either be a user (FND_USER), or a user group(also known as role), or "global". User identities are created in FND_USERS, and should map one-to-one with individual humans or systems. Users can belong to groups or roles that are formed by grouping organizational or position relationships modeled in products such as Human Resources. Roles are defined in WF_ROLES, and in future can map to user groups in a customer's LDAP system. Although its membership is not explicitly populated, there is a Global group which includes "everyone". You need two user roles for the example above: one that groups all managers into a manager role, and another that groups all employees. Since all employees includes everyone, you can use a Global role for this purpose. Alternately, you can create a responsibility that is assigned to all managers, and use that for your grants setup. We will discuss both the above alternatives when we proceed to Step 4 to create the grants. Step 3: Create permission sets. Permission Sets are implemented as menus, but they are exist solely to group a flat list of permissions into sets for easy access granting. Ideally, you should group permissions that are required by a role into one or more permission sets. You need two permission sets for the example above: • A Manager Permission Set for all the tasks to which only managers should have access. This includes the navigation functions "Administer Benefits", and "Create Benefit". • A Global permission set with permissions that are accessible by everyone. This includes the navigation functions "My Benefits" and "Update Beneficiaries". Step 4: Create Grants A Grant defines security rules that allows only certain users of your system access to specific functions or pages within your application. A grant gives a grantee access to the permission sets described above. In simple terms, grants link your grantees to your permission sets. You need two grants for the example above: • A Manager Grant to associate the manager permission set with the manager role. 194
  • 195. Oracle Application Framework Developer's Guide, Release 12.1.3 • An Employee Grant that is associated with your Global permission set with a global grantee. • Since this grant is associated with a global grantee (in other words, everyone) and has no additional security restrictions (in other words it is not restricted to any responsibility, organization or security group), it can also be called a global grant. In addition to specifying a grantee, you could also restict your grant further with additional security context. This includes the current user's responsibility, organization and security group. So, for example, to restrict the manager grant to a specific organization, you can associate an organization context with the grant. Instead of granting the manager permission set to the manager role, you can grant it to a global grantee. You can then restrict it to managers alone by associating a security context with the responsibility to which only managers have access. However note that the OA Framework recommends the use of role based grants instead of responsibilities. At runtime, a user is granted access to a page if the permission associated with the page is granted access to the current user's security context. The user's security context as described above includes the user's role, responsibility, organization and security group. Page Security If you look at the example above, we mention that you can link the permissions with your pages to restrict access. This is one of the cases where you need to secure the rendering of your page with a permission. Other cases where you may want to secure the rendering of your page with a permission include anonymous login pages, pages that require auto responsibility setting or switching, and shared/reusable pages. For detailed instructions please look at Chapter 4: Page Security. 195
  • 196. Oracle Application Framework Developer's Guide Implementing the Controller Overview This document describes how to implement an OA Controller in generic terms. It does not describe how to implement specific UI features. For this information, see individual topics in Chapter 4: Implementing Specific UI Features. Contents • Designing an OA Controller • Creating an OA Controller • Handling an HTTP GET o Modifying Bean Properties o Creating Beans Programmatically • Handling an HTTP POST (Form Submit) • Model Interaction • Disabling Validation • Error Handling • Javascript Prerequisite Reading This document assumes that you have read the following in the OA Framework Developer Guide: • Building "Hello, World!" • JSP Application Primer • Anatomy of an OA Framework Page • OA Framework State Management • Implementing the Model • Implementing the View Designing an OA Controller As described in Anatomy of an OA Framework Page, the OA Controller is where you define how web beans behave. Specifically, you write controller code to: • Manipulate/initialize the UI at runtime (including any programmatic layout that you are unable to do declaratively) • Intercept and handle user events like a button press Controllers should never include any kind of business logic; this belongs in your model classes. Necessity 196
  • 197. Oracle Application Framework Developer's Guide, Release 12.1.3 In general, before tackling the question of how to design your controller, it's important to consider whether you even need to create a controller. As a rule, you should write controller code only if it is absolutely essential. If you can create your page declaratively, do not instantiate regions and items programmatically. Programmatically created web beans cannot be personalized, reused or extended. Furthermore, some hard- coded layouts may fall out of compliance with the Oracle Browser Look-and-Feel (BLAF) UI Guidelines [ OTN Version ] as they evolve over time. As described in Implementing the View, all top-level regions in a shared component must have an associated controller. Granularity OA controllers can be associated with any region (any web bean that implements oracle.apps.fnd.framework.webui.beans.OAWebBeanContainer); you cannot associate controllers with items. Many new OA Framework developers wonder just "how big" a controller should be. Should you have one per page, one per meaningful region (like a "Search" region), one per complex web bean (like a table) -- or what? Unfortunately, the answer is it depends. First and foremost, in a really simple page, you might not have any controllers (there is no requirement that you create controllers if they have no work to do). If you do need to write code, you should weigh the following carefully before deciding what controllers to create: • the benefits of encapsulation -- ideally, a web bean implements its own behavior • component reuse -- if a component is designed to be shared, it must be self-sufficient • practical code usability -- although a page comprised of eight regions could easily have eight corresponding controllers (each with a few, trivial lines of code), this "pure" object oriented approach can make code maintenance more difficult, and it can cause unnecessary file bloat in your product With that in mind, there are a few guidelines that might help the decision-making process: • Never set properties on a parent/grandparent web bean from a child bean. • Always define controllers so they control the regions with which they're associated, or set properties on children/grandchildren of this region. If you want a controller to manage multiple child/grandchild web beans, it should be associated with an appropriate parent/grandparent bean. • For the really complex beans (like an OATableBean) you should associate a controller with the bean itself, or perhaps with a simple containing bean if it represents a logical unit of functionality. In general, you should create the fewest number of controllers per page that satisfies the rules and considerations outlined above. For a very simple page, it is very common to associate a single controller with the pageLayout region. For a more complicated page, you might create a few different controllers for meaningful functional components (for example, a searchable 197
  • 198. Oracle Application Framework Developer's Guide summary page typically has a "Search" region controller and a "Results" region controller). Shared regions should obviously have their own controller(s) as appropriate. Modularity/Reuse Within any group of related pages, you will typically find opportunities to reuse code. The following are all valid approaches to creating more modular controller code: • You can add your own private methods to your controllers. • You can create a common controller that subclasses oracle.apps.fnd.framework.webui.OAControllerImpl, and then subclass this as needed for individual pages/regions. • You can create helper utility classes to which your controller code can delegate as needed. These classes are not required to subclass/implement any OA Framework classes/interfaces, and should be included in the same package(s) as the controller(s) they help. Note that static methods are a natural fit in these (often procedural) classes, and while it is appropriate to include static methods, you should consider the following: o You (and more importantly, the customer) can't effectively subclass static methods. o There are packaging implications related to the use of constants and static methods (see the Oracle E-Business Suite Java Coding Standards). Thread-Safety The OA Framework is designed to support multithreaded web bean access (although this is not yet implemented). Most of this is transparent to you, however, there are a few rules that you must follow in your controller code: • If you use static methods in your controllers or helper classes, never include state. • Always pass the page's OAPageContext to any web bean accessors (if there is a signature that takes an OAPageContext). For example, choose setText(OAPageContext pageContext, String text) instead of setText(String text). State Management Never add non-transient member variables to your controllers, or to helper classes if you instantiate them. The OA Framework does not passivate controller member variables, and will therefore be unable to recover these values once JVM failover is supported. You may add static final member variables. Coding Standards Compliance Before writing any controller code, you should read the following documents carefully. While this topic mentions several key controller standards, it is not intended to be a comprehensive checklist. For any OA Framework code that you write, the documents in Chapter 8 should be considered the "single source of truth" for coding standards. 198
  • 199. Oracle Application Framework Developer's Guide, Release 12.1.3 • Chapter 8: Oracle E-Business Suite Java Coding Standards • Chapter 8: OA Framework File Standards (Naming, Package Structure and Standard Content) • Chapter 8: OA Framework Controller Coding Standards Creating an OA Controller To create a controller for a region: 1. Select the region in the JDeveloper Structure pane 2. Use the right mouse button to select Set New Controller... 3. In the New Controller dialog, enter the package and class names in accordance with the OA Framework File Standards. Select OK to create the controller and associate it with the selected region. Note that the Controller Class value in the property inspector is a fully qualified class name: oracle.apps.fnd.framework.toolbox.tutorial.webui.HomeSearchCO. JDeveloper creates a template controller for you with the following content. /*==================================================================== =======+ | Copyright (c) 2001, 2003 Oracle Corporation, Redwood Shores, CA, USA | | All rights reserved. | +===================================================================== ======+ | HISTORY | +===================================================================== ======*/ package oracle.apps.fnd.framework.toolbox.tutorial.webui; import oracle.apps.fnd.common.VersionInfo; import oracle.apps.fnd.framework.webui.OAControllerImpl; 199
  • 200. Oracle Application Framework Developer's Guide import oracle.apps.fnd.framework.webui.OAPageContext; import oracle.apps.fnd.framework.webui.beans.OAWebBean; /** * Controller for ... */ public class OrderSummaryCO extends OAControllerImpl { public static final String RCS_ID="$Header$"; public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion(RCS_ID, "%packagename%"); /** * Layout and page setup logic for a region. * @param pageContext the current OA page context * @param webBean the web bean corresponding to the region */ public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); } /** * Procedure to handle form submissions for form elements in 200
  • 201. Oracle Application Framework Developer's Guide, Release 12.1.3 * a region. * @param pageContext the current OA page context * @param webBean the web bean corresponding to the region */ public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); } } Note: The default template does not include the processFormData(OAPageContext pageContext, OAWebBean webBean) method that is called during the first phase of POST processing. If you find that you need to use this method (a fairly uncommon scenario), you can simply add it to your controller. To copy a controller: 1. In JDeveloper, open the controller that you want to copy. 2. Select File > Save As... from the main menu. 3. In the Save As dialog, be sure to specify the right Location (Java package) and enter the File name (class name). 4. In the new controller file, remember to edit the package declaration (if necessary) and change the class name. To associate a preexisting controller with a region: 1. Select the region in the JDeveloper Structure pane. 2. Place your cursor in the Property Inspector's Controller Class field and select the ... button. 3. In the Controller Class dialog, expand the package hierarchies until you find the controller that you want to select. Select OK to make your choice. To disassociate a controller from a region: 1. Select the region in the JDeveloper Structure pane. 2. Place your cursor in the Property Inspector's Controller Class field. 3. Select the Set to Default button in the Property Inspector's Toolbar (it is not sufficient to manually clear the value from the field) as shown in Figure 1 below. 201
  • 202. Oracle Application Framework Developer's Guide Figure 1: Highlighted Set to Default button in the OA Extension Property Inspector toolbar Note: You can also associate controllers with regions programmatically. See the setControllerClass(String javaClass) method in OAWebBeanContainer. Handling an HTTP GET During GET processing, each controller's processRequest(OAPageContext pageContext, OAWebBean webBean) method is called as the web bean hierarchy is instantiated. Processing begins with the pageLayout bean, and proceeds recursively throughout the entire hierarchy. Code that initializes your page -- or affects the web bean hierarchy in any way (by setting properties, creating web beans and so on) -- belongs in the processRequest() method. Note: The oracle.apps.fnd.framework.webui.OAWebBean parameter passed to the processRequest() method is the region with which the controller is associated. The following example is typical of the processRequest() code that you will write. It illustrates the initialization of a view-only "detail" page based on a request parameter (for a selected purchase order) passed from a "search" page. /** * Layout and page setup logic for region. * @param pageContext the current OA page context * @param webBean the web bean corresponding to the region */ public void processRequest(OAPageContext pageContext, OAWebBean webBean) { // Always call this before adding your own code. super.processRequest(pageContext, webBean); 202
  • 203. Oracle Application Framework Developer's Guide, Release 12.1.3 // Get the purchase order number from the request. String orderNumber = pageContext.getParameter("headerId"); // We need to set the page header text to include the PO order number for reference. MessageToken[] tokens = { new MessageToken("PO_NUMBER", orderNumber) }; // Always use a translated value from Message Dictionary when setting strings in // your controllers. String pageHeaderText = pageContext.getMessage("ICX", "FWK_TBX_T_PO_HEADER_TEXT", tokens); // Set the po-specific page title (which also appears in the breadcrumbs. Since this // controller is associated with the page layout region, simply cast the webBean // parameter to the right type and set the title. ((OAPageLayoutBean)webBean).setTitle(pageHeaderText); // Now we want to initialize the query for our single purchase order with all of its // details. OAApplicationModule am = pageContext.getApplicationModule(webBean); Serializable[] parameters = { orderNumber }; am.invokeMethod("initDetails", parameters); 203
  • 204. Oracle Application Framework Developer's Guide } // end processRequest() After calling super.processRequest(pageContext, webBean), the example code gets the value for a request parameter named "headerId" (the purchase order number the search page passed on the request). This value is then displayed in the page title and breadcrumbs as context for the user, and passed to the model so the purchase order can be queried. Figure 2: Example of a dynamically defined page title and breadcrumbs using the page title's value Since all values displayed in the page must be translatable, we created a message named FWK_TBX_T_PO_HEADER_TEXT in the Oracle E-Business Suite Message Dictionary with the text "Purchase Order: &PO_NUMBER". The code defines the purchase order number as the replacement value for the token PO_NUMBER, and then obtains a translated version of this message from the oracle.apps.fnd.framework.webui.OAPageContext (which delegates to AOL/J). It then sets the translated String as the page's title. Warning: Never display a hard-coded text value in the user interface. All text values that you display programmatically must be sourced from Message Dictionary as shown. You can also use a value from a web bean that was set declaratively (all displayable bean properties are translated), or you can display a value queried from a multilanguage product table. Finally, this read-only "details" page automatically queries the given purchase order whenever it is rendered. It does this by passing the purchase order number to a method called initDetails() in the page's root application module. The application module then passes this parameter to the appropriate view object, which binds the WHERE clause parameter and executes its query. The Model Interaction section below describes this in greater detail. Modifying Bean Properties Note: As a rule, it is preferable to modify web bean properties using partial page rendering (PPR) and SPEL bindings as described in Dynamic User Interface. The instructions in this section assume you cannot leverage PPR and SPEL for your requirement, and therefore must make changes to the web bean hierarchy in processRequest() (this section is included in the GET handling because you are allowed to modify the web bean hierarchy ONLY in your processRequest() method). If you need to programmatically modify the hierarchy in response to a form submit event (for example, the user presses a button), you must forward back to the same page so your processRequest() code can be executed (see the example in the POST event handling section below). Reasons for this restriction (which you should not try to "work around") include: • Ensures that the web bean hierarchy can be correctly recreated if necessary. 204
  • 205. Oracle Application Framework Developer's Guide, Release 12.1.3 • Beans are initialized properly. This is primarily an issue with the Rendered property, or complex components affected by the prepareForRendering() method. • Bean hierarchy maintanence is encapsulated in a single method. To modify a web bean's properties, you simply need to find the correct bean in the hierarchy using its name (the ID you assigned in JDeveloper), and call the appropriate method as shown in the following example. Warning: When you get a handle to a web bean, always check whether the value is null before calling any of its methods. Even if you expect the bean to be included in the web bean hierarchy, it's possible that a customer may hide it with a personalization. processRequest(OAPageContext pageContext, OAWebBean webBean) { // Always call this before adding your own code. super.processRequest(pageContext, webBean); OATableBean table = (OATableBean)webBean.findIndexedChildRecursive("OrdersTable"); if (table == null) { MessageToken[] tokens = { new MessageToken("OBJECT_NAME", "OrdersTable")}; throw new OAException("ICX", "FWK_TBX_OBJECT_NOT_FOUND", tokens); } // Set the purchase-order specific "control bar" select text: // "Select Purchase Order(s) and..." String selectPOText = pageContext.getMessage("ICX", "FWK_TBX_T_SELECT_PO", null); 205
  • 206. Oracle Application Framework Developer's Guide table.setTableSelectionText(selectPOText); } Starting with the controller region's children, the findIndexedChildRecursive(String name)method searches the entire web bean hierarchy looking for the first indexed child with a matching name. If the web bean that you want to modify is a UIX named child (or, if you're not sure whether it is "named" or "indexed"), use the findChildRecursive(String name) method instead. If you need to modify properties on the controller region, simply cast the processRequest() OAWebBean parameter to the right type and call whatever method you need (see the GET code example above for an illustration of this). Creating Beans Programmatically Note: This section is included in the GET handling because you are allowed to modify the web bean hierarchy ONLY in your processRequest() method. If you need to add beans to the web bean hierarchy in response to a form submit event (for example, the user presses a submit button), you must forward back to the same page so your processRequest() code can be executed. See the example in the POST event handling section below. As a rule, you should NOT create web beans programmatically if you can create them declaratively for all the reasons described above. Furthermore, if your page leverages partial page rendering, your web bean hierarchy cannot be changed at runtime. For those rare cases when you must instantiate a web bean yourself, use the createWebBean() factory methods in the OAControllerImpl class. Do not use any of the web bean constructors directly, and do not worry about creating an oracle.apps.fnd.framework.webui.OAWebBeanFactory directly since the controller createWebBean() methods delegate to the OAWebBeanFactory behind the scenes. Note: For beans created "from scratch" (meaning there is no declarative definition for the bean), use the factory method that allows you to specify the bean's "name" (the ID property in JDeveloper). Avoid the deprecated methods that allow you to create a web bean without specifying its name. The web bean's name uniquely identifies it on a page (each name must be unique within a page), and it is essential for a variety of reasons described in the OA Framework Controller Coding Standards. Furthermore, a bean's name may be used by the OA Framework in a BC4J object instance name (such as an application module instance), and therefore should not include invalid characters for Java names. For example, the following code illustrates how to create two web beans from scratch and add them to a parent region. 206
  • 207. Oracle Application Framework Developer's Guide, Release 12.1.3 OATableLayoutBean tableLayout = (OATableLayoutBean)findIndexedChildRecursive("tableLayout"); // Create a row layout and give it the unique ID "topRow" OARowLayoutBean row = (OARowLayoutBean)createWebBean(pageContext, OAWebBeanConstants.ROW_LAYOUT_BEAN, null, // no need to specify a data type "topRow"); // Create a row layout and give it the unique ID "bottomRow" OARowLayoutBean anotherRow = (OARowLayoutBean)createWebBean(pageContext, OAWebBeanConstants.ROW_LAYOUT_BEAN, null, // no need to specify a data type "bottomRow"); // Always check to see if a web bean exists. if (tableLayout != null) { // Add the two row layout beans to the table so the "topRow" renders above // the "bottomRow" 207
  • 208. Oracle Application Framework Developer's Guide tableLayout.addIndexedChild(row); tableLayout.addIndexedChild(anotherRow); } You can also instantiate web beans that have been defined declaratively, but require a programmatic association with the parent. For example, in the following code, a stackLayout region named "HomeSearchRN" was defined in JDeveloper, but it must be added to the programmatically created side navigation component. OASideNavBean sideNav = (OASideNavBean)createWebBean(pageContext, OAWebBeanConstants.SIDE_NAV_BEAN, null, // no need to specify a data type "sideNav" // always specify name); OAStackLayoutBean search = (OAStackLayoutBean)createWebBean(pageContext, "/oracle/apps/fnd/framework/toolbox/tutorial/webui/HomeSearchRN", "HomeSearchRN", // always specify name true); // region created in Oracle JDeveloper OA Extension sideNav.addIndexedChild(search); Restrictions The OA Framework does not readily support the programmatic addition, removal or replacement of children to any of the "default" regions (for example, an OA Extension defaultSingleColumn region which is instantiated as an oracle.apps.fnd.framework.webui.beans.layout.OADefaultSingleColumnBean) 208
  • 209. Oracle Application Framework Developer's Guide, Release 12.1.3 . These regions should be defined declaratively. If you absolutely must replace or remove items in a "default" region (you cannot add items), follow these steps: 1. Find the child web bean that you want to remove or replace by calling webBean.findIndexedChildRecursive(). 2. Get the child's parent web bean by calling childWebBean.getAttribute(OAWebBeanConstants.PARENT). Note: The OAWebBeanConstants.PARENT attribute is intended exclusively for OA Framework internal development use (if you look at the OAWebBeanConstants Javadoc, you'll see a warning to this effect). You may leverage this approach only for default regions due to their unique implementation; as a rule, the OA Framework Controller Coding Standards discourage modifying parent web beans from child controllers. Furthermore, the default regions have been deprecated so you should not be using them for new development. 3. Then, perform the replace or remove on the parent bean itself. Handling an HTTP POST (Form Submit) During HTTP POST processing, the OA Framework first checks to see if the page's web bean hierarchy is available in its cache. If not, because resources are constrained or the user navigates with the browser Back button, the OA Framework must recreate the web bean hierarchy before proceeding. This means that all of your processRequest() code is re- executed as if the browser had issued an HTTP GET request. Note: The potential recreation of the web bean hierarchy yields a number of coding considerations which are fully described in Chapter 6: Supporting the Browser Back Button and the corresponding OA Framework View and Controller coding standards. The primary POST processing occurs in two separate passes over the web bean hierarchy: • First, OA Framework writes form data to the model by calling processFormData() on each web bean recursively until the entire hierarchy is traversed. Any code that needs to be executed during this processing phase should be added in your controller's processFormData(OAPageContext pageContext, OAWebBean webBean) method. • Assuming no exceptions were thrown during the first processing phase, OA Framework proceeds to the second phase which involves calling processFormRequest(OAPageContext pageContext, OAWebBean webBean)on each web bean. processFormData( ) In most -- if not all -- of the pages that you build, you will have no cause to overwrite this method. In fact, the only use case we could think of is extremely unlikely in an OA Framework application: if the data source for a region is not a view object, so the view instance and attribute 209
  • 210. Oracle Application Framework Developer's Guide properties are not defined for the individual web beans, then you could code the region's processFormData() to write the child web bean data to the appropriate data source. Note: The OA Framework implements processFormData() at the item level, but you can overwrite it only at the region level, so you must process all of the region's items if you ever implement anything like this. If you do choose to implement something like this, remember to call super.processFormData(OAPageContext pageContext, OAWebBean webBean) first. processFormRequest( ) Any code that handles user form submit actions belongs in the processFormRequest() method. The following example is typical of the processFormRequest() code that you will write. It illustrates how to determine that a particular form submit component was selected (in this case, a "Go" button), how to initiate a query in the model code, and how to perform a JSP Forward back to the same page so web bean properties can be changed in the processRequest() method. public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { // Always call this before adding your code super.processFormRequest(pageContext, webBean); // Pressing the Go button causes the search to be executed. If (pageContext.getParameter("Go") != null) { String orderNumber = pageContext.getParameter("SearchOrder"); String created = pageContext.getParameter("Created"); String showMyOrders = pageContext.getParameter("MyOrders"); OAApplicationModule am = pageContext.getApplicationModule(webBean); 210
  • 211. Oracle Application Framework Developer's Guide, Release 12.1.3 // All parameters passed using invokeMethod() must be serializable. Serializable[] parameters = { orderNumber, created, showMyOrders }; am.invokeMethod("search", parameters); // Now forward back to this page so we can implement UI changes as a // consequence of the query in processRequest(). NEVER make UI changes in // processFormRequest(). pageContext.setForwardURLToCurrentPage(null, // no parameters to pass true, // retain the AM OAWebBeanConstants.ADD_BREAD_CRUMB_NO, OAWebBeanConstants.IGNORE_MESSAGES); } } // end processFormRequest(); This example shows how to pass request parameters using the setForwardUrl() method, including how to replace a pre-existing parameter value (in this case, with "X" which would be used as an "ignore" value in the target page). import com.sun.java.util.collections.HashMap; 211
  • 212. Oracle Application Framework Developer's Guide import oracle.bali.share.util.IntegerUtils; ... processFormRequest(OAPageContext pageContext, OAWebBean webBean) { // Always call this before adding your code super.processFormRequest(pageContext, webBean); String poEvent = pageContext.getParameter("poEvent"); HashMap params = new HashMap(2); // Replace the current poEvent request parameter value with "X" params.put("poEvent", "X"); // IntegerUtils is a handy utility params.put("poStep", IntegerUtils.getInteger(5)); pageContext.setForwardURL("OA.jsp?page=/oracle/apps/dem/employee/webui /EmpDetailsPG", // target page null, // not necessary with KEEP_MENU_CONTEXT OAWebBeanConstants.KEEP_MENU_CONTEXT, // no change to menu context null, // No need to specify since we're keeping menu context 212
  • 213. Oracle Application Framework Developer's Guide, Release 12.1.3 params, // request parameters true, // retain the root application module OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // display breadcrumbs OAException.ERROR); // do not forward w/ errors } Note: If a view object is used as a data source for a web bean that is to be displayed, do not remove the view object, its rows, or the containing nested application module. If you want to remove any of these objects before redirecting to a page that will no longer show the view object data (for performance optimization reasons), then after making the remove calls, be sure to redirect to the new page using oracle.apps.fnd.framework.webui.OAPageContext.forwardImmediatelyOAPage Context.setforwardURL). This ensures that the forward action takes place immediately and no further web bean processing is done on the current page after the forward call; otherwise, the removed view object or row instances may cause side effects in subsequent OA Framework web bean processing routines. Posting to an OA Framework Page from a Different Technology If you post to an OA Framework page from a different technology (a JTT page, for example) the OA Framework executes only the processRequest phase in the target page. It does not execute the processFormData and processFormRequest phase. It is important that you do not work around this behavior; please design your application to accommodate this expected behavior. Model Interaction In simple terms, the only model object that you should access directly from your OA controller is the application module. In other words, the only valid model import in your controller code is: import oracle.apps.fnd.framework.OAApplicationModule; You should not access view objects directly to execute queries, iterate the rowset, or interact with the underlying entity object(s). For example, the following code (although technically feasible) is incorrect according to the OA Framework Controller Coding Standards. import oracle.apps.fnd.framework.OAViewObject; ... 213
  • 214. Oracle Application Framework Developer's Guide // Get the root application module OAApplicationModule am = pageContext.getRootApplicationModule(); // Find the view object you want to query OAViewObject vo = (OAViewObject)am.findViewObject("<instanceName>"); ... Instead, if you need to execute a view object query, you should proceed as shown in the following example which illustrates handling a "Go" button press in a "Search" region. First, add a method to the containing application module (in this example, it's the page's root application module) which accepts search criteria and then delegates to the target view object for query execution (see Implementing the Model for information about query execution). public void search(String orderNumber, String created, String showMyOrders) { PoSummarySimpleExpVOImpl vo = getPoSummarySimpleExpVO(); // Always check for the null condition if the VO cannot be found/created if (vo == null) { MessageToken[] tokens = { new MessageToken("OBJECT_NAME", "PoSummarySimpleExpVO")}; throw new OAException("ICX", "FWK_TBX_OBJECT_NOT_FOUND", tokens); } 214
  • 215. Oracle Application Framework Developer's Guide, Release 12.1.3 vo.initQuery(orderNumber, created, showMyOrders); } // end search() Then, add button handler code like the following to your controller which invokes the correct method in the application module. Note that you should always check for an event source in your processFormRequest() code; never assume that the browser issued a POST request because your item was selected (even in a simple page with just one button, for example). Behind the scenes, the OA Framework often submits for the page form when you might not be expecting it to do this. processFormRequest(OAPageContext pageContext, OAWebBean webBean) { // Check to see if the "Go" button was pressed... if (pageContext.getParameter("gButton") != null) { // Get the search criteria String orderNumber = pageContext.getParameter("SearchOrder"); String created = pageContext.getParameter("Created"); String showMyOrders = pageContext.getParameter("MyOrders"); OAApplicationModule am = pageContext.getApplicationModule(webBean); // All parameters passed using invokeMethod() must be serializable. Serializable[] parameters = { orderNumber, created, showMyOrders }; 215
  • 216. Oracle Application Framework Developer's Guide am.invokeMethod("search", parameters); } } Tip: Whenever you call invokeMethod() on a server-side BC4J component, any parameters that you pass must be Serializable. The example above illustrates the invokeMethod() signature that expects all the parameters to be Strings. If you need to pass other object types, use the version of invokeMethod() that takes an array of parameter types. For example: Class[] parameterTypes = { String.class, Hashtable.class, Number.class ...}; am.invokeMethod("search", parameters, parameterTypes); Similarly, since the view object is the conduit to the entity object -- and you should not interact directly with view objects in your controllers -- it stands to reason that you should also route all entity object actions through an application module also. Note: As described in Implementing the Model, the methods that you add in your application module should be named for the corresponding UI "events." For example, if the user presses a "Create" button, the application module method should be named "create" and so on. Create Example processFormRequest(OAPageContext pageContext, OAWebBean webBean) { OAApplicationModule am = pageContext.getApplicationModule(webBean); am.invokeMethod("create", null); } Delete Example This example illustrates invoking a delete method on a nested application module associated with a shared region as opposed to the page's root application module. processFormRequest(OAPageContext pageContext, OAWebBean webBean) 216
  • 217. Oracle Application Framework Developer's Guide, Release 12.1.3 { if (pageContext.getParameter("DeleteYesButton") != null) { // User has confirmed that she wants to delete this purchase order. // Invoke a method on the AM to set the current row in the VO and // call remove() on this row. String poHeaderId = pageContext.getParameter("poHeaderId"); Serializable[] parameters = { poHeaderId }; OAApplicationModule am = pageContext.getApplicationModule(webBean); am.invokeMethod("delete", parameters); } ... Custom Action Example ("Approve") processFormRequest(OAPageContext pageContext, OAWebBean webBean) { if (pageContext.getParameter("Approve") != null) { OAApplicationModule am = pageContext.getApplicationModule(webBean); am.invokeMethod("approve"); } 217
  • 218. Oracle Application Framework Developer's Guide } Commit Example processFormRequest(OAPageContext pageContext, OAWebBean webBean) { // Simply telling the transaction to commit will cause all the Entity Object validation // to fire. // // Note: there's no reason for a developer to perform a rollback. This is handled by // the OA Framework if errors are encountered during the processFormData phase. OAApplicationModule am = pageContext.getApplicationModule(webBean); am.invokeMethod("apply"); } Disabling Validation There are times when you need to bypass the normal validation that occurs during the OA Framework HTTP POST processing. For example, if you are implementing an "Add Another Row" button in a table, you may not want error messages to be displayed for incomplete rows when the user opts to add a new row. Similarly, you might want to defer validation in a multistep page flow until the final review and submit page, or while navigating through sub tabs presenting different views of the same underlying object. Disabling Server-Side Validation To prevent exceptions from being thrown by your model validation logic, call the setServerUnvalidated(true) method on any of the following beans as appropriate for your page (remember to add this web bean modification code in a processRequest() method!): • OASubmitButtonBean • OATableBean 218
  • 219. Oracle Application Framework Developer's Guide, Release 12.1.3 • OAAdvancedTableBean • OASubTabLayoutBean • OANavigationBarBean • OADefaultHideShowBean • OAHideShowHeaderBean Note: You can also set this declaratively by setting the component's Disable Server Side Validation property to True, and you can disable this validation for links or icon that have been configured to perform a form submit. See the Javascript URL section below for additional information. When the user performs an action on one of these beans that causes the form to be submitted, the OA Framework proceeds through all the HTTP POST processing described above -- including executing all your attribute-level validation logic (entity-level validation is not performed). If oracle.apps.fnd.framework.OARowValException or oracle.apps.fnd.framework.OAAttrValException exceptions (or their deprecated suprclasses) are thrown during processFormData(), the OA Framework simply ignores them and continues processing as if it had encountered no exceptions. Note: The OA Framework does not ignore serious exceptions (like a NullPointerException) thrown in processFormData(). These are displayed as usual, and processing does not proceed to processFormRequest(). Furthermore, any exceptions that you or BC4J throw in processFormRequest() are displayed as usual. Disabling Client-Side Validation Whenever a form with user-entered data submits, UIX performs some basic onSubmit Javascript validation (it verifies required fields, data types and formats), and submits the form only if the validation succeeds. To complete the process of bypassing validation, you also need to disable these client-side checks by calling setUnvalidated(true)for the same beans listed in the "Disabling Server-Side Validation" section above. Note: You can also set this declaratively by setting the component's Disable Client Side Validation property to True, and you can disable this validation for links or icon that have been configured to perform a form submit. See the Javascript URL section below for additional information. Tip: For tables and HGrid components, you must enable/disable client-side validation by setting a property for the table and HGrid regions themselves since you do not have direct access to the OANavigationBarBean child web beans used for data set navigation. Note that you currently cannot disable server-side validation for these components. Error Handling The OA Framework automatically displays any error messages thrown in the model layer; you don't need to do anything in your controller to facilitate this. 219
  • 220. Oracle Application Framework Developer's Guide • See Error Handling for information about throwing exceptions in your controller code and displaying Error, Warning, Confirmation and Information messages at the top of a page. • See Chapter 4: Dialog Pages for information about displaying a model Error, Warning, Confirmation, and Information dialog page. Javascript UIX and the OA Framework are rapidly adding new features to provide a more interactive user experience (partial page rendering, automatic table totaling, and so on). You are certainly encouraged to leverage these features as they are released, however, you should not attempt to implement them yourself before they're ready. In short, Javascript is prohibited without explicit permission from the OA Framework team. Furthermore, you must have confirmation from the corporate UI design team that a Javascript implementation is essential for your product. Javascript URL Previously, there was one exception to the Javascript prohibition: if you wanted to configure a link or image to submit the page form (because you need an event to handle before navigating to a new page), you could set its destination property to the UIX submitForm Javascript function Now, even this small amount of Javascript is prohibited. Instead, you should configure a fireAction event instead of using the Javascript URL. See the Declarative Submit Form documentation for additional information. 220
  • 221. Oracle Application Framework Developer's Guide, Release 12.1.3 Error Handling Overview This document describes how to throw OA Framework exceptions in your model and controller code. Contents • Exception Types • Exception Classes • Bundled Exceptions • Exception Examples • Dialog Pages and Message Boxes Prerequisite Reading • Implementing the Model • Implementing the View • Implementing the Controller Related Information • Implementing Entity Objects • Implementing PL/SQL Entity Objects Exception Types The OA Framework handles three basic types of exceptions: general, validation and severe. These types are briefly described in this section; specific exception usage instructions are provided below. General Exceptions Errors in the BC4J framework are handled by throwing an implicit (runtime) exception of the type oracle.jbo.JBOException. The OA Framework has its own specialization of this called oracle.apps.fnd.framework.OAException . This specialization provides a mechanism for bundling multiple exceptions together, while also translating the exception messages using Oracle E-Business Suite Message Dictionary, so that useful messages can be displayed. In any of your code, you can throw an OAException for general, page-level exceptions. Validation Exceptions Validation exceptions are thrown from entity objects and view objects for both row and attribute level validation failures. 221
  • 222. Oracle Application Framework Developer's Guide • oracle.apps.fnd.framework.OAAttrValException - specialization of OAException used for attribute level validation failures • oracle.apps.fnd.framework.OARowValException - specialization of OAException used for row (entity) level validation failures The OA Framework displays error messages to the user as follows: • Attribute-level exceptions are visually indicated on the error item(s) and at the top of the page • Row-level exceptions are visually indicated on the error row(s) and at the top of the page • Page-level exceptions are visually indicated at the top of the page Severe Exceptions Severe (or "fatal") exceptions include unexpected system-level errors (like a NullPointerException) and selected JBOExceptions like NoDefException. You can also deliberately throw a severe exception in your code. If a fatal exception occurs, the user is directed to the OAErrorPage (f the fatal exception occurs in the middle of page rendering, the page is partially rendered with a user-friendly error message that includes a link to the detail stack trace). The OAErrorPage also displays a user- friendly error message with a link to the detail stack trace. Note: This is an untranslated message that customers can change on site. Oracle Workflow Notification The OA Framework also ships a seeded business event (oracle.apps.fnd.framework.OAFatalError)which sends a notification to the SYSADMIN user whenever OA Framework page reports a severe or fatal exception. The notification includes the detailed error stack for the fatal exception and information about the user who encountered the exception. If you wish to change the notification's default recipient from SYSADMIN, you need to customize the definition of Item Type OAERROR. The subscription to this business event is disabled by default. To enable the subscription, refer to the Oracle Workflow documentation on how to enable a subscription for a business event. • If you are using Oracle Workflow Release 11i/2.6, with the original Oracle Applications user interface, see "To Update or Delete an Event Subscription", Oracle Workflow Developer's Guide. • If you are using the OA Framework-based user interface for the Business Event System, see "To View and Maintain Event Subscriptions", Oracle Workflow Developer's Guide. Exception Classes The OA Framework exception inheritance hierarchy is shown in Figure 1 below. The OAException superclass extends JBOException. OAAttrValException and OARowValException extend OAViewObjectException, a deprecated class that extends OAException. 222
  • 223. Oracle Application Framework Developer's Guide, Release 12.1.3 Figure 1: OA Framework exception inheritance hierarchy OAException OAException is the exception that you would throw in generic error cases (for example, if you encountered an unexpected problem in some controller code as shown): OACellFormatBean shipTermsCell = (OACellFormatBean)webBean.findIndexedChildRecursive("ShipTermsCell"); if (shipTermsCell == null) { MessageToken[] tokens = { new MessageToken("OBJECT_NAME", "ShipTermsCell")}; 223
  • 224. Oracle Application Framework Developer's Guide throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", tokens); } Note that we created a message in the Oracle E-Business Suite Message Dictionary (FWK_TBX_OBJECT_NOT_FOUND) in the AK application. The message was defined with a token (OBJECT_NAME) that we replace with the name of the UI component that we expected to find. The OA Framework will use this information to automatically display a properly translated error message at the top of the page (if you instantiate an OAException, and don't specify the message type, it always renders as an error). Note: Although it is not an explicit coding standard, it is good coding practice and beneficial to wrap an exception rather than create a new exception: throw OAException.wrapperException(myException); Wrapping an exception creates a new OAException that includes the original exception as a detail exception. By wrapping an exception, the core exception gets reported and OA Framework inspects the original exception to determine its severity. If you create a new exception, you do not get that information, and the exception stack trace stops with your code, resulting in a bug with less information. Since the OAException is a flexible object that can also be used to display other types of messages to the user (Information, Confirmation and Warning), you can also instantiate it with a message type as shown for the following Confirmation example (see the Dialog Pages and Message Boxes section below for pointers to documents that describe how to use these features to display Information, Confirmation and Warning messages). MessageToken[] tokens = { new MessageToken("SUPPLIER_NAME", name), new MessageToken("SUPPLIER_NUMBER", supplierId) }; OAException confirmMessage = new OAException("AK", "FWK_TBX_T_SUPPLIER_CREATE_CONF", tokens, OAException.CONFIRMATION, null); 224
  • 225. Oracle Application Framework Developer's Guide, Release 12.1.3 Message Type The OAException, OAAttrValException, and OARowValException classes all include constructors that accept a message type (byte) parameter. The message type parameter tells OA Framework the type of message to display to a user. Valid options include: • OAException.ERROR • OAException.WARNING • OAException.INFORMATION • OAException.CONFIRMATION • OAException.SEVERE OAAttrValException If any attribute-level validation fails in a view object row or an entity object, you can throw an OAAttrValException as shown below. To instantiate this exception, you must pass the following information: • Source object type (OAException.TYP_ENTITY_OBJECT or OAException.TYP_VIEW_OBJECT) • Full entity definition name or view instance name as appropriate • Primary key of the entity or row • Attribute name being validated • Attribute value that failed validation • Error message application short name • Error message name Entity Object Example public void setSalary(Number value) { if (value != null) { // Verify value is > 0 if (value.compareTo(0) <= 0) { throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT, // indicates EO source 225
  • 226. Oracle Application Framework Developer's Guide getEntityDef().getFullName(), // entity name getPrimaryKey(), // entity primary key "Salary", // attribute Name value, // bad attribute value "AK", // nessage application short name "FWK_TBX_T_EMP_SALARY_REQUIRED"); // message name } setAttributeInternal(SALARY, value); } } // end setSalary() View Row Example Also see the Mapping section below for additional information about raising these exceptions from a view row. setDescription(String value) { if("XXX".equals(value) { throw new OAAttrValException ( OAException.TYP_VIEW_OBJECT, // indicates VO row source getViewObject().getFullName(), //View Object full usage name getKey(), // row primary key "Description", //attribute name 226
  • 227. Oracle Application Framework Developer's Guide, Release 12.1.3 value, // bad attribute value "FND", //message application short name "ATTR_EXCEPTION"); // message name } setAttributeInternal("Description", value); } // end setDescription() OARowValException If any row-level validation fails in a view object row or an entity object, you can throw an OARowValException as shown below. To instantiate this exception, you must pass the following information: • Full entity definition name or view instance name as appropriate • Primary key of the entity or row • Error message application short name • Error message name Entity Object Example protected void validateEntity() { super.validateEntity(); if(attr1!=attr2) throw new OARowValException ( getEntityDef().getFullName(), // entity full definition name getPrimaryKey(), // entity object primary key "FND", // message application short name "ATTR_EXCEPTION"); // message name } View Row Example Also see the Mapping section below for additional information about raising these exceptions from a view row. 227
  • 228. Oracle Application Framework Developer's Guide protected void validate() { super.validate(); if(attr1!=attr2) throw new OARowValException ( getViewObject().getFullName(),//View Object full usage name getKey(), // row primary key "FND", // message application short name "ATTR_EXCEPTION"); // message name } Overriding the Row-Level Error Prefix When the OA Framework renders row and attribute error and warning messages in tables, the message is comprised of two components: row prefix + error message. For example: • Row 2 Error: <Some error message relating to the entire row 2> • Row 2 <Attribute Prompt>: <Some error message relating to the given attribute in Row 2> You can optionally override this prefix if the default row references are not appropriate for your user interface. For example: • Line 2-3 Error: <Some error message relating to this row in the table> • Line 2-3 <Attribute Prompt>: <Some error message relating to the given attribute in this designated row> To implement this: Step 1: Create a transient view object attribute to include the translated String that you want to display as the row prefix. Step 2: Create a custom property for the view object: • Set its Name to ROW_DISPLAY_PREFIX_ATTR_NAME • Set its Value to the name of the attribute that you created in Step 1 When processing exceptions related to this view object, the OA Framework will check to see if this custom property is set, and if it is, will use the designated attribute value as the row prefix. Note: For consistency, the OA Framework applies this prefix to any error or warning message that you generate, plus any row-level messages that it generates internally. Mapping Entity Attributes into VO Attributes 228
  • 229. Oracle Application Framework Developer's Guide, Release 12.1.3 When you create custom view row methods that throw exceptions originating in entity object, you must call doEntityToVOMapping on the exception to create a mapping between the entity object attributes and the view object attributes as shown in the following example: /** * Approves the purchase order associated with this row. */ public void approve() { // Whenever you write custom methods on the VO Row that call custom methods // on the Entity Object you need to do a manual mapping as shown below // to correctly handle the entity exceptions. try { getPurchaseOrderHeaderEO().approve(); } catch(OARowValException e) { OAViewObject[] vos = {(OAViewObject)getViewObject()}; e.doEntityToVOMapping(getApplicationModule(), vos); throw e; } } // end approve() Behind the scenes, the OA Framework calls this method for you for exceptions thrown in the following methods: 229
  • 230. Oracle Application Framework Developer's Guide • viewRow.setAttribute() • viewRow.validate() (catches all exceptions thrown from eo.validate()) • create(AttributeList) • viewRow.remove() Note: If you override these methods, this mapping is performed when you call super. If your overriding code explicitly throws entity object exceptions, then you need to call doEntityToVOMapping. Bundled Exceptions Bundled exceptions let you accumulate "peer" exceptions while proceeding with validation, and then display them as a set when you are done. These peer exceptions are grouped in a container exception called a bundled exception. Bundled exceptions can include any kind of server-side exceptions (including system-level exceptions, data formatting errors, attribute validation errors, row validation errors, and entity creation errors). Peer Exceptions List To creat a bundled exception, you first must create a list to which you add exceptions as you encounter them: ArryList peerExceptions = new ArrayList(); peerExceptions.add(new OAException(....)); peerExceptions.add(new OAException(....)); ... Bundled Exceptions When you're ready to throw your bundled exception, call OAException.getBundledOAException to create the bundled OAException from the list of peer exceptions that you pass to it or call OAException.raiseBundledOAException to create and throw the bundled OAException immediately. • Note that bundling similar APIs are also available on OAAttrValException and OARowValException. • See the various accessors published by the OA*Exception classes for interacting with bundled exceptions (remember that the bundled exception itself is simply a container including the peer exceptions array). During entity and row validation, if you don't want to do your own bundling, you can also register exceptions. These exceptions will be thrown when validation completes, or when an exception is explicitly thrown as illustrated in the examples below (see the Javadoc for 230
  • 231. Oracle Application Framework Developer's Guide, Release 12.1.3 oracle.apps.fnd.framework.server.OAEntityImpl and oracle.apps.fnd.framework.server.OAViewRowImpl). BC4J Bundled Exception Mode When this mode is disabled, all exceptions thrown by the entity attribute setters are thrown right away to the calling view row, which then throws the exception to the caller. When you enable bundled exception mode, BC4J stacks exceptions thrown from the entity attribute setters, and throws them end of valdiateEntity, or when validateEntity throws an exception. All of these exceptions are bundled into a single exception that is returned to the caller. You can enable this mode by calling: OADBTransaction.setBundledExceptionMode(true); By default, this mode is disabled. We recommend that you do not use this feature as the OA Framework collects all exceptions on your behalf without this. Exception Examples Example 1 The following code example illustrates how to catch exceptions and throw them as a single bundled exception. public void foo() { ArrayList exceptions = new ArrayList(); for(int ...; ...; ...) { if(.....) { exceptions.add(new OAException(.....)); } } 231
  • 232. Oracle Application Framework Developer's Guide OAException.raiseBundledOAException(exceptions); } Example 2 The following code caches exceptions thrown during validateEntity(), and then throws the cached exceptions as one bundled exception. protected void validateEntity() { super.validateEntity(); ArrayList exceptions = new ArrayList(); //check for duplicate Filter Name if (getEntityState() == STATUS_NEW) { String value = getFilterName(); OADBTransaction tx = getOADBTransaction(); OAApplicationModule vam = getMyValidationAM(); FiltersVOImpl vo = vam.findViewObject("filtersViewUsage"); if (vo == null) { vo = vam.createViewObject("filtersViewUsage","oracle.apps.qrm.filter.server .FiltersVO"); vo.setMaxFetchSize(-1); 232
  • 233. Oracle Application Framework Developer's Guide, Release 12.1.3 vo.initQuery(value,"C"); Row r = vo.first(); if (r != null) { exceptions.add( new OAAttrValException ( OAException.TYP_ENTITY_OBJECT, // Entity attribute exception. getEntityDef().getFullName(), //Entity full def name getPrimaryKey(), //Row primary key "FilterName", //Attribute Name value, //Bad Value "QRM", //Message Application Short Code "QRM_UNIQUE_FILTERS_ERR")); //Message Code } } //check for empty filters(no conditions) EntityDefImpl def = EntityDefImpl.findDefObject("oracle.apps.qrm.filter.server.QrmFilterCo nditionsEO"); Iterator iterator = def.getAllEntityInstancesIterator(getDBTransaction()); String flag = "no"; while (iterator.hasNext()) 233
  • 234. Oracle Application Framework Developer's Guide { QrmFilterConditionsEOImpl fcEO = (QrmFilterConditionsEOImpl)iterator.next(); // only check rows in valid state if ( fcEO.getEntityState() != STATUS_DELETED && fcEO.getEntityState() != STATUS_DEAD ) { flag = "OK"; } } if (flag.equals("no")) { exceptions.add( new OARowValException ( getEntityDef().getFullName(), getPrimaryKey(), //Row primary key "QRM", //Message Application Short Code "QRM_NO_CONDITIONS_ERR")); //Message Code } OAException.raiseBundledOAException(exceptions); } Example 3 The following code example caches exceptions thrown in a view object method, and then throws the cached exceptions as one bundled exception. 234
  • 235. Oracle Application Framework Developer's Guide, Release 12.1.3 public void checkUsed() { String ifSelected = null; String name; ArrayList exceptions = new ArrayList(); FiltersVORowImpl row = (FiltersVORowImpl)first(); while (row != null) { ifSelected = (String)row.getAttribute("SelectFlag"); if ("Y".equals(ifSelected)) { name = (String)row.getAttribute("FilterName"); OAViewObjectImpl vo = (OAViewObjectImpl)getApplicationModule().findViewObject("IsFilterUsedV O"); vo.setWhereClause(null); vo.setWhereClauseParams(null); vo.setWhereClauseParam(0,name); vo.executeQuery(); Row r = vo.first(); //if there are analyses, then use them if (r != null) { String msg= (String)r.getAttribute("AnalysisName"); String flag ="f"; while (r != null) { //change flag if it was the first row,if not append analysis name if (flag.equals("f")) flag = "N"; else msg = msg +", "+ (String)r.getAttribute("AnalysisName"); r = vo.next(); } MessageToken[] tokens = {new MessageToken("FILTER_NAME",name), new MessageToken("ANALYSIS",msg)}; exceptions.add( new OARowValException( getViewObject().getFullName(), row.getKey(), "QRM", 235
  • 236. Oracle Application Framework Developer's Guide "QRM_FILTER_REMOVE_ERR", tokens)); } } row =(FiltersVORowImpl)next(); } OAException.raiseBundledOAException(exceptions); } Example 4 The following code example registers a validation exception in set<Attribute>() so BC4J can throw this exception later during the entity validation. public void setAmount(oracle.jbo.Number amnt) { // Clears any old exceptions for a fresh start. clearAttributeException("Amount"); if(amnt < 0) { OAAttrValException attrEx = new OAAttrValException( OAAttrValException.TYP_ENTITY_OBJECT, getEntityDef().getFullName(), getPrimaryKey(), "Amount", amnt, "QRM", "QRM_AMOUNT_IS_NEGATIVE"); registerAttributeException(getEntityDef().getAttributeDefImpl("Amount" ),amnt, attrEx); } } Example 5 This code example registers exceptions thrown during validateEntity()so BC4J can throw these exceptions when validation completes. 236
  • 237. Oracle Application Framework Developer's Guide, Release 12.1.3 protected void validateEntity() { super.validateEntity(); // Clears all Row and Attribute exceptions registered in validateEntity() for a fresh start. clearAttributeException("FilterNAme"); clearRowExceptions(); //check for duplicate Filter Name if (getEntityState()==STATUS_NEW) { String value = getFilterName(); OADBTransaction tx = getOADBTransaction(); OAApplicationModule vam = getMyValidationAM(); FiltersVOImpl vo = vam.findViewObject("filtersViewUsage"); if(vo == null) { vo = vam.createViewObject("filtersViewUsage", "oracle.apps.qrm.filter.server.FiltersVO"); } vo.setMaxFetchSize(-1); vo.initQuery(value,"C"); Row r = vo.first(); if (r != null) { OAAttrValException attrEx = new OAAttrValException ( OAException.TYP_ENTITY_OBJECT, // Entity attribute exception. getEntityDef().getFullName(), //Entity full def name getPrimaryKey(), //Row primary key "FilterName", //Attribute Name value, //Bad Value "QRM", //Message Application Short Code "QRM_UNIQUE_FILTERS_ERR")); //Message Code 237
  • 238. Oracle Application Framework Developer's Guide registerAttributeException(getEntityDef().getAttributeDefImpl("FilterN ame"), value, attrEx); } } //check for empty filters(no conditions) EntityDefImpl def = EntityDefImpl.findDefObject("oracle.apps.qrm.filter.server.QrmFilterCo nditionsEO"); Iterator iterator = def.getAllEntityInstancesIterator(getDBTransaction()); String flag = "no"; while (iterator.hasNext()) { QrmFilterConditionsEOImpl fcEO = (QrmFilterConditionsEOImpl)iterator.next(); // only check rows in valid state if ( fcEO.getEntityState() != STATUS_DELETED && fcEO.getEntityState() != STATUS_DEAD ) flag = "OK"; } if (flag.equals("no")) { registerRowException( new OARowValException ( getEntityDef().getFullName(), getPrimaryKey(), //Row primary key "QRM", //Message Application Short Code "QRM_NO_CONDITIONS_ERR")); //Message Code } } Dialog Pages and Message Boxes For information about displaying modal Error, Information, Warning and Confirmation dialog pages, see Chapter 4: Implementing Dialog Pages. For information about displaying Error, Information, Warning and Confirmation messages boxes at the top of a page (when not simply displayed automatically as a consequence of throwing an exception), see Chapter 4: Implementing Message Boxes. 238
  • 239. Oracle Application Framework Developer's Guide, Release 12.1.3 Creating Attribute Sets Overview This document describes how to create attribute sets in accordance with the OA Framework coding standards. Contents • Designing Attribute Sets • Creating Attribute Set Packages Manually • Creating Attribute Sets Manually • Generating Attribute Sets Automatically • Deploying Attribute Sets Prerequisite Reading This document assumes that you have read the following in the OA Framework Developer Guide: • Anatomy of an OA Framework Page • Implementing the View Designing Attribute Sets Note: This section is intended for internal Oracle E-Business Suite developers only. First and foremost, all attribute sets that Oracle E-Business Suite developers create must comply with the following standards: • The OA Framework View Coding Standards describe the circumstances under which you should (must!) create attribute sets. Note that attriubte sets are also required for service definitions. See Creating Services for additional information. • The OA Framework File / Package / Directory Structure standards describe all the naming conventions that you should use for the attribute set packages and individual attribute sets. It also describes the directory structure that you should use for the XML package files. Once you understand the standards, you're ready to proceed: 1. Product teams who own some of the key shared data entities (example: TCA, ITEMS and FND) should take the lead on building the attribute sets associated with their schema. 2. If you need to use a column for which no attribute set is currently published, you should coordinate with the owner team to have the attribute set created. If, for any reason, the owner team can't meet your schedule requirements, you can make an arrangement with 239
  • 240. Oracle Application Framework Developer's Guide the owner team to create the attribute set on their behalf and hand it over for source control and packaging. 3. Before creating an attribute set, make sure it is truly unique and warranted (do NOT duplicate existing attribute sets without explicit permission from the OA Framework team). 4. Changes to existing attribute sets are not permitted until an impact and mitigation study is conducted by the OA Framework team. 5. As a rule, you should generate your table-based attribute set packages automtically using the procedure described below, and then make any necessary manual edits. Creating Attribute Set Packages Manually As described in Implementing the View, all attribute sets are created into the context of an OA Component package file. To create an attribute set package in JDeveloper: 1. In the JDeveloper Navigator, select the OA Project where you want to create your package. 2. From the main menu, choose File > New to open the New Object Gallery. 3. In the Categories tree, expand the Web Tier node, and select OA Components. 4. In the Items list, select Package File to open the New Package File dialog. 5. Enter a Name and a Package in accordance with the OA Framework File / Package / Directory Structure standards. Select OK to save create your <Package>.<Name>.xml OA Component document. 6. Save your work. Creating Attribute Sets Manually To create and edit individual attribute sets in JDeveloper: 1. Identify which Attribute Set Template (all of which are described in the next section) you should be using based on the kind of attribute set you need to create. For example, if you are creating a button attribute set, you need to use the Button Template. 2. In the JDeveloper Applications Navigator pane, select the attribute set package to display its contents in the Structure pane. 3. In the Structure pane, select the Attribute Set folder, right-click and select New > Attribute Set to open the New Attribute Set dialog. 4. In the New Attribute Set dialog, enter an Attribute Set Name in accordance with the OA Framework File / Package / Directory Structure standards. Per the attribute set template that you identify in Step 1, select all the appropriate properties in the Available Properties list and shuttle them to the Included Properties list. Select OK to create the attribute set. 5. Enter values for the attribute set's included properties in the Property Inspector. 6. Save your work. Generating Attribute Sets Automatically (Only on Linux) 240
  • 241. Oracle Application Framework Developer's Guide, Release 12.1.3 In order to facilitate the process of creating table-related attribute set packages and attribute sets, you should automatically generate these using a command-line utility. Prerequisites 1. Before proceeding, make sure that any tables for which you want to generate attribute sets are fully described in FND_TABLES and FND_COLUMNS (to do this, you need to load properly defined XDF table definitions). The table name, column name and column descriptions defined in these entities become the basis for the generated attribute sets. 2. You should check out any preexisting attribute set packages from source control that you want to update with the generator. Note the physical location of the XML files in your working area. Running the Attribute Set Generator To automatically generate new and updated existing attribute sets, run the Attribute Set Generator from the Linux command line as shown below. This utility will create new attribute sets, and update preexisting attribute set Comments property values with the corresponding column descriptions in FND_COLUMNS. You can elect to generate attribute sets for an entire product, or for specific tables within a product. Once you generate your attribute sets, you can maintain all other properties in JDeveloper as described above (the generator never overrides any other property values). Note: For persistent attributes, the Comments property value is always copied from FND_COLUMNS (the column description value in FND_COLUMNS should be treated as the single source of truth). If you need to make changes to the Comments property value, you need to change the underlying column description. The resulting attribute set packages and attribute sets are named according to the OA Framework naming conventions. Correct naming and packaging is essential for service creation since the OA Framework automatically detects table.column attribute sets using these naming conventions, and defaults them when you create view object attributes that map to persistent entity attributes. The following shows the online help for the attributesets command: ****** attributesets ****** Creates or Updates attribute set files Parameter(s) passed to attributesets: 1 = Username to database 241
  • 242. Oracle Application Framework Developer's Guide 2 = Password to database 3 = Database hostname 4 = Database port number 5 = Database SID 6 = Xml classpath. Location to where your XML files are located (Example: /home/[name]/jdevhome/myprojects) 7 = Application Short Name (Example: PO) ----- optional parameter(s) ----- 8 = Table Specification. Default is to generate attribute sets for all tables belonging to Application Short Name (parameter 7). Example 1) PO_VENDORS - generates the attribute set PoVendors.xml Example 2) PO_VENDOR% - generates the attribute sets for all tables that match the query PO_VENDOR%. 9 = Package (Example: /oracle/apps/po/attributesets) Examples Assuming the generated attribute set package will be /oracle/apps/po/attributesets, the following command generates all the attribute sets for the PO product, and puts the resulting files in the /home/jfrost/jdevhome/jdev/myprojects/oracle/apps/po/attriubtesets directory. /jdevbin/<SelectedJDevBuild>/build attributesets APPS APPS appsdbs.us.oracle.com 1521 devdb /home/jfrost/jdevhome/jdev/myprojects PO Assuming the generated attribute set package will be /oracle/apps/po/attributesets, the following command generates all the attribute sets for PO tables starting with the name PO_VENDOR, and puts the resulting files in the /home/jfrost/jdevhome/jdev/myprojects/oracle/apps/po/attriubtesets directory. 242
  • 243. Oracle Application Framework Developer's Guide, Release 12.1.3 /jdevbin/<SelectedJDevBuild>/build attributesets APPS APPS appsdbs.us.oracle.com 1521 devdb /home/jfrost/jdevhome/jdev/myprojects PO PO_VENDOR% Attribute Set Templates JDeveloper supports a large variety of properties when creating an attribute sets. In consideration of reuse, customization, verticalization and translation realities, Oracle E-Business Suite product teams should limit themselves to the templates provided in this section. • Properties designated as Required must be included in the attribute set definition with appropriate values. • Optional properties must NOT be included in the attribute set definition unless there is a sensible property to specify. If you include a property in an attribute set without populating its value, you run the risk of unintended behavior when combining attribute set usage with extension. • Do NOT include any properties not explicitly listed in these templates. Table.Column Template The following is a list of the properties that may be used to define table column attribute sets. You should also use this template if you create a Transient.xml attribute set package for commonly used attributes that have no associated base table. Property Description Required Specific Guidelines Additional Text Used for bubble help and Optional tooltips. Comments Desribes the associated Required Examples include: attribute. Need-By Date Note: This value is used as for Date by which line items must attribute-level comments as be delivered. described in Creating Services. Promise Date Note: For persistent attributes, Date by which supplier promises this value should be copied to deliver line items. from FND_TABLES as described above. Receipt Date Date on which line items were received. Data Type VARCHAR2, DATE, Required for Specify only for transient items DATETIME, NUMBER, or transient that has no mapping to a data BOOLEAN (might change to items entity. Otherwise must default to JAVA like types in the future) data type of associated data 243
  • 244. Oracle Application Framework Developer's Guide attribute. Document Required See the OA Framework File / Name Package / Directory Structure standards. Height Display height Optional Use for multi-line input text only. Length Item display Length Optional Number of characters to display, should be between 1 and maximumLength value Maximum Maximum number of Required for Specify only for transient items Length characters allowed in the item transient that has no mapping to a data value. items entity. Otherwise must default to value length of associated data attribute. Prompt Item's prompt Required Required Is runtime form value required? Required for Specify only for transient items transient that has no mapping to a data items entity or when overriding a not- required value corresponding to a persistent data entity. Tip Message Message Dictionary message Optional, Specify if applicable Appl Short application short name. depends on Name tipType Tip Message Message Dictionary message Optional, Specify if applicable Name name. depends on tipType Tip Type dateFormat, longMessage, Optional Specify if applicable shortTip, and none. For longMessage and shortTip, you must specify the Tip Message Appl Short Name and the Tip Message Name. Button Template The following is a list of the properties that may be used to define button attribute sets. Property Description Required Specific Guidelines Additional Text Used for bubble help Required Required for buttons per Accessibility and tooltips. standards. Comments Describes attribute set Required Must include the context in which the usage attribute set is used. Document Required See the OA Framework File / Package / Name Directory Structure standards. Prompt Button label Required 244
  • 245. Oracle Application Framework Developer's Guide, Release 12.1.3 Region Header Template The following is a list of the properties that may be used to define header attribute sets. Property Description Required Specific Guidelines Additional Text Used for bubble help Optional and tooltips. Comments Describes attribute set Required Must include the context in which the usage attribute set is used. Document Required See the OA Framework File / Package Name / Directory Structure standards. Icon URI Header icon Optional Populate only if applicable to most uses Maximum Maximum number of Required for Specify only for transient items that Length characters allowed in transient items has no mapping to a data entity. the item value Otherwise must default to value length of associated data attribute. Prompt Header text Required Deploying Attribute Sets Once you create your attribute sets, you need to deploy them so they can be used by other developers. Note: the process for this is currently being designed for the Oracle E-Business Suite Division. 245
  • 246. Oracle Application Framework Developer's Guide Internationalization Overview Contents • User Preferences • Language • Timezone • Client Character Encoding • Dates • Numbers/Currency • Text and Component Alignment • Localized Layouts • Calendar Support • Character Encoding of BC4J XML Files Prerequisite Reading • Implementing the Model • Implementing the View • Implementing the Controller Related Information • OA Framework Naming / File / Package / Directory Structure Standards • OA Framework View Coding Standards User Preferences Most OA Framework application pages include a standard global Preferences button, which is used to change the following locale-related session settings: • Language • Territory • Timezone • Client character encoding • Date format • Number format When a user logs in, locale information is stored in ICX_SESSIONS and OA Framework automatically considers these settings when rendering pages and handling data. See OA Framework State Management for additional information about the Oracle E-Business Suite User Session. However, you must use the OA Framework methods described below when doing any explicit manipulation of locale-sensitive data. This is so that it can be converted and formatted correctly 246
  • 247. Oracle Application Framework Developer's Guide, Release 12.1.3 according to user's preferences and cultural conventions and not the default locale setting and default encoding. Note: Obtain the locale information like country, language, date/number format and so on by calling the getUserLocale() and getUserLocaleContext()methods on oracle.apps.fnd.framework.OANLSServices, which itself can be retrieved from an oracle.apps.fnd.framework.webui.OAPageContext in a controller or an oracle.apps.fnd.framework.OADBTransaction in model code). Language All text that is displayed to a user must be fully translatable. This section describes how you ensure this for an application. Note: When a value is "eligible for translation," it displays in the correct language for the user assuming a translation is present. If not, the value is displayed in American English regardless of the user's language preference. Menu Definitions and Responsibilities All the displayable properties that you define for menus, functions, and responsibilities are eligible for translation. At runtime, the Oracle E-Business Suite displays these values in the user's language, assuming that a translation for that language has been completed. OA Component Definitions All the displayable properties that you define declaratively in the Oracle JDeveloper OA Extension are also eligible for translation. At runtime, OA Framework displays these values in the user's language, assuming that a translation for that language has been completed. Some web beans let you declaratively specify a message name for long text. This message is defined in an Applications repository called Message Dictionary, and it is fully translatable. At runtime, OA Framework displays the appropriate text for the user's language. Tip: See the Oracle E-Business Suite Developer's Guide for information about creating messages using Message Dictionary. You can also define lists of attribute/value pairs (known as "Lookup Codes") for use in the UI to display translated values to the user while your code deals with the static attributes. Tip: See the Oracle E-Business Suite Lookups online help for information about creating lookup codes. To translate an OA component definition, use the OA Extension Translation toolset. Refer to Translating Personalizations Stored in MDS in the OA Framework Personalization Guide for detailed instructions. Although these instructions are specific to translating a personalization, you can follow the same steps, but instead of locating and specifying a personalization document to translate, you simply locate and specify a OA component definition to translate. 247
  • 248. Oracle Application Framework Developer's Guide Code Any other text that you display yourself, such as in exceptions or programmatically defined beans, must be retrieved from a translated data source ( Message Dictionary, a translated product table, or from a declaratively defined web bean whose displayed values are translated). Never display hard-coded text strings in the UI! Note: Oracle E-Business Suite developers using OA Framework do not use Java resource bundles. To retrieve a product specific message from Message Dictionary, use OAPageContext.getMessage() as shown in the following example: MessageToken[] tokens = { new MessageToken("PO_NUMBER", orderNumber)}; String pageHeaderText = pageContext.getMessage("AK", "FWK_TBX_T_PO_HEADER_TEXT", tokens); To set a message for bundled exceptions or validation exceptions, use the oracle.apps.fnd.framework.OAAttrValException and oracle.apps.fnd.framework.OARowValException classes as illustrated in Error Handling. To display the translated text for a static styled text item, for example, simply call its getText() method as shown. Remember to always use any web bean accessor signatures that take OAPageContext as a parameter: OAMessageStyledTextBean styledTextBean = (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("itemName") ; String itemText = styledTextBean.getText(pageContext); Tip: For information about creating messages using Message Dictionary, see the Oracle E- Business Suite Developer's Guide. You can also refer to the Applications Release Engineering Messages Translation Rules for additional rules regarding Message Dictionary translation. Timezone 248
  • 249. Oracle Application Framework Developer's Guide, Release 12.1.3 With global e-business, customers from one timezone can place orders that are created in a server in a different timezone. In this case, the time difference (encompassing both the time zone and Daylight Saving Time) must be reconciled between the client and the server. See Profile Options for information about the Oracle E-Business Suite client and server timezone profile options. OA Framework automatically reconciles this difference for you. For example, all queried date- time values are displayed in the user's time and written in the server's time. To manually convert values based on the client and server timezones, OALNSServices publishes a number of methods for this purpose. Client Character Encoding During file upload, file download or data export, OA Framework automatically sets the file encoding to the client character encoding defined by the profile option FND: NATIVE CLIENT ENCODING. Note: The value of this profile option is an Oracle character set name (for example WE8ISO8859P1), which is not understood by Java. If you get the client character encoding value from the FND: NATIVE CLIENT ENCODING profile using the OAPageContext method getProfile(), the value returned may cause your Java code to throw a runtime exception because it will not recognize the Oracle character set name. Instead, always get the client character encoding value by calling the OANLSServices method getJAVAClientEncoding(). This method maps the Oracle character set name to its equivalent Java encoding name and returns a Java value that you can then supply to any Java API that requires encoding. Date and Time Date and time information can be represented as a String in Java Date/Time Format, a String in Oracle Date/Time Format, a Java Date/Time Object, or as an Oracle Date Object. You need to know what kind of format you are dealing with, and call the right methods to convert from one type to another. Some of the most common conversion methods are listed below; see the OANLSServices and oracle.apps.fnd.framework.OAFwkUtils Javadoc for additional information. To convert a String in user specified date/time format (Oracle date/time format) to a Java Object, use the OANLSServices methods: public Date stringToDate(String text); public Timestamp stringToDateTime(String text); To convert a Java Date/Time object to a String in the user specified date/time format ( Oracle date/time format), use the following OANLSServices methods: 249
  • 250. Oracle Application Framework Developer's Guide public String dateTimeToString(Date dateTime); public String dateToString(Date date); To convert from Oracle Date/Time Format to Java Date/Time Format, use the following OAFwkUtils methods. Retrieve the user specified date/time format mask by calling OANLSServices.getDateFormatMask(): public static String oracleToJavaDateFormat(String userDateFormatMask); public static String oracleToJavaDateFormat(String userDateFormatMask, boolean isNumeric); public static String oracleRRRRToJavaDateFormat(String userDateFormatMask); public static String oracleRRRRToJavaDateFormat(String userDateFormatMask, Boolean isNumeric); Note: These methods support only a subset of the Oracle formats. For unsupported Oracle formats, the MM/dd/yyyy or mm/dd/yy Java format will be returned. Also, the conversion between Oracle Date/Time Format and Java Date/Time Format is currently hardcoded, so adding a new format for conversion requires an OA Framework code change. In the future, the implementation will be changed to store conversion information in a flexible mapping table. Warning: There is a mismatch between the Java Date Oracle Date formats when the month format mask is MON. In this case, the to_date function might return an error. To avoid this, always set any WHERE clause bind variables with Date data. The following example illustrates converting a String date to an appropriate format for use as a WHERE clause bind variable: initQuery(String submittedDateString) { Vector parameters = new Vector(1); StringBuffer whereClause = new StringBuffer(100); // where clause for ViewObjects. 250
  • 251. Oracle Application Framework Developer's Guide, Release 12.1.3 if ((submitedDateString != null) && (submitedDateString.length() != 0)) { java.sql.Date javaSqlDate = transaction.getOANLSServices().stringToDate(submitedDateString); whereClause.append("DATE_COLUMN_NAME = :1"); parameters.addElement(javaSqlDate); } setWhereClause(whereClause.toString()); Object[] params = new Object[1]; parameters.copyInto(params); setWhereClauseParams(params); executeQuery(); Formatting DateTime Fields The following example illustrates changing the formatter/validator of number or date beans to format DateTime fields without time: OAWebBean bean = ... OANLSServices nls = pageContext.getOANLSServices(); oracle.cabo.ui.validate.Formatter formatter = new OADateValidater(nls.getUserJavaDateFormat(), nls.getUserRRRRJavaDateFormat()); bean.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter); The following example illustrates changing the formatter/validator to format dates with time: 251
  • 252. Oracle Application Framework Developer's Guide OAWebBean bean = ... OANLSServices nls = pageContext.getOANLSServices(); oracle.cabo.ui.validate.Formatter formatter = new OADateValidater(nls.getUserJavaDateFormat()+"HH:mm:ss", nls.getUserRRRRJavaDateFormat()+"HH:mm:ss"); bean.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter); To provide a specific date format mask for date fields, use: oracle.cabu.ui.validate.Formatter formatter = new OADateValidater("dd-MMM-yyyy", "dd-MMM-YY"); Note: Although the DateTime field gets formatted to not display the time, it still presents the value in the user's timezone. Note: Arabic and Hijrah calendars are supported as of OA Framework Release 12.1. To provide a specific date format mask for date fields that include a calendar, specify the desired calendar type when using OADateValidater: oracle.cabu.ui.validate.Formatter formatter = new OADateValidater("dd-MMM-yyyy", "dd-MMM-YY", calendarType); The session calendarType can be retrieved by calling OANLSServices as follows: OANLSServices nls = pageContext.getOANLSServices(); int calendarType = svc.getCalendarType(svc.getUserCalendar()); Numbers/Currency Numbers 252
  • 253. Oracle Application Framework Developer's Guide, Release 12.1.3 When a Number is rendered as a String in the browser, OA Framework automatically formats it based on the user's number format preference (numbers can be displayed with different grouping size, grouping separators as well as different decimal separators (for example,. "," or ".")). If you need to perform your own conversions between Java Numbers, Oracle SQL Numbers and Strings, you can use OANLSServices without having to worry about the user's locale because OA Framework handles this for you. For example, to convert a String number representation to a Java Number or an Oracle SQL Number object, you should use the following APIs. Warning: Do not use Java functions like Integer.parseInt() or Double.parseDouble() because they do not take the locale related number formatting into consideration when they do String parsing. public Number stringToNumber(String text); public Number stringToNumber(String text, String formatMask); To convert a Java Number object to a String number representation use: public String NumberToString(Number num); public String NumberToString(Number num, String formatMask); The following code illustrates correctly converting a Double to a String: java.lang.Double num = new java.lang.Double(123456.7890); String strNumber = pageContext.getOANLSServcies().NumberToString(num,"###,###,##0.00000;- ###,###,##0.00000"); The following API's have been introduced in OANLSServices for BigDecimal data. For converting String to java.math.BigDecimal object: public BigDecimal stringToBigDecimal(String text); public BigDecimal stringToBigDecimal(String text, String formatMask); 253
  • 254. Oracle Application Framework Developer's Guide For converting java.math.BigDecimal to a String representation public String bigDecimalToString(BigDecimal num); public String bigDecimalToString(BigDecimal bigDecimal, String formatMask); Validating Number Fields OA Framework uses the following rules to validate number fields: • The decimal and thousand separator characters must follow the preference setting 10,000.00 or 10.000,00. • When validating, the thousand separator character is ignored. • The decimal separator character is validated. Examples for a 10,000.00 preference: • 10,345,2 will be taken as 103452. • 10.32 will be taken as 10.32. • 10.2.3 will not pass validation. To provide a specific number format mask for number fields, use: oracle.cabu.ui.validate.Formatter formatter = new OADecimalValidater("###0.###;-###0.###","#.##0.###;-#,##0.###"); Currency In addition to the basic number formatting, with a currency value you must also display the correct symbol for the currency code and locate it properly in relation to the value. To convert a Number (a Java Number or an Oracle SQL Number) to its String currency representation, call OANLSServices.formatCurrency(Number num, String currencyCode). To parse a String representation of a currency value to produce a Java Number, call OANLSServices.parseCurrency(String text, String currencyCode). The following example shows how to properly format a currency number value: java.lang.Double num = new java.lang.Double(123456.7890); 254
  • 255. Oracle Application Framework Developer's Guide, Release 12.1.3 String currencyFormattedNumber = pageContext.getOANLSServcies().formatCurrency(num,"USD"); To convert a java.math.BigDecimal to its String currency representation. public String formatCurrency(BigDecimal num, String currencyCode); To parse a String representation of a currency value to produce a java.math.BigDecimal public BigDecimal parseCurrencyToBigDecimal(String text, String currencyCode); Validating Currency Fields OA Framework uses the following rules to validate currency fields: • The decimal and thousand separator characters must follow the preference setting 10,000.00 or 10.000,00. • Validation is much stricter than for a normal number field. • The number format must be in exactly the current format regarding where the thousand separator is placed as well as in the number of decimal points. Examples for a 10,000.00" preference and USD currency: • 1,034,522 will pass the validation. • 1,034,52 will not pass the validation. • 10.3 will be taken as 10.30. • 10.312 will be taken as 10.31. • 10.2.3 will not pass validation. Text and Component Alignment OA Framework automatically aligns components correctly in a bi-direction session. If you explicitly align components, always set "start" and "end" alignment; never use "right" and "left." If you need to set this programmatically, use the OAWebBeanConstants H_ALIGN_START and H_ALIGN_END as shown: OACellFormatBean cell = (OACellFormatBean)createWebBean(pageContext, 255
  • 256. Oracle Application Framework Developer's Guide OAWebBeanConstants.CELL_FORMAT_BEAN, null,"exampleCell"); formatedCell.setHAlign(OAWebBeanConstants.H_ALIGN_END); Localized Layouts Unfortunately, OA Framework APIs do not currently provide standard web beans for common localized layouts like name and address (this is planned for a future release). In the interim, you must implement appropriate layouts yourself. Calendar Support OA Framework supports multiple calendars in date and datetime formatting and parsing. The supported calendars are below: • Gregorian Calendar (default) • English Hijrah Calendar • Arabic Hijrah Calendar • Thai Buddihst Calendar The date formatting and parsing are handled by OA Framework automatically based on the user's preferred calendar. If there is a requirement to support an additional calendar, as an exceptional case, developers must change the existing code to take advantage of multiple calendar support. The exception is to format or parse a date/datetime manually with an arbitrary date format. As an example, if the following OANLSServices APIs are called in the code, developers can consider calling new APIs. dateToString(java.util.Date date, String formatMask) stringToDate(String text, String formatMask) OANLSServices has a variety of APIs to format or parse a date/datetime, and most of the APIs are sensitive to the calendar. However, the APIs listed above always work on a Gregorian based Calendar and this is intentional behavior. The APIs that take a date format as an argument are calendar insensitive. This is based on the assumption that the caller of those APIs must know the date format of the date to be parsed or formatted, and the Gregorian calendar date/datetime would be expected in such cases. If non-Gregorian calendars are required, where the above APIs are called, developers must change the existing code to call one of the following new OANLSServices APIs: 256
  • 257. Oracle Application Framework Developer's Guide, Release 12.1.3 dateToString(java.util.Date date, String formatMask, String calendarName) dateToString(java.util.Date date, String formatMask, int calendarType) stringToDate(String text, String formatMask, String calendarName) stringToDate(String text, String formatMask, int calendarType) calendarName is the name of the calendar stored in the profile option. calendarType is the integer calendar type code that is defined in oracle.apps.fnd.i18n.text.AppsDateFormatter. Developers have to specify the target calendar to format/parse a date/datetime with arbitrary date format. The majority of the cases in manual date formatting/parsing can be based on the user's preferred calendar. Developers can get the user's preferred calendar using the getUserCalendar() API in OANLSServices. Refer to the following code snippets to rewrite the existing API call with calendar support. //Format/parse a date with user's preferred calendar OANLSServices nls = pageContext.getOANLSServices(); //String formattedDate = nls.dateToString(date, formatMask); String formattedDate = nls.dateToString(date, formatMask, nls.getUserCalendar()); //Date parsedDate = nls.stringToDate(text, formatMask); Date parsedDate = nls. stringToDate(text, formatMask, nls.getUserCalendar()); Here are some sample cases where API calls might need to be replaced Hardcoded Date String If you are using hardcoded date strings in your logic, such as a particular date, "12-31-4712" to indicate "does not expire", the hardcoded strings are usually based on the Gregorian calendar, requiring attention to your OANLSServices API choice. To make a Date object from a hardcoded Gregorian date string, you must call a calendar insensitive API such as OANLSService.stringToDate(String dateString, String format). Calendar Insenstive Conversion As an example, your need to convert between OANLSServices.dateTimeToString() and OANLSServices.StringToDateTime() and the conversion is to be done based on a Gregorian Calendar, the API calls must be replaced as follows: OANLSServices nls = pageContext.getOANLSServices(); // String FormattedDate = nls.dateTimeToString(dateTime) 257
  • 258. Oracle Application Framework Developer's Guide String FormattedDate = nls.dateToString(dateTime, nls.getUserJavaDateFormat() + " HH:mm:ss"); // Date parsedDate = nls.stringToDateTime(dateTimeString) Date parsedDate = nls.stringToDate(dateTimeString, nls.getUserJavaDateFormat() + " HH:mm:ss"); Since dateTimeToString() and StringToDateTime() do not have a signature to specify a format or a calendar, use dateToString() or stringToDate() with the session date time format. The session date time format can be assembled from the session date format and the constant string " HH:mm:ss". Remember to add one space character before the time format. The session date format can be retrieved using getUserJavaDateFormat() API. Refer to the OANLSServices javadoc for more detail of the new APIs and their calendar sensitivity. Character Encoding of BC4J XML Files Character encoding of BC4J region or page definition XML files is automatically set based on JDeveloper's environment encoding. JDeveloper's environment encoding is set based on your operating system's locale when you launch JDeveloper for the first time (specifically when you create your system folder). OA Framework and the Oracle E-Business Suite Internationalization team strongly recommend using "UTF-8" for BC4J XML file encoding. Some encodings, such as Asian native encodings, may cause unexpected Java errors depending on the environment configuration. Note: US-ASCII encoding and some European encodings are acceptable for use, based on the "Basic Encoding Set" of Java-supported encoding. If you need to use encodings other than the Java "Basic Encoding Set", please consult with the OA Framework team first. 258
  • 259. Oracle Application Framework Developer's Guide, Release 12.1.3 Files in a Typical OA Framework Application Overview This document lists the files that comprise a typical OA Framework application and is organized into the following categories: • Workspaces and Projects • Java • XML • Seed Data • Images • JSPs • Style Sheets For each file type the list indicates whether you should expect to source control and package/ship the file in a product ARU. Note: The instructions for source controlling and packaging/shipping apply to Oracle's internal E-Business Suite developers. Related Information • Chapter 8: OA Framework Files / Package / Directory Standards Workspaces and Projects Type Description Source Package/Ship Control <Name>.jws A JDeveloper OA Workspace XML definition Optional Never * <Name>.jpr A JDeveloper OA Project XML definition Optional Never * <Name>.jpx A JDeveloper OA Project XML definition (additional Optional Never file created for BC4J projects) * bc4j.xcfg JDeveloper configuration file for each BC4J project Optional Never * * Tip: Source controlling your workspaces and projects so people don't need to track down all the files that comprise a given module makes collaborative development easier. If you do want to source control your workspaces and projects, you should include all of the files listed here. Java Type Description Source Package/Ship 259
  • 260. Oracle Application Framework Developer's Guide Control UI Controller Java controllers associated with UI Required Required regions. BC4J Implementations: Java implementation for each BC4J Required Required component that you create. • Application Module • Entity Object • View Object • View Row Entity Expert A special class associated with entity Required Required objects. Utility Classes Any supplemental classes that you create Required Required for use by other model or controller code. XML Type Description Source Package/Ship Control UI Definitions XML definition for each UI component file Required Required that you create. A file can include a • Page complete page definition or a shared • Reusable Region region. You can also create "packages" • Attribute Sets for attribute set definitions and related UI Package components (for example, all the • UI Components pages/shared regions in a multistep Package transaction flow). BC4J Definitions XML definition for each BC4J component Required Required that you create. • Application Module • Association Object • Entity Object • View Object • View Link BC4J server.xml Automatically maintained by JDeveloper Required Required for each BC4J package that you create. Seed Data 260
  • 261. Oracle Application Framework Developer's Guide, Release 12.1.3 Although an OA Framework application can include any standard Oracle E-Business Suite seed data (concurrent program definitions, attachments, flexfields, profile options, lookup types/codes and so on) menus, messages and page flow Workflow definitions are listed separately since they are particularly common in any OA Framework application (the menu definition is required, and it is almost certain that you will create translatable messages). Type Description Source Package/Ship Control Menus (.ldt) All menu Required Required definitions associated with an OA Framework application. Messages (.ldt) Translatable Required Required text strings defined in Message Dictionary. Page Flow Workflow Definitions (.wft) Item type for Required Required an OA Framework UI page flow. Others Standard Required Required Oracle E- • Security (Users, Responsibilities) Business • Sequential Numbers Suite seed • Attachments data as • Concurrent Program Libraries, Definitions required for and so on any • Profile Options and Values application. • Multilanguage/Currencies/Territories • Lookup Types and Lookup Codes • Flexfields • Functional Workflow Definitions • Online Help Navigation Trees Images OA Framework pages can include a rich visual vocabulary. However, all images are created by the Oracle User Interface Design and Usability team and deployed centrally in special OA Framework Image ARUs, so individual applications do not include image files. JSPs 261
  • 262. Oracle Application Framework Developer's Guide Alll OA Framework page URLs are routed through a single, central JSP (OA.jsp) which is provided by the OA Framework. There is no need for an OA Framework application to create additional JSPs, although external JSPs can be embedded in an OA Framework page (see JTT/OA Framework Interoperability for additional information). Style Sheets All OA Framework applications use a single style sheet which is provided by the OA Framework. Oracle's internal E-Business Suite Development teams cannot ship additional, product-specific style sheets (you can, however, add styles to the central style sheet). See Working with Style Sheets additional information about this. 262
  • 263. Oracle Application Framework Developer's Guide, Release 12.1.3 Chapter 4: Implementing Specific UI Features Accelerator Keys ('Hot Keys') Overview As described in the Oracle Browser Look and Feel (BLAF) UI Guideline: Keyboard Shortcuts [ OTN Version ], OA Framework pages provide support for two kinds of "hot keys" for quickly performing selected actions/navigation using the keyboard: • Mnemonic (Common) Accelerator Keys - centrally defined mnemonic letter and symbol assignments for commonly accessed buttons as shown in Figure 1 below. • Numeric (Application-Specific) Accelerator Keys - numeric assignments which may be selectively assigned to common actions within a given application page. Figure 1: Accelerator Keys in Common Cancel and Apply buttons. In Windows, users exercise the accelerator keys by selecting Alt + <char> from the keyboard. • For buttons, the accelerator key "activates" the widget. For example, typing Alt + p on the page shown in Figure 1 selects the Apply button and submits the form. • For message beans, the accelerator key sets the focus to that bean. For example, if you designate "2" as the numeric accelerator key for a messageTextInput, then typing Alt + 2 moves your cursor to that text field. • Accelerator keys are automatically provided for subtabs. At runtime, users can quickly move focus to the next or previous subtab by selecting Alt + > and Alt + < from the keyboard. Selecting Enter displays the subtab contents. Mnemonic (Common) Accelerator Keys Declarative Implementation The centralized list of mnemonic accelerator keys is maintained in the Keyboard Shortcuts UI guideline, and implemented by the OA Framework team in the standard attribute sets contained in the package /oracle/apps/fnd/attributesets/Buttons. To ensure that any instances of buttons that you have on this list inherit the correct accelerator key value, simply assign the button the appropriate attribute set in this package. The following process is the easiest way to ensure that you specify the correct attribute set in JDeveloper: 263
  • 264. Oracle Application Framework Developer's Guide 1. Select your button to access the Property Inspector and select the Attribute Set property's LOV icon. 2. In the Attribute Set window, enter the button label that you're seeking in the Attribute Set field (for example, Go, Apply, Cancel and so on). 3. Opt to perform a search in the Entire MDS XML Path. 4. Select the Search button to find the matching attribute set in /oracle/apps/fnd/attributesets/Buttons. For example, Searching for "Apply" should return the attribute set /oracle/apps/fnd/attributesets/Buttons/Apply. Tip: A Perl upgrade script is provided to help you quickly set the correct attribute sets for preexisting code (if needed). Runtime Control If you need to programmatically set the prompt for a common button (there should be little or no reason to do this), you may call the setText(String) method with an ampersand character (&) immediately before the character to serve as an accelerator key. For example, UIX will assign"r" as the accelerator key for the String value Sea&rch. Note that you must also explicitly set the short description to an appropriate value by calling the setShortDesc(String). For example, if the prompt is set to "Sea&rch", then the short description should be set to "Search" or something similar. Tip: The character & itself can be included in the prompt by using the value &&. Any values that you set when calling setText or setShortDesc must be translated (you cannot use untranslated, static Strings). Although you could obtain the values from message dictionary for this, a better approach would be to use the values set in the corresponding attribute sets. For example, you could reuse the prompt definition from the /oracle/apps/fnd/attributesets/Buttons/Apply attribute set. See Programmatic Access to Attribute Sets in Implementing the View. Numeric (Application-Specific) Accelerator Keys You may -- in exceptional cases where rapid navigation/action execution is essential for frequent users -- assign numeric accelerator keys for selected items in a page. At runtime, numeric access keys appear underlined if present in the component's prompt. If not, UIX appends the underlined access key to the end of the prompt and encloses it in parentheses. For example: Some Button (9). Declarative Implementation Step 1: Create an item with one of the following styles: • button • submitButton • any message* style 264
  • 265. Oracle Application Framework Developer's Guide, Release 12.1.3 Step 2: Set the Access Key property to a value of 0 - 9 by selecting it from the property's poplist. Note: Limit your access key implementation to product-specific buttons where execution speed is absolutely essential for high-frequency users. So, for example, you don't need product- specific button access keys in a self-service application that is likely to be used once a year. Runtime Control If you need to set the access key programmatically, call setAccessKey(char) on any of the supported beans. Warning: You MUST use a value of 0 - 9. Do not use letters as these are reserved for use by UIX for the common accelerator keys. Personalization Considerations • None. Known Issues • None Related Information • BLAF UI Guideline(s) o Keyboard Shortcut [ OTN Version ] 265
  • 266. Oracle Application Framework Developer's Guide Attachments Overview As described in the Oracle Browser Look-and-Feel (BLAF) UI Guidelines: Attachments Templates [OTN version] and Attachments Flows [OTN version], use the attachments feature to associate a URL, file content, or text with an object, such as an expense report, contract, or purchase order. To enable the attachments feature, you should first understand the concept of an entity. An entity is an object within Oracle E-Business Suite data, such as an item, an order, or an order line. (An entity is not related to BC4J Entity Objects). The attachments feature must be enabled for an entity before users can link attachments to the entity. In the context of attachments, an entity can be considered either a base entity or a related entity. A base entity is the main entity of the region. A related entity is an entity that is usually related to the region by a foreign-key relationship. An entity consists of a set of view attribute names (declared through your OA Extension region items), which are the primary keys for the view object related to your region. When an attachment is stored, the values of these primary keys and the Entity ID are stored so the attachments can be uniquely retrieved. Several regions can access the same entity, providing a consistent view of attachments throughout your application. OA Framework also supports multiple entities associated with a region item, with functionality similar to the core functionality of attachments in Oracle E-Business Suite Forms-based functions. For instance, a purchase order has a PO Header and PO Lines. At the line level, you can add attachments pertaining to the entity PO_LINES. Note that you usually enter an item number in PO Lines. When you create the item in the master Item form, you can add an attachment, such as a picture of the item, that gets stored with a different entity, such as MTL_SYSTEM_ITEMS. With multi-entity support, when you view the attachments for a PO Line, you can see the attachments for both entities, that is, PO_LINES and MTL_SYSTEM_ITEMS. Contents • Attachment Styles in a Region • Attachments User Interface • Inline Attachments • Enabling the Attachments Feature for an Entity o Declarative Implementation o Runtime Control o Enabling Virus Scanning • Personalization Considerations • Services Exposed • Known Issues • Related Information 266
  • 267. Oracle Application Framework Developer's Guide, Release 12.1.3 Attachment Styles in a Region When a region is attachment-enabled, a user can add, view, and delete attachments associated with the records in that region. The attachments are generally displayed in an Attachments table or Attachments page, although you can also display inline links of attachments in a single row region or enable a feature that allows inline viewing and addition of attachments. Note: You can also render an Attachments table as read-only. There are four attachment styles that you can render in a region: • Display a View List Link and Add Button in a Single Row Region • Display an Attachments Table on the Page of a Single Row Region • Display Inline Links of Attachments in a Single Row Region • Display an Attachments Column in a Multi-Row Table Region Display a View List Link and Attachment Icon in a Single Row Region In the case of a single-row region, you can implement attachments by displaying a View link, whose label you may change. In the example shown below, the default View link is overridden by the value "Attachment List". The user may select the link to display the Attachments page or select the Add button to display the Add Attachment page. Display the Attachments Table on the Page of a Single Row Region For a single-row region, you can choose to render the Attachment Table region on the product page directly as shown in the figure below. The Attachment Table region is identical to the Attachments Page used to launch the attachments flow. 267
  • 268. Oracle Application Framework Developer's Guide Display Inline Links of Attachments in a Single Row Region For a single-row region, rather than display a View List link or an Attachments table in the region, you may choose instead to display inline links to the first few attachments for the record as shown in the figure below. The inline links allow users to easily view the first few attachments without navigating from the current page and is generally used in the Workflow Notification Details page, as described in the Oracle Browser Look-and-Feel (BLAF) UI Guidelines: Notification Page Templates [OTN version]. Users can also view additional attachments if there are any, or perform further operation on the attachments by selecting the More . link that follows the attachment links. The More ... link takes the user to the Attachments page. If the attachments are not updateable, and the number of attachments that exist is equal to or less than the number of links that are allowed to be displayed (as set when you enable this feature), the More ... link does not appear. If the attachment type of the inline link is File, then when you select the link, a dialog box opens in your Browser. You can either open the file and display the content or save the file. If you choose Save, the file is created and saved to your client machine. 268
  • 269. Oracle Application Framework Developer's Guide, Release 12.1.3 If the attachment type of the inline link is Text, then when you select the link, you navigate to the View Attachment page, where you can view the content of the text. If the attachment type of the inline link is URL, then when you select the link, you navigate to the destination URL. Display an Attachments Column in a Multi-Row Table Region You may also enable attachments in a multi-record table region by displaying an Attachment column at the end of the table. Each row in the table that contains an attachment displays an Attachments icon (a paperclip attached to paper), that navigates to the Attachments page when selected, and an Add icon (a plus sign), that navigates to the Add Attachment page when selected. The following figure illustrates a multi-row region with an Attach column, containing Attachments and Add icons in the table: Attachments User Interface The following pages or functions are available in the traditional Attachments flow: • Attachments Page • View Attachment Page • Adding Attachments o Add Attachment Page • Editing an Attachment • Deleting an Attachment • Publishing a Document to the Document Catalog Attachments Page 269
  • 270. Oracle Application Framework Developer's Guide When you select the Attachments icon in a multi-row region, the View List link in a single-row region or the More... link that follows the inline attachment links in a single-row region, you launch the Attachments flow by displaying the Attachments page as follows: If the list of attachments is long, use the Hide/Show search region to list specific attachments by description, category, last updated by and/or last updated date. Select a File Name link to view the content of an attachment in the View Attachment page. Select the Update icon to edit the attachment in the Update Attachment page or select the Delete icon to delete an attachment. Select the Add Attachments button above the table to add attachments using the Add Attachment page. If you select the Return... link at the bottom of this page, you return to the product page from which you launched the Attachments flow. The Attachments page may also vary slightly depending on whether you enable the Document Catalog when you implement attachments in a region. If you enable the Document Catalog and the function FND_FNDATTCH_PUBTOCAT is granted to the current user, a Publish to Catalog column appears in the Attachments page. You can select an enabled Publish to Catalog icon for a document to publish that document to the Document Catalog. View Attachment Page 270
  • 271. Oracle Application Framework Developer's Guide, Release 12.1.3 To view the content of an attachment, select a File Name link in the first column of the table on the Attachments page. If the attachment is a web page, you navigate to the specified URL when you select the link. If the attachment is a file, a dialog box opens in your Browser when you select the link. You can either open the file and display the content or save the file. If you choose Save, a file with the content is created and saved to your client machine. If the attachment is text, a View Attachment page appears, as shown below, displaying the text content. When you select the Return... link on this page, you return to the Attachments page. Adding Attachments Add attachments to the current record using the Add Attachment page. The Add Attachment page varies depending on whether you enable the Document Catalog when you implement attachments in a page. If you: • Enable Document Catalog - an Add poplist control appears at the top of the Add Attachment page. The Add poplist displays two choices: o Desktop File, Text, URL - selecting this choice updates the Add Attachment page so you can add a file, text, or URL as an attachment. o From Document Catalog - selecting this choice updates the Add Attachment page so you can add an attachment from the Document Catalog. • Disable Document Catalog - an Add poplist control does not appear at the top of the Add Attachment page, and you can only add a file, text, or URL as an attachment. Add Attachment Page When you add an attachment, you need to specify a category for the attachment. A category is a label that users apply to individual attachments and documents. When you set up a region to be attachment-enabled, you must assign a category for the documents that can be attached. The Attachments page can query only those documents that are assigned to the category to which the calling page's entity is associated. A "Miscellaneous" category is seeded to provide 271
  • 272. Oracle Application Framework Developer's Guide easy visibility of a document across pages. If you do not assign a category to the documents that can be attached, the category defaults to Miscellaneous. Adding a Desktop File, Text, or URL as an Attachment In the Add Attachment page, select "Desktop File/ Text/ URL" from the Add poplist to add a new attachment. Specify a title to label the attachment, a description and a category, followed by an attachment type (File, URL, or Text) and attachment information (file name, URL, or the text itself) for the new attachment, as shown below. Attention: All Text attachments are added as "Short Text" type, with a maximum length of 4000 bytes. If you need to add an attachment that is longer than 4000 bytes, put the text into a text file and add the attachment as a File. In the Add Attachment page, you can select Cancel to cancel and return to the previous Attachments page, select Add Another to add another attachment, or select Apply to insert the rows into the view object and return to the Attachments page. Note: The new attachments are not committed until a submit is performed by the associated parent region. Clicking Apply on the Add Attachment page does not commit the changes by 272
  • 273. Oracle Application Framework Developer's Guide, Release 12.1.3 default. If you want a commit to occur when clicking Apply, refer to the Runtime Control - Committing Changes section for additional information. Adding an Attachment from the Document Catalog Oracle E-Business Suite keeps a catalog of documents that have been attached to applications data records. You can use this catalog to attach an existing document to another data record, that is, copy an attachment from another record. To add an attachment from the Document Catalog, select "From Document Catalog" in the Add poplist of the Add Attachment page. Use the search region to specify search criteria to locate one or more specific attachments. The results of your search are displayed in a table. The figure below displays all attachments currently stored in the document catalog: The table lists the name of the document, its type, description, category, who it was last updated by, when it was last updated, and its usage. Select the document name link to display the document in the View Attachment page. 273
  • 274. Oracle Application Framework Developer's Guide The usage type indicates how the document may be used. There are three usage types: • Template - the document is meant to be modified before use. When you select a Template usage document in the Document Catalog, a copy of the document is created and the document usage of the copy is set to One-Time. The copy is also updateable. If you delete an attachment that has a usage type of Template, the document content, as well as the association of the document to the record is deleted. Documents that appear in the Document Catalog with a usage type of Template, are created from the Documents Window screen in Oracle E-Business Suite. See the Oracle E-Business Suite User's Guide for additional information. • One-time - the document is meant to be used only once. If you delete an attachment that has a usage type of One-time, the document content, as well as the association of the document to the record is deleted. All documents that you add using the Add Attachment page will have their usage type set to One-time. • Standard - the document is a standard document that can only be referenced. When you select a Standard usage document in the Document Catalog, a copy of the document is not made. As a result, the document is not updateable. If you delete an attachment that has a usage type of Standard, the document content is not deleted, only the association of the document to the record is deleted. Documents that appear in the Document Catalog with a usage type of Standard, are created from the Documents Window screen in Oracle E-Business Suite. See the Oracle E-Business Suite User's Guide for additional information. Note: You can only select Standard or Template usage types from the Document Catalog. Once you locate the document(s) of interest, use the select checkbox to select the attachment(s). Choose Apply to attach the document(s) to your record and return to the Attachments page. Select Cancel to cancel and return to the Attachments page. Editing an Attachment In the Attachments page, you can choose the Update icon to update a particular attachment. The Update icon displays the Update Attachment page. The figure below shows the Update Attachment page for a Text attachment: 274
  • 275. Oracle Application Framework Developer's Guide, Release 12.1.3 Note: You can only edit the information as it pertains to the attachment. You can not change the attachment type in this page. For example, if an attachment is a web page, you can update the URL that is associated with this attachment, but you cannot change the attachment type to a file. In the Update Attachment page, selecting Apply updates the necessary rows in the view object and returns the user to the Attachments page. Note: Changes to attachments are not committed until a submit is performed by the associated region. Clicking Apply on the Update Attachment page does not commit the changes by default. If you want a commit to occur when clicking Apply, refer to the Runtime Control - Committing Changes section for additional information. Deleting an Attachment Choose the Delete icon to disassociate an attachment from a record. If the usage type of the attachment is Template or One-time, a warning confirmation also appears as this action will delete the document content. Important: You must delete the associated attachments before deleting the base entity, otherwise you will cause orphaned attachments. Therefore, the logic of deleting the base entity should also include deleting the associated attachments. Publishing a Document to the Document Catalog 275
  • 276. Oracle Application Framework Developer's Guide The Publish to Catalog icon is enabled in the Attachments page for any attachment that is a One-Time usage-type document. Choose the Publish to Catalog icon to publish the document to the document catalog so that it can be attached to other records. When you select the Publish to Catalog icon, the following behavior occurs depending on whether the document you select to publish is of type File, URL or Short Text: • Short Text - a dialog page appears, asking you whether you want to publish the document to the Document Catalog as a Standard or Template usage-type document. o If you select Standard then choose Continue, the document is automatically reset as a Standard usage-type document and is published to the Document Catalog as such. A message appears above the Attachments page to confirm. o If you select Template, then choose Continue, a copy of the document is made and the copy is published to the Document Catalog as a Template usage-type document. A message appears above the Attachments page to confirm. • File or URL - since File- or URL-type documents can only be published as a Standard usage-type, the document is automatically published to the Document Catalog as such and a message appears above the Attachments page to confirm this. Note: A document is not actually published to the Document Catalog until you save (commit) all changes to your attachments in the originating region. Once you publish a document to the document catalog, the Publish to Catalog icon is disabled for that document because it is no longer a One-Time usage document. You should be able to view that published document from the Document Catalog using the Add Attachment page. Inline Attachments You can enable a feature called Inline Attachments that allows a user to add or view attachments by hovering the mouse over an icon, button, or link typically used to navigate to the Attachments user interface. For example, by hovering over the Add icon, an Inline Add Attachments pop-up window appears that allows you to add an attachment without navigating to the traditional Attachments User Interface. The Add icon: Similarly, by hovering over the Attachments icon, an Inline View Attachments pop-up window appears that allows you to view, update or delete attachments inline. The Attachments icon: The inline pop-up window appears to the bottom and right of the item that triggers the pop-up, if there is enough browser window space. If there is insufficient space to the right, the pop-up 276
  • 277. Oracle Application Framework Developer's Guide, Release 12.1.3 window renders to the left of the item. If there is insufficient space at the bottom, the pop-up window renders to the top of the item. Enabling Inline Attachments Note: Inline Attachments can only be enabled if the accessibility mode is set to None using the profile option Self Service Accessibility Features. Inline Attachments are disabled if accessibility is set to "Screen Reader Optimized" mode or "Standard Accessibility" mode. To enable Inline Attachments, refer to the Declarative Implementation section that describes how to enable attachments for an entity. Inline Attachments Support In Oracle E-Business Suite Release 12.1.2 and above, the Inline Attachment feature is supported on all four attachment styles and for all three attachment types (Text/ Url/ File). The following table summarizes the support of the Inline Add Attachment pop-up window and the Inline View Attachments pop-up window for the different attachment styles. Attachment Item Style Inline Add Inline View Attachments Attachment Attachments Column in a Multi-Row Table Region Supported Supported (attachmentImage) View List Link and Add Button in a Single Row Supported Supported Region (attachmentLink) Inline Links of Attachments in a Single Row Supported Supported Region (messageInlineAttachment) Attachments Table on the Page of a Single Row Supported Supported (for Text-type Region (attachmentTable) attachments only) The following table lists the events that trigger the Inline Add Attachment window and the Inline View Attachments window to pop up for the four attachment styles. The event is fired after a time-delay of one-second. Attachment Item Style Inline Add Attachment Inline View Attachments attachmentImage Mouse hover/ Focus on Add Mouse hover/Focus on (Plus) icon Attachment (Paper Clip) Icon attachmentLink Mouse hover/Focus on Add Mouse Hover/Focus on button Attachments List link messageInlineAttachment Select on Add Attachment link in Mouse Hover/Focus on More... the inline View Attachment pop- link up attachmentTable Mouse hover/ Focus on Add Mouse Hover/Focus on Title link Attachment button of Text-type attachments only. 277
  • 278. Oracle Application Framework Developer's Guide Inline Add Attachment Pop-up Window When a user hovers over an icon, button or link that activates the Inline Add Attachment feature, as described above, an Inline Add Attachment pop-up window appears, displaying the following: • Attachment Type poplist • Title text input field • Category poplist Based on the Attachment Type that a user selects, one of the following also renders: • Text area • Url text input field • File-upload item The default Attachment Type is Text. The figure below shows an example of an Inline Add Attachment pop-up window with the Attachment Type set to Text. The bottom of the Inline Add Attachment pop-up window also displays Save, Add Another and Cancel buttons. Select the Cancel button or the Close icon to dismiss the Inline Add Attachment pop-up window. Select the Save button to post the entered data to the middle-tier and close the Inline Add Attachment pop-up window. Select the Add Another button to post the 278
  • 279. Oracle Application Framework Developer's Guide, Release 12.1.3 data to the middle tier and refresh the pop-up window for a new entry. The refreshed Inline Add Attachment pop-up window retains the Attachment Type last selected. Inline View Attachments Pop-up Window When a user hovers over an icon or link that activates the Inline View Attachments feature, as described above, an Inline View Attachments pop-up window appears with a table displaying the current record's attachments. The table displays the following columns: • Title • Attachment Type • Details • Update (icon) • Delete (icon) For Text-type attachments, the Details column displays a fixed number of characters. If more characters exist, an ellipsis (.) and a More link follows the displayed text. Select the More link to display the complete text in a separate pop-up window. For URL-type attachments, select the URL to render the contents of the URL in a new window. The figure below shows an example of an Inline View Attachments pop-up window for Text-type attachments. 279
  • 280. Oracle Application Framework Developer's Guide If the attachment item is update-enabled, an enabled Update (pen) icon appears. Select the Update icon to launch the Inline Update Attachment pop-up window. The pop-up window displays the editable title and details of the selected attachment. Note that the attachment type cannot be modified in this update window. Select the Cancel button or the Close icon to dismiss the Inline Update Attachment pop-up window. Select the Update and Close button to post the data to the middle-tier and close the Inline Update Attachment pop-up window. The figure below shows the update attachment pop-up window. 280
  • 281. Oracle Application Framework Developer's Guide, Release 12.1.3 If the attachment item is delete-enabled, an enabled Delete (trash can) icon appears. Select the Delete icon to delete an attachment. A dialog box appears to confirm the delete action. Select OK on the confirmation dialog to delete the attachment and re-render the Inline View Attachments pop-up window without that attachment. If you delete the only remaining attachment in the pop-up window, the Inline View Attachments pop-up window no longer appears. The Inline View Attachments pop-up window can render five attachments at a time. Use the Next and Previous links to navigate to other attachments. For the Message Inline Attachment Item Style For inline links of attachments in a single row region (the messageInlineAttachment item style), when you hover over the More... link, the Inline View Attachments pop-up window that appears also displays an Add Attachment link as shown in the figure below. Selecting the Add Attachment link displays the Inline Add Attachments pop-up window. 281
  • 282. Oracle Application Framework Developer's Guide For the Attachments Table Item Style For an Attachments table in a single row region (the attachmentTable item style), when you hover over a Title link for a Text-type attachment record, a pop-up window with the content of that attachment displays. When you hover over the Update icon for an attachment record in the table, an Inline Update Attachment pop-up displays as shown in the figure below, allowing you to update the attachment, regardless of type. When you hover over the Delete icon for an attachment record, a dialog box displays asking you to confirm whether to delete the attachment. 282
  • 283. Oracle Application Framework Developer's Guide, Release 12.1.3 Enabling the Attachments Feature for an Entity Declarative Implementation The Attachments page is rendered using standard OA Framework components. There is no programming required to enable attachments. You simply need to define your attachment region item and the relationship between the item and the entity via OA Extension. Be sure to follow the OA Framework naming standards as you define your OA Extension components. Step 1: Define the view object for your application. Step 2: Using OA Extension, define a region that is to be attachments-enabled. Note: Make sure your region is enclosed in a form and has a Submit button. Changes to attachments data can only be committed with a form submit. Step 3: Define your region items and for each region item, enter the appropriate view attribute name defined by your view object. Step 4: If you are enabling attachments only for the OA Framework interface, skip to Step 5. If you are an Oracle E-Business Suite Division developer and you want to enable attachments for both the Oracle Forms and the OA Framework interfaces, you need to specify your entity information in the FND_DOCUMENT_ENTITIES table so that the entity can be shared by both interfaces. To define your Entity information in the FND_DOCUMENT_ENTITIES table, use the AK Entity form under the AK HTML Forms responsibility in E-Business Suite: 283
  • 284. Oracle Application Framework Developer's Guide a. Enter the main table name that your view object references. This is just informative for users. OA Framework does not actually use this piece of information. b. Enter the Entity ID. This is used to identify your entity and you need to reference this when you define your region item in OA Extension. c. From Step 3, enter the view attribute names for the region items that you defined in OA Extension that can be used as primary keys. Please note that the view attribute names that you enter into the Entity definition need to be able to uniquely identify a record of the specified entity. Note: The E-Business Suite interface for defining entities in the AK Entities form is at: OA.jsp?akRegionCode=AK_ENTITY_VIEW_PAGE&akRegionApplicationId=601 Note: If you want to download the entities you define in FND_DOCUMENT_ENTITIES, you need to use FNDLOAD. The usage of FNDLOAD is as follows: FNDLOAD logon 0 Y mode configfile datafile [ entity [ param ...] ] where • logon - username/password[@connect] • mode - UPLOAD or DOWNLOAD • configfile - configuration file • datafile - data file • entity - an entity name or - to specify all values in an upload • param - a NAME=VALUE string used for parameter substitution 284
  • 285. Oracle Application Framework Developer's Guide, Release 12.1.3 Step 5: If your region is a single row region, create a nested item with one of the following item styles in OA Extension: • attachmentTable - to render an Attachments table below the current region. • attachmentLink - to render the View List link and Add button below the current region. Users need to select the View List link to display the Attachments page. • messageInlineAttachment - to render a list of inline attachment links. Users can select the More. link to navigate to the Attachments user interface to perform further operations on attachments. Note The messageInlineAttachment item style should only be added to layout style containers such as messageComponentLayout, header, and so on. It should not be added to any table family members, such as table, advancedTable, HGrid or gantt. If you have a multi-row table region, define a region item with the item style attachmentImage nested in the table or in the column of an advanced table. This creates an attachment column in the table. In the attachment column, you select the Attachment icon to display the Attachments page or Add icon to display the Add Attachment page. Step 6: Specify the following properties for the attachment region item you just created: • ID - a unique ID for the attachment region item. • View Instance - the name of the view instance for the entity you are attachment- enabling. • Rendered - set to True. • Enable Document Catalog - set to True to enable adding attachments from the document catalog or False to disable access to the document catalog. The default is True. Refer to the Attachments Page and Adding Attachments sections for further details. • Render Search Region - set to True to render the Search region for the Attachments page or region. The Search region allows you to query for a specific set of attachments. If the item style is attachmentLink, set these additional properties: • Prompt - a label for the attachment region item. If this property is null, the prompt defaults to "Attachments". • Link Text - text for the Attachment link, if you select attachmentLink as the item style. If this property is null, the link text defaults to "View". If the item style is attachmentTable, set these additional properties: • Text - a display name for the Attachments table. • Icon URI - a gif file containing the image to display next to the Attachments table display name. If the item style is messageInlineAttachment, set this additional property: • Prompt - a label for the attachment region item. If this property is null, the prompt defaults to "Attachments". 285
  • 286. Oracle Application Framework Developer's Guide • Links Displayed - the maximum number of inline attachment links to display. The default is 5. If the item style is attachmentImage, set this additional property: • Prompt - a label for the attachment column. If this property is null, the prompt defaults to "Attachments". Step 7: By default, changes made to the Attachments table or page are saved (committed) only when a user selects the Apply button on the base page from which Attachments is launched. See the Runtime Control section. If you want changes to the Attachments table or page to commit automatically, without requiring a user to select Apply in the base page, you can turn on "auto-commit" by setting the Automatic Save property to True for the attachmentLink, attachmentTable, or attachmentImage item. With "auto-commit" turned on, each action ("Add", "Update", "Detach") performed by the user in the Attachments table or page is automatically committed. Step 8: In the Structure pane, select the default entityMap that is created under the attachment region item you just created in the previous step. Select the entityMap in the Structure pane. In the OA Extension Property Inspector, enter a unique ID for the entity map and one of the following values for the Entity property: • If you performed Step 4 and defined an entity in the AK Entity form to share between the Oracle Forms and OA Framework interfaces, specify the Entity ID you defined in the AK Entity form. • If you skipped Step 4 because you are enabling attachments only to be viewed from the OA Framework interface, enter a unique arbitrary value for Entity. Select the Entity Map named child in the Structure pane. Under New in the context menu, select primaryKeys to create a primary key named child for the entity map. Select the primaryKey named child in the Structure pane. Enter a view attribute name for the primary key in the OA Extension Property Inspector. Note Many regions can share an entity; in fact, if you want the same attachment(s) to be viewable from different regions, those regions must share the same entity. In addition, the attachment region items of those different regions must have the same view attribute name and reference the same view instance. Step 9: If you want to make the Attachments table or page read-only, so that it does not display the Update and Detach columns, select the Entity Map named child for the attachment region item in the OA Extension Structure pane. Set the Insert Allowed, Update Allowed, and Delete Allowed properties in the Property Inspector to False. Set any combination of these properties to False to better control the level of change you want users to have in the Attachments table or page. Note: The OA Framework oracle.apps.fnd.framework.webui.beans.layout.OAAttachmentTableBean 286
  • 287. Oracle Application Framework Developer's Guide, Release 12.1.3 setUpdateable(boolean updateable) method (which is specified by setUpdateable in interface oracle.apps.fnd.framework.webui.beans.OAWebBeanAttachment), to make an Attachments table read-only, has been deprecated. Use the oracle.apps.fnd.framework.webui.beans.OAAttachmentImageBean setEntityMappings(Dictionary[] entityMaps) method instead if you need to maintain backwards compatibility. Step 10: Create a category map to specify the category of documents that can be associated with an attachment. Document categories provide security by restricting the documents that can be viewed, added or deleted as an attachment. In the Structure pane, select the entity map you just defined. Select New > categoryMap from the context menu to create a Category Map named child. Step 11: Select the new categoryMap entity in the Structure pane. In the Property Inspector, specify values for the following properties: • ID - specify a unique ID for the category map. • Category - specify the document category that can be associated with the attachments. Note that the value of Category must be a predefined Name (internal name, rather than display name) from the FND_DOCUMENT_CATEGORIES table, such as MISC. • Secure - specify True to secure the category using Application Security. By securing a category, the documents of that category will only be accessible to users based on the security rules defined in Oracle E-Business Suite. To secure a category, please refer to the Securing Attachment Categories section for additional information. By default, Secure is set to False for backwards compatibility. Once you define a categoryMap and if the showAll property on the entityMap is set to false, then only the attachments that are assigned with the same category as specified in your categoryMap(s) can be queried or added from the Attachments page. Note: A property called setDefaultMiscCategoryEnabled creates a default category map and sets the category to MISC, if one is not already defined. As a result, if the showAll property on the entityMap is set to False and you do not define a category map for the entity, OA Framework creates a default category map for the entity and sets the category to MISC. If the showAll property is set to True, however, it disregards the category maps, as all categories are available. If you change the setDefaultMiscCategoryEnabled property to False, and you do not create a category map before running your attachment-enabled page or the category map has only one category defined, the Category poplist does not display in the Search region of the Attachments table or in the Add Attachment page. This property is set by default to True. To change the value of this property to False, you must use the following API: attachBean.setDefaultMiscCategoryEnabled(false); 287
  • 288. Oracle Application Framework Developer's Guide Step 12: To enable the Inline Attachments feature, set the profile option FND: Disable Inline Attachments to false at the Site or Application level. The default value at the Site level is false. You can also set the Inline Attachment Enabled property of your attachment region item to enable or disable the Inline Attachments feature for that particular attachment item. Valid values for the Inline Attachment Enabled property are true, false, or default, where default means to default to the value set in the FND: Disable Inline Attachments profile option. Users may also personalize the Inline Attachment Enabled property at runtime. The following table illustrates Inline Attachments behavior for the different combination of values set for the profile option and the attachment item property: Value of Inline Attachment Value of 'FND: Disable Inline Inline Enabled property Attachments' profile Attachment true any value active false any value inactive default true inactive default false active You may also set these attachment region item properties to control the behavior of the Inline Attachments feature: • Update Enabled - set to true to enable the Update icon in the Inline View Attachments pop-up window. • Delete Enabled - set to true to enable the Delete icon in the Inline View Attachments pop-up window. Securing Attachment Categories As mentioned above, you can now set the secure property on a category map to True to ensure that the category is secured by Application Security. Oracle E-Business Suite provides a seeded 'category' object, along with permissions and permission sets that define the actions (functions) that can be performed on the seeded object. You can then use the seeded object and permission sets to define the security rules for the secured category. The following object is seeded by Oracle E-Business Suite to enforce data security on attachment categories: OBJ_NAME = FND_DOCUMENT_CATEGORIES DATABASE_OBJECT_NAME = FND_DOCUMENT_CATEGORIES PK1_COLUMN_NAME = NAME The following permissions (functions) are seeded by Oracle E-Business Suite to define the securable actions on attachment categories: 288
  • 289. Oracle Application Framework Developer's Guide, Release 12.1.3 FND_FORM_FUNCTIONS FUNCTION_NAME = "FND_ATTACHMENT_VIEW" OBJECT_ID = "FND_DOCUMENT_CATEGORIES" TYPE = "SUBFUNCTION" FUNCTION_NAME = "FND_ATTACHMENT_CREATE" OBJECT_ID = "FND_DOCUMENT_CATEGORIES" TYPE = "SUBFUNCTION" FUNCTION_NAME = "FND_ATTACHMENT_UPDATE" OBJECT_ID = "FND_DOCUMENT_CATEGORIES" TYPE = "SUBFUNCTION" FUNCTION_NAME = "FND_ATTACHMENT_DELETE" OBJECT_ID = "FND_DOCUMENT_CATEGORIES" TYPE = "SUBFUNCTION" The following three permission sets are seeded by Oracle E-Business Suite to specify the combination of permissions (functions) necessary to perform a particular role on an object instance. You may add additional permission sets if other combinations of functions are required. MENU_NAME = 'FND_ATTACHMENT_FULL_ACCESS' FUNCTION_NAME = 'FND_ATTACHMENT_VIEW' FUNCTION_NAME = 'FND_ATTACHMENT_CREATE' FUNCTION_NAME = 'FND_ATTACHMENT_UPDATE' 289
  • 290. Oracle Application Framework Developer's Guide FUNCTION_NAME = 'FND_ATTACHMENT_DELETE' MENU_NAME = 'FND_ATTACHMENT_VIEW' FUNCTION_NAME = 'FND_ATTACHMENT_VIEW' MENU_NAME = 'FND_ATTACHMENT_NO_DELETE' FUNCTION_NAME = 'FND_ATTACHMENT_VIEW' FUNCTION_NAME = 'FND_ATTACHMENT_CREATE' FUNCTION_NAME = 'FND_ATTACHMENT_UPDATE' Using the seeded object and permission sets, define one or more grants to define the rules to secure your attachment category. Please refer to the online help for the Grants page in the Functional Administrator responsibility, as well as the Oracle E-Business Suite System Administrator's Guide - Security for information on how to define a grant. The section on Application Security in Chapter 3: Menus and Page Security also discusses grants and permissions in more detail. The following example illustrates two grants that you can create to access the secured attachment category called "To Approver": FND_GRANTS GRANTEE_TYPE = GROUP GRANTEE_KEY = MANAGER_ROLE MENU_NAME = FND_ATTACHMENT_FULL_ACCESS OBJECT_ID = FND_DOCUMENT_CATEGORIES INSTANCE_TYPE = INSTANCE INSTANCE_SET_ID = NULL INSTANCE_PK1_VALUE = TO_APPROVER CTX_SECGRP_ID = -1 CTX_RESP_ID = -1 290
  • 291. Oracle Application Framework Developer's Guide, Release 12.1.3 CTX_RESP_APPL_ID = -1 CTX_ORG_ID = -1 FND_GRANTS GRANTEE_TYPE = GROUP GRANTEE_KEY = EMPLOYEE_ROLE MENU_NAME = FND_ATTACHMENT_VIEW OBJECT_ID = FND_DOCUMENT_CATEGORIES INSTANCE_TYPE = INSTANCE INSTANCE_SET_ID = NULL INSTANCE_PK1_VALUE = TO_APPROVER CTX_SECGRP_ID = -1 CTX_RESP_ID = -1 CTX_RESP_APPL_ID = -1 CTX_ORG_ID = -1 This example shows that users who sign on as MANAGER_ROLE can view, create, update and delete attachments of category "To Approver", whereas users who sign on as EMPLOYEE_ROLE can only view attachments of category "To Approver". Note: You can use the setCategoryMapsForAddAndUpdate method to override the behavior of this particular example. Now suppose you have a Requisition Header (ID 100) and it has three attachments as shown in the table below. In OA Extension, the meta data for this Requisition Header attachment item contains two categoryMaps, called "MISC" and "To Approver" and categoryMap "To Approver" is secured. Attachment ID Category ID Category Name 11 1 MISC 12 33 To Approver 291
  • 292. Oracle Application Framework Developer's Guide 13 33 To Approver If User A signs on as MANAGER_ROLE, User A would see and have full access to the three attachments indicated in the table above. If User B signs on as EMPLOYEE_ROLE, User B would also see the three attachments above, but would only be able to view and not create, update or delete attachments associated with the "To Approver" category. If no grant is defined for EMPLOYEE_ROLE, then if User B signs on as EMPLOYEE_ROLE, User B would only see the one attachment associated with the MISC category. Granting Access to Custom Categories If you define your own custom categories, you may want to grant access for MANAGER_ROLE to all these custom categories instead of creating a separate grant for each newly defined category. The most convenient way to achieve this by having your System Administrator create an object instance set definition. Since only a seeded user would have a User ID less than or equal to 2, seeded categories in the FND_DOCUMENT_CATEGORIES table would also have a value in the CREATED_BY column that is less than or equal to 2. Therefore, all custom categories have a CREATED_BY value larger than 2: FND_OBJECT_INSTANCE_SETS_VL INSTANCE_SET_NAME = "OA_DOC_CATEGORY_CUSTOM" OBJECT_ID = "FND_DOCUMENT_CATEGORIES" PREDICATE = "&TABLE_ALIAS.CREATED_BY > 2" FND_GRANTS GRANTEE_TYPE = GROUP GRANTEE_KEY = MANAGER_ROLE MENU_NAME = FND_ATTACHMENT_FULL_ACCESS OBJECT_ID = FND_DOCUMENT_CATEGORIES INSTANCE_TYPE = SET INSTANCE_SET_ID = OA_DOC_CATEGORY_CUSTOM INSTANCE_PK1_VALUE = NULL 292
  • 293. Oracle Application Framework Developer's Guide, Release 12.1.3 CTX_SECGRP_ID = -1 CTX_RESP_ID = -1 CTX_RESP_APPL_ID = -1 CTX_ORG_ID = -1 With this definition, MANAGER_ROLE would have full access to attachments of all custom categories. Runtime Control In general, there are no runtime control steps necessary to enable attachments for an entity. However, you can refer to the following sections for instructions on additional programmatic changes you can make to attachments: • Secure Attachment Documents to a Particular Context • Secure Categories • Get a Handle to an Attachment Event • Control When to Commit Changes • Create or Update an Attachment Securing Documents to a Particular Context To secure your attachment documents with a particular context, such as organization, set of books, or business unit, you can do so using these two APIs in the oracle.apps.fnd.framework.webui.beans.OAWebBeanAttachment interface: • setSecurityType(int securityType) • setSecurityId(int securityId) Typically, attachments in financial applications are secured by sets of books, attachments in manufacturing applications are secured by organization, and attachments in human resource applications are secured by business unit ID. The following example illustrates how to use these APIs to secure documents by organization ABC. This should be included in the controller code for the page that launches the Attachments feature: attachmentBean.setSecurityType(1); // security type 1 = Organization, 2 = Sets of Books, // 3 = Business Unit, and -1 = No security type 293
  • 294. Oracle Application Framework Developer's Guide attachmentBean.setSecurityId(123); // org id: 123 = company "ABC" As a result of the above code, when a user creates an attachment for the application page, the document is automatically secured to organization ABC. The Attachments UI displays documents that have this security context, as well as documents that are not secured. If you do not set a security context when you enable the Attachments feature for a page, the attachment documents that get created will have a security type of "None" and can be shared across different security context. Securing Categories If you need to secure an attachment category programmatically, you can use the setCategorySecured method on OAAttachmentImageBean, OAAttachmentTableBean, OAMessageAttachmentLinkBean, or OAMessageInlineAttachmentBean. Getting a Handle to an Attachment Event If you want to get a handle on an attachment event so that you can add custom logic before leaving the base page, you can do so by checking for the return of any of the following OAWebBeanConstants from UIConstants.EVENT_PARAM: • OA_ADD_ATTACHMENT - returned when the Add Attachment button is pressed from attachment table or when Add icon/button is pressed from attachmentImage/attachmentLink style. • OA_UPDATE_ATTACHMENT - returned when the Update attachment icon is pressed from attachment table. • OA_DELETE_ATTACHMENT - returned when the Delete attachment icon is pressed from attachment table • OA_VIEW_ATTACHMENT - returned when the link for viewing attachment is pressed from attachment table • OA_GOTO_ATTACHMENTS - returned when navigating to Attachments page from the base page. Valid for attachmentImage, attachmentLink, and messageInlineAttachment styles only. For example, the following code in the processFormRequest method of the controller, checks if the Add Attachment button has been selected: String eventName = pageContext.getParameter(EVENT_NAME); // Check if Add attachment button is clicked if ( OA_ADD_ATTACHMENT.equals(eventName) ) { 294
  • 295. Oracle Application Framework Developer's Guide, Release 12.1.3 // product team's special handling code } Committing Changes By default, changes made to the Attachments table or page are saved (committed) only when a user selects the Apply button on the product page from which the Attachments flow is launched. The Automatic Save property on the attachment web bean is set to False in this case. This means that in the processFormRequest method of the controller object, you need to capture the event of this submit button and call commit() explicitly. If you want changes to the Attachments table or page to commit automatically, without requiring a user to select Apply in the base product page, you can turn on "auto-commit" by setting the Automatic Save property on the attachment web bean to True. With "auto-commit" turned on, each action ("Add", "Update", "Delete") performed by the user in the Attachments table or page is automatically committed. Create or Update an Attachment As of Release 12.1.3, you can programmatically create or update an attachment using these oracle.apps.fnd.framework.server.OAAttachmentServerUtils APIs: • createAttachment(String input, String[] pkValues, String categoryName, String entityId,String contentType, BlobDomain fileContent, String title, String description, OAApplicationModule am, String automaticallyAddedFlag, String attachmentType) • updateAttachment(String input, String[] pkValues,String categoryName, String entityId, String contentType,BlobDomain fileContent, 295
  • 296. Oracle Application Framework Developer's Guide String title, String description, OAApplicationModule am, String automaticallyAddedFlag, String attachmentType, long attachmentDocumentId) Enabling Virus Scanning This feature scans a file type attachment before uploading. To enable virus scanning, the Virus Scan Enabled property should be set to true in the design time for the attachmentLink, attachmentTable, or attachmentImage item. Runtime control is also supported. The processRequest of the controller class should have the following code: attachBean.setVirusScanEnabled(true); where attachBean is the bean corresponding to the attachmentLink, attachmentTable, or attachmentImage item. In addition to the above design time or runtime settings, the following profiles need to be set appropriately: • FND_ANTIVIRUS_SOFTWARE: Specifies the name of the anti-virus software. Currently only Symantec anti-virus software is supported. The valid values are NONE and SYMANTEC. If this profile has not been set then the normal uploading of file attachment will take place without any scanning for viruses. • FND_ANTIVIRUS_SERVER: Specifies the server address where the anti-virus software is running. If FND_ANTIVIRUS_SOFTWARE is set properly but FND_ANTIVIRUS_SERVER is not set or has some invalid value then an error message will be thrown and file will not be uploaded. If a virus is detected in the file then anti-virus software tries to repair the file. If the file is repaired then the repaired file is uploaded else an error message is displayed about the virus infected file and the file is not uploaded. Personalization Considerations See a summary of Attachments personalization considerations in the Oracle Application Framework Personalization Guide. Services Exposed Bulk Upload - Overview 296
  • 297. Oracle Application Framework Developer's Guide, Release 12.1.3 The OAAttachmentsService is developed using the 12.1 Business Service Object infrastructure. This allows users to upload attachments in bulk. This service can be searched for from the Integration Repository, which contains WSDL documents for all EBS services. Please refer to the"Introduction to SOA and Services" section for an overview of the SOA concepts. Service Description Name -OAAttachmentsService. Note: This is the name to be used to search for the service in the Integration Repository. This service exposes the processDataSource service API for adding attachments in bulk. To know more about this, please look at the Invoking Bulk Upload Operation section in this document. Methods - processDataSource. Service Data Objects - FndAttachBulkUploadVO Methods processDataSource This method performs the Bulk Upload operation and attaches uploaded data with specified business entities. User needs to invoke this method by passing appropriate parameters as mentioned in the table below. Parameters Parameter Name DataType Description dataSourceName java.lang.String The name of the data source to process. In this case, the value for this should be "FndAttachBulkUploadVO". operation java.lang.String The operation to perform. Can be one of the following: "Create" or "Merge". oaattachmentsprocessControl /oracle/svc/ProcessControl control the post control object ServiceRoot /oracle/svc/DataObject The root data object containing a list of data objects to be processed. Return Type oracle.svc.DataObject Note: This is an object of type oracle.svc.DataObject whose qualified name is OAAttachmentServiceRoot which has APIs to get the list of the service data objects returned by the service method. 297
  • 298. Oracle Application Framework Developer's Guide This operation will return oracle.svc.DataObject instance which contains the list of service data objects of type 'FndAttachBulkUploadVO'. The bulk upload status can be verified by getting the value of the service data object present in the returned DataObject. For successful attachments it lists the attachment id and for invalid records it lists appropriate error messages. Service Data Objects Following Service Data Objects are available in this service: FndAttachBulkUploadVO This is the Service Data Object that contains the attributes that need to be input by the user to upload the attachments corresponding to the business entity. The fileContent from this data source will be attached to the specified business entities. Attributes Attribute Name Data Type Description fileName java.lang.String The name of the file to be uploaded. Please note this is a mandatory field. contentType java.lang.String The type of file content viz. text/html, image, icon etc This is MIME type and can contain any valid MIME entry. fileContent oracle.jbo.domain.BlobDomain The content of the file. pk1_Value java.lang.String Primary key1 value. Pk2_Value java.lang.String Optional primary key2 value. Pk3_Value java.lang.String Optional primary key3 value. Pk4_Value java.lang.String Optional primary key4 value. Pk5_Value java.lang.String Optional primary key5 value. categoryName java.lang.String The name of the category. This should be a valid value of Category ID from the FND_DOCUMENT_CATEGORIES table. entityId java.lang.String The id of the entity to which the document will be attached. description java.lang.String Optional description of the attachment. status java.lang.String The status of the upload operation for the current object. For successful attachments it lists the attachment id and for invalid records it lists appropriate error messages. This is used only for the output operation and users need to ignore this attribute while invoking the service 298
  • 299. Oracle Application Framework Developer's Guide, Release 12.1.3 Related Documents Search services in Integration Repository Service Interface in integration repository Invoking service from BPEL Web services and Function Security Business Service Objects (BSO) Known Issues • The Inline Attachments feature is disabled in Screen Reader Accessibility modes. • There is no BIDI support for the Inline Attachments feature. Related Information • BLAF UI Guideline o Attachments Templates [OTN version] o Attachments Flows [OTN version] • Javadoc File o oracle.apps.fnd.framework.webui.beans.layout.OAAttachmentTa bleBean o oracle.apps.fnd.framework.webui.beans.OAAttachmentImageBean o oracle.apps.fnd.framework.webui.beans.message.OAMessageAtta chmentLinkBean o oracle.apps.fnd.framework.webui.beans.message.OAMessageInli neAttachmentBean o oracle.apps.fnd.framework.webui.beans.OAWebBeanAttachment o oracle.apps.fnd.framework.webui.OAWebBeanConstants o oracle.apps.fnd.framework.server.OAAttachmentServerUtils • Lesson • Sample Code 299
  • 300. Oracle Application Framework Developer's Guide Auto-Repeating Layout (ARL) Overview You can auto-repeat the layout of children web beans in a container, based on the rows in a view object by using a process called Child View Usage. The process attaches a data source (view object) to a container web bean, which then replicates its children web beans based on the number of data objects or rows in the source. Each replica of the container's children reflects a different row in the data source, similar to what you see when you render a table or advanced table web bean. Contents • Auto-Repeating Layout Variations • Usage Restrictions • Declarative Implementation o Creating a One-Level Auto-Repeating Layout o Creating a Two-Level Auto-Repeating Layout • Runtime Control • Personalization Considerations • Known Issues • Related Information Auto-Repeating Layout Variations You can implement an auto-repeating layout in one or two levels: • One Level - you create a container web bean and attach a view object to it, which results in the replication of the container children based on the rows in the view object. • Two Levels - you create a master-detail relationship between two lists and create a view link to join them. The outer list replicates its container children based on the master view object and the inner list replicates its container children based on the detail view object. You can also implement an auto-repeating layout as a display-only list or as a list with Form Elements: • Read Only - a read-only auto-repeating layout can be based on a single view object or a single view link. In the case of a single view object, a one level list of children are replicated. In the case of a single view link, a composite list results, where a different inner list is created for each current master record. • Form Element - an auto-repeating layout with form elements can be based only on a single view object. A layout with form elements allows you to update any row and submit your changes to update the underlying view object. Usage Restrictions • You cannot implement an auto-repeating layout in the following container regions: 300
  • 301. Oracle Application Framework Developer's Guide, Release 12.1.3 o Table o Advanced Table o Hide/Show o Switcher o HGrid o SubTabLayout • You cannot replicate the above container regions indirectly. For example, you cannot create a header region, add a Table region beneath it, and expect to replicate the header region (and the underlying Table region). This is not supported. • You cannot implement a two-level auto-repeating layout with a list containing Form Elements. • OA Framework does not support view objects (for the Child View Usage) with composite primary keys. The view object should have a single-column primary key. • LOV's are not supported in Auto Repeating Layouts (ARLs). • The items under an Auto Repeating Layout should not be made hidden/rendered on a Partial Page Refresh (PPR) event. If such a scenario exists, on a PPR event, the page should be re-rendered by calling pageContext.setForwardURL(). This will ensure the items under Auto Repeating Layout are rendered with correct bean Ids. Declarative Implementation This section describes how to declaratively implement an auto-repeating layout for your page. Creating a One-Level Auto-Repeating Layout Step 1: In your project, create an application module for your auto-repeating layout, if you don't yet have one for your page. Step 2: Create a view object for your auto-repeating layout and add it to your application module. For example, you can create the following BC4J setup: • Create an application module. • Create a view object based on the Dept table, called DeptVO. • DeptVO has the primary key 'Deptno'. Step 3: Define a page in OA Extension, and create a pageLayout region beneath it. Set the AM Definition property on the pageLayout region to the application module you created in Step 1. Step 4: Create a container region and the children that you want as your auto-repeating layout. Select, in the Structure pane, the container region. For example, suppose you create a header region, with a rowLayout region that contains a messageTextInput item and a submitButton item beneath it and you want the messageTextInput and submitButton web beans to auto-repeat for all the rows returned from an view object. In this case, you would select the rowLayout region. Step 5: For the selected container region, set the Child View Instance property to the name of the view object you created in Step 2 and the Child View Attribute property to 301
  • 302. Oracle Application Framework Developer's Guide an attribute in the view object that uniquely identifies a row (the primary key). Based on the BC4J example in Step 2, you would set the Child View Instance property to DeptVO and the Child View Attribute property to Deptno. Note In case a view object does not have a primary key, you can use RowId as the Child View Attribute. Creating a Two-Level Auto-Repeating Layout Step 1: In your project, create an application module for your auto-repeating layout, if you don't yet have one for your page. Step 2: Create a view object for your master list, a view object for your detail list and a view link between these two view objects. Add these view objects and view link to your application module. For example, you can create the following BC4J setup: • Create an application module. • Create a view object based on the Dept table, called DeptVO. • DeptVO has the primary key 'Deptno'. • Create a view object based on the Emp table, called EmpVO. • Create a view link between DeptVO and EmpVO, called DeptEmpVL. • Add the above view objects and view link to the application module. Step 3: Define a page in OA Extension, and create a pageLayout region beneath it. Set the AM Definition property on the pageLayout region to the application module you created in Step 1. Step 4: Create the outer container region and its children, and the inner container region and its children, that you want to use for your two-level auto-repeating layout. Step 5: Select, in the OA Extension Structure pane, the outer container region and set the following properties: • Child View Instance - set to the name of the view object you created in Step 2 for the outer list. • Child View Attribute - set to an attribute in the outer view object that uniquely identifies a row (the primary key). • View Link Instance - set to the view link defined between the inner and outer view objects. Based on the example in Step 2, you would set the Child View Instance to DeptVO, the Child View Attribute to Deptno, and the View Link Instance to DeptEmpVL. Note In case a view object does not have a primary key, you can use RowId as the Child View Attribute. Step 6: Select, in the OA Extension Structure pane, the inner container region and set the following properties: 302
  • 303. Oracle Application Framework Developer's Guide, Release 12.1.3 • Child View Instance - set to the name of the view object you created in Step 2 for the inner list. • Child View Attribute - set to an attribute in the inner view object that uniquely identifies a row (the primary key). • View Link Instance - set to the view link defined between the inner and outer view objects. Based on the example in Step 2, you would set the Child View Instance to EmpVO, the Child View Attribute to Deptno, and the View Link Instance to DeptEmpVL. Note In case a view object does not have a primary key, you can use RowId as the Child View Attribute. Runtime Control There are no programmatic steps required for implementing an auto-repeating layout region. The child view usage set on the container web beans is automatically queried when the page renders. If you wish to turn off auto-execution of the query, set the oracle.apps.fnd.framework.webui.OAWebBeanConstants attribute, CHILD_VIEW_AUTO_QUERY_ATTR, to Boolean.FALSE, as illustrated in the following code example: containerBean.setAttributeValue( OAWebBeanConstants.CHILD_VIEW_AUTO_QUERY_ATTR, Boolean.FALSE) Personalization Considerations See a summary of Auto-Repeating Layout personalization considerations in the Oracle Application Framework Personalization Guide. Known Issues • None Related Information • BLAF UI Guideline • Javadoc File o oracle.apps.fnd.framework.webui.OAWebBeanConstants • Lesson • Sample Code 303
  • 304. Oracle Application Framework Developer's Guide 304
  • 305. Oracle Application Framework Developer's Guide, Release 12.1.3 BI Publisher Integration - Printing A Report From Within an OA Framework Page Overview Business Intelligence (BI) Publisher integration allows you to print a BI Publisher report from within an OA Framework page. Declarative Implementation Perform the following steps to implement printing of a BI Publisher report from within an OA Framework page: 1. In Oracle JDeveloper OA Extension, create a new item of style Button under the desired region of an OA Framework page. 2. Provide a suitable prompt for the button. 3. Set the Destination URL property of the button to point to the BI Publisher page using the following format: OA.jsp?OAFunc=DGF_PRINT_OPTIONS&biamdef=<AM_NAME>&p_form_code=<fo rm_code>&p_block_code=<block_code>&retainAM=Y The value of biamdef should be a fully qualified Application Module (AM) name, such as oracle.apps.fnd.toolbox.server.LabSolutionsAM. The p_form_code and p_block_code values should be registered through the Document Generation Framework UI. Personalization Considerations • None, although you can also print BI Publisher reports via Personalizations. Known Issues • None Related Information • BLAF UI Guideline(s) • Javadoc File(s) • Lesson(s) • Sample Code 305
  • 306. Oracle Application Framework Developer's Guide 306
  • 307. Oracle Application Framework Developer's Guide, Release 12.1.3 Bound Values Overview Data binding allows you to map data from UIX web beans to BC4J components and back, bridging the gap between the two so you can create HTML pages that generate dynamic content for each user. As mentioned in the Anatomy of an OA Framework Page, OA Framework web bean attributes are implemented as data bound values, so that the underlying data source (BC4J) is not resolved to the component (by the UIX framework) until rendering time. OA Framework uses UIX's oracle.cabo.ui.data.BoundValue, oracle.cabo.ui.data.DataObject and oracle.cabo.ui.data.DataObjectList interfaces to perform data binding at runtime. A table content Switcher, on the other hand, is a region with two or more display alternatives. The display alternatives are predefined items of which only one is selectively rendered at any given time. Bound Values versus Table Content Switchers You should limit your use of Switchers to within tables, particularly when you want to switch between different kinds of web beans, such as a poplist or a checkbox. When you have only one type of web bean, but the value of an attribute on that web bean varies at runtime, then you should implement that attribute as a bound value rather than as a Switcher. There are exceptions to this, however, as demonstrated in the ToolBox Tutorial Delete Lab. The tutorial example creates an employee table that contains a Delete column. The Delete column allows you to delete employees from the table, depending on the status of the employee - if the employee is active, the Delete icon is enabled, otherwise it is disabled. However, to meet the standards of 508, alternate text (alt text) is associated with the enabled icon, as well as the disabled icon. At runtime, to be able to display the enabled Delete icon, with its alt text, or the disabled Delete icon with its appropriate alt text, the tutorial uses the convenience of a table content Switcher to switch between the two distinct sets of attribute values for the same web bean type. If you were to use bound values instead of a Switcher in this case, you would bind the image source of the Delete icon to a view object attribute to get the image file name, and bind the alt text to another view object attribute to get the alt text for the image. Note Although you can use a table content switcher outside a table, UIX discourages this. Instead you should bind the Rendered property of the indexed child when possible. Contents • Bound Values o Why Use Bound Values? o Data Binding in OA Framework o Data Binding for Fields Outside a Table o Data Binding for Fields in a Table 307
  • 308. Oracle Application Framework Developer's Guide • Declarative Implementation • Runtime Control • Personalization Considerations • Known Issues • Related Information Bound Values Why Use Bound Values? Since it is possible to write custom code to populate the contents of an HTML page, as well as derive UI content from certain metadata specified in the OA Extension Property Inspector, why bother to use bound values? There are several reasons, the main reason being that bound values simplify the code needed to fetch values from a data source at rendering time. In the case of interdependent attributes, where the value of one attribute depends on the value of another, the use of bound values eliminates the need for a lot of duplicate code. Consider the example, "If data type is NUMBER, right align". Without data binding, you would have to write code such as: public void setDataType(String type) { if ("NUMBER".equals(type)) { setAttributeValue(HALIGN_ATTR, HALIGN_RIGHT); setAttributeValue(DATATYPE_ATTR, type); } } public void setHAlign(String hAlign) { if ("NUMBER"Equals(getAttributeValue(DATATYPE_ATTR))) 308
  • 309. Oracle Application Framework Developer's Guide, Release 12.1.3 { setAttributeValue(HALIGN_ATTR, HALIGN_RIGHT); } else { setAttributeValue(HALIGN_ATTR, hAlign); } } public String getDataType() { return getAttributeValue(DATATYPE_ATTR, type); } public String getHAlign() { if ("NUMBER"Equals(getAttributeValue(DATATYPE_ATTR))) { return HALIGN_RIGHT; return getAttributeValue(HALIGN_ATTR, hAlign); } } By implementing bound values, you can reduce this code to: bean.setAttributeValue(HALIGN_ATTR, new HAlignBoundValue(bean)); with HAlignBoundValue defined as: public class HAlignBoundValue implements BoundValue 309
  • 310. Oracle Application Framework Developer's Guide { private OAWebBean mOAWebBean; HAlignBoundValue(OAWebBean bean) { mOAWebBean = bean; } public Object getValue(RenderingContext context) { if ("NUMBER"Equals(bean.getDataType())) { return HAlignRight; } } } Note that bound values are especially relevant when the value of the "depended on" attribute can change at any point up until rendering time. See the Runtime Control section for another example. Another occasion when bound values are desirable is in the case of tables, where you have a handful of columns, but an unknown number of rows. Rather than consider a bean for each row and column, which does not scale, or reuse the bean hierarchies, you can bind the data in each column to a data source, such as a view object. Data Binding in OA Framework To understand how bound values work, let us take a look at the structure of a typical web bean. It can consist of indexed children, named children, and attributes. Attributes derive their values from a data dictionary of name/value pairs. Some name/value pairs are static values, such prompt /"Employee" or style/"OraTipText", and are specified at design time in the OA Extension Property Inspector. Others are implemented as data bound values, such as the text attribute (TEXT_ATTR) on message beans, where the value is retrieved from the data source at rendering time. For attributes such as TEXT_ATTR, UIX calls the OABoundValue class, an OA implementation of the UIX BoundValue interface. The class contains a single method: 310
  • 311. Oracle Application Framework Developer's Guide, Release 12.1.3 public Object getValue(RenderingContext context); Before examining how a value is fetched from a BoundValue object, note that OA Framework creates a named DataObject for each data source and then caches the DataObject on oracle.cabo.ui.RenderingContext. A data source is identified by the viewName set on the web bean. OA Framework then gets the value from the DataObject using the viewAttr attribute on the bean as a lookup key. Oracle Application implementations of the UIX DataObject interface are: OADictionaryDataViewObject, OADictionaryDataRow, and OADictionaryDataString. At rendering time, when UIX uses the BoundValue object to retrieve the value for TEXT_ATTR,the getValue method in the BoundValue object constructs a key using viewName and viewAttr and gets the named DataObject that is cached on RenderingContext. The logic in the BoundValue object then invokes selectValue, the only method in the UIX DataObject interface, which in turn calls the getAttribute method on the underlying view object to retrieve the value. That value is put on the BoundValue.getValue method, and is the value returned for the attribute at rendering time. Attention To guarantee thread-safety in a multi-threaded enviroment, OA Framework uses data bound values (OABoundValue) for web bean attribute values. Classes that implement OAWebBean use the data bound values wherever necessary. If these web bean classes provide multiple versions of a method such as setText(String text) and setText(OAPageContext pageContext, String text), then to use data bound values, be sure to select the one that has the OAPageContext parameter. The method without OAPageContext is usually inherited from the super class. For example, use OAMessageTextInputBean.setText(OAPageContext page context, String text) instead of OAMessageTextInputBean.setText(String text). Avoid calls like setAttributeValue(TEXT_ATTR, "<hardcoded string>"), as the attribute value is not a data bound value in this case. If you intend to set your custom attribute value through the setAttributeValue method, you should set the attribute value to your own custom data bound value object. Attention When you want to get an attribute value from a bean, use the getAttributeValue(RenderingContext, AttributeKey) signature whenever possible to ensure that the attribute value is resolved correctly. Simply calling the attribute accessor or the getAttributeValue(AttributeKey) method without the RenderingContext parameter, may return incorrect results if the attribute was set as a bound value. For example, use: getAttributeValue(pageContext.getRenderingContext(), RENDERED_ATTR); The public Oracle E-Business Suite bound values that you can use are as follows and are discussed in more detail in the Runtime Control section: 311
  • 312. Oracle Application Framework Developer's Guide OADataBoundValueAppModule OADataBoundValueViewObject OAFunctionSecurityBoundValue Data Binding for Fields Outside a Table When OA Framework implements bound values for fields outside of a table, the named dictionary of DataObjects is maintained with the current context. The data object name for each bean is defined by: • Application module name and view object instance name - for view object data • NON_VIEW_OBJECT_DATA (static variable in oracle.apps.fnd.framework.webui.OAWebBeanConstants interface) - for non- view object data The data attribute name for each bean is defined by: • View attribute name - for view object data • Region code, item name, etc. - for non-view object data Data Binding for Fields in a Table When you implement bound values for fields in a table, OA Framework generates a DataObjectList instead of a single DataObject. A DataObjectList is simply a list of DataObjects. UIX iterates through the list, setting the "current DataObject" for each iteration. As a result, the bound value on the text attribute (TEXT_ATTR) uses the "current DataObject" to fetch its value, as described above. Declarative Implementation Certain attributes (the Required, Rendered, Disabled, and Read Only properties in the Property Inspector) can be bound to values declaratively using SPEL binding. For other attributes where there is currently no means for declaratively implementing bound values, a later release of OA Framework will provide more general declarative data binding support. Runtime Control OA Framework provides three implementations of bound values that you can use: oracle.apps.fnd.framework.webui.OADataBoundValueViewObject, oracle.apps.fnd.framework.webui.OADataBoundValueAppModule and oracle.apps.fnd.framework.webui.OAFunctionSecurityBoundValue. OADataBoundValueViewObject You can use the OADataBoundValueViewObject class to bind a web bean's property with a view object attribute. To do this, set the attribute, representing the web bean's property, to: 312
  • 313. Oracle Application Framework Developer's Guide, Release 12.1.3 new OADataBoundValueViewObject(webBean, viewAttrName) At rendering time, the attribute value becomes the value of the viewAttrName of the view instance associated with the web bean (which defaults to the OA Extension View Instance property). If you wish to override this default view instance, you can use the alternate constructor that allows specification of the view usage name: new OADataBoundValueViewObject(webBean, viewAttrName, viewUsageName) You can also indicate whether or not to format the output of a bound value. Specify OADataBoundValueViewObject as follows, to bind attributes that need to be formatted and rendered on the page (such as TITLE_ATTR, TEXT_ATTR, PROMPT_ATTR, ...). The output that results is always a string, formatted according to the data type of the web bean or view attribute: OADataBoundValueViewObject(OAWebBean webBean, String lookupName, String viewUsageName) OADataBoundValueViewObject(OAWebBean webBean, String lookupName) Specify OADataBoundValueViewObject as follows, to bind attributes that do not need to be formatted and rendered on the page (such as RENDERED_ATTR, READONLY_ATTR, DISABLED_ATTR, ...). Pass formatToString as 'false'. OADataBoundValueViewObject(OAWebBean webBean, String lookupName, String viewUsageName, 313
  • 314. Oracle Application Framework Developer's Guide boolean formatToString) OADataBoundValueViewObject(OAWebBean webBean, String lookupName, boolean formatToString) Example The following code shows how to bind the currency code attribute of the Total bean to display a formatted total according to the currency code attribute value of each row in a table: // Now format the order total value based on the PO's currency code. // "CurrencyCode" is the name of the attribute in the POSimpleSummaryVO // that this table is referencing. OAMessageStyledTextBean orderTotal = (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("OrderTotal "); if (orderTotal !== null) { orderTotal.setAttributeValue(CURRENCY_CODE, new OADataBoundValueViewObject(orderTotal, "CurrencyCode")); } OADataBoundValueAppModule 314
  • 315. Oracle Application Framework Developer's Guide, Release 12.1.3 You can use the OADataBoundValueAppModule class to bind a web bean's property with a value returned from an application module. To do this, override initializeWebValues(Hashtable paramValues) in the application module to put values into the Hashtable keyed by a lookupName. For example, to have a specific web bean's prompt derived from one of the values returned by the application module, put (lookupName, "Value of the prompt"). Then set the attribute, representing the property of the web bean to: new OADataBoundValueAppModule(webBean, lookupName) At rendering time, the attribute value is fetched from the web values Hashtable based on lookupName. OAFunctionSecurityBoundValue OAFunctionSecurityBoundValue is a bound value that returns Boolean.TRUE or Boolean.FALSE based on whether the current session user is authorized to access a specific function. Use this class to check whether a certain function is granted based on specific data context. For example, you can bind the RENDERED_ATTR attribute to a function so that the bean is hidden if the function is not granted //Hides the customer name bean if function 'ShowCustomerNameFunction' is not granted. ... OAFunctionSecurityBoundValue fSBoundValue = OAFunctionSecurityBoundValue("ShowCustomerNameFunction"); custNameBean.setAttribute(pageContext.getRenderingContext(), RENDERED_ATTR, fSBoundValue); ... Other UIX Bound Values UIX provides many other useful bound values. The following table lists the bound values that support some basic operations. Operations UIX Bound Values Arithmetic AddBoundValue, ConcatBoundValue Comparison ComparisonBoundValue, AndBoundValue, OrBoundValue, 315
  • 316. Oracle Application Framework Developer's Guide NotBoundValue Type Conversion ToBooleanBoundValue, ToDateBoundValue, ToCharacterBoundValue, ToIntegerBoundValue, ToStringBoundValue Matching Attribute Values NodeAttributeBoundValue Among Beans For a complete list of UIX bound values, refer to the oracle.cabo.ui.data.bind package. Example 1 The following code shows how to bind a property based on the value of another property. In this case the total bean is not rendered if the salary bean is not rendered: OAMessageStyledTextBean totalBean = (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("totalBean" ); OAMessageStyledTextBean salaryBean = (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("salaryBean "); if(totalBean!=null && salaryBean!=null) { totalBean.setAttribute(RENDERED_ATTR, new NodeAttributeBoundValue(salaryBean, RENDERED_ATTR)); } Example 2 The following code shows how to use UIX standard bound values to achieve more complex or compound binding. In this example, the name attribute is concatenated with the description attribute at rendering time: OAHeaderBean headerBean = 316
  • 317. Oracle Application Framework Developer's Guide, Release 12.1.3 (OAHeaderBean)webBean.findIndexedChildRecursive("headerBean"); if (nameBean!==null && descBean!=null && headerBean!=null) { headerBean.setAttributeValue(TEXT_ATTR, new ConcatBoundValue(new BoundValue[] {new OADataBoundValueViewObject(concatBean,"Name", viewUsage), new OADataBoundValueViewObject(concatBean, "Description", viewUsage)}); } Form Submit Bound Values See Submitting the Form for additional information about bound values that can be used in specific cases where you need to force a form submit when a component is activated. Personalization Considerations See a summary of Bound Values personalization considerations in the Oracle Application Framework Personalization Guide. Known Issues • None Related Information • BLAF UI Guideline(s) o None • Javadoc o oracle.cabo.ui.data.BoundValue o oracle.cabo.ui.data.DataObject o oracle.cabo.ui.data.DataObjectList o oracle.cabo.ui.RenderingContext o oracle.apps.fnd.framework.webui.OAWebBeanConstants o oracle.apps.fnd.framework.webui.OADataBoundValueViewObject o oracle.apps.fnd.framework.webui.OADataBoundValueAppModule o oracle.apps.fnd.framework.webui.OAFunctionSecurityBoundValu e • OA ToolBox Tutorial / Sample Library o Delete Lab 317
  • 318. Oracle Application Framework Developer's Guide Branding Overview As described in the Oracle Browser Look-and-Feel (BLAF) UI Guideline: Branding [ OTN Version ], every OA Framework page reserves the upper left-hand corner for either: • Basic (Non-Contextual) Branding - includes corporate ("Oracle") and product brand names • In-Context Branding - includes user-selected contextual information in addition to the corporate and product brand names All OA Framework pages must provide basic branding support as described below. In-Context branding may be used in select cases (see Oracle Branding Options in the guideline for specific use case recommendations). Basic (Non-Contextual) Branding Basic branding supports a regular layout style as shown in Figure 1. Figure 1: Basic Branding (corresponds to BLAF "Regular" Layout) Regular Layout Pages Launched from the E-Business Suite Personal Home Page If your OA Framework page is launched from the Navigator in the E-Business Suite Personal Home Page, the OA Framework automatically sets the branding text for you based on the current selected responsibility and page link. This ensures consistency for the user between the options presented in the Navigator, and the branding text displayed on the application page. For example, as shown in the Navigator in Figure 2, the user has selected the responsibility Workflow Administrator Web (New). The top-level menu associated with this responsibility has two submenus with prompts: Administrator Workflow and Transaction Monitor. If the user selects a link beneath one of these submenus (the corresponding function must be of type JSP or INTEROPJSP), the OA Framework automatically sets the branding text to the parent submenu's prompt. • If the user selects the Business Events in the example below, the OA Framework sets the branding text to Administrator Workflow. • If the user selects the Transaction Monitor link in the example below, the OA Framework sets the branding text to Transaction Monitor (if the Transaction Monitor 318
  • 319. Oracle Application Framework Developer's Guide, Release 12.1.3 link label were to be changed to "My Monitor," the branding text would still be set to Transaction Monitor since the link prompt has no effect on this). Figure 2: E-Business Suite Personal Home Page Navigator If you attach a function directly to the responsibility main menu instead of a grouping submenu, the branding text defaults to the responsibility name. For example, assume you have the following structure based on the Workflow use case shown above. Note that the new "Worklist" function is attached directly to the main menu. When this page renders, the branding text will be Workflow Administrator Web (New). Workflow main menu // root menu associated with the Workflow Administrator Web (New) responsibility | -- Worklist (function) | -- Administrator Workflow (grouping menu) | -- Home (function) | -- Developer Studio (function) | -- Business Events (function) | -- Status Monitor (function) | -- Notifications (function) | -- Transaction Monitor (grouping menu) | -- Transaction Monitor (function) In this case, you can either add a grouping menu to your main menu and move the function accordingly, or you can use the manual override instructions provided below. Branding Override 319
  • 320. Oracle Application Framework Developer's Guide If the default behavior is unacceptable, you can override it by following these instructions: Step 1: Define a form function to represent your branding text (see Tabs / Navigation if you need information on creating application functions and menus). Note that the User Function Name value must be set to the branding text that you want to display in the upper left-hand corner of your application's pages. For example, in the OA Framework ToolBox Tutorial, we defined a function with the following properties. The value "OA Framework ToolBox Tutorial" displays in the branding area. • Function: FWK_TOOLBOX_BRAND • User Function Name: OA Framework ToolBox Tutorial Step 2: Associate this function with your application's "Home Page" navigation menu. Note: It's important that you do not specify a prompt when you associate your branding function with the menu. Figure 3 shows the FWK_TOOLBOX_BRAND function properly associated with the ToolBox Tutorial's "Home Page" navigation menu. Figure 3: OA Framework ToolBox Tutorial "Home Page" menu with branding function Step 3: Set the request parameter OAPB to the name of the function that you created in Step 1. You should specify this wherever you set the menu context OAHP request parameter (see Tabs / Navigation if you need information about this). For example, if you access your application from a test JSP, the page link should include the OAPB parameter in addition to the OAHP and the OASF menu parameters. This is illustrated in the URL below from the OA Framework ToolBox Tutorial test_fwktutorial.jsp: <a href="<%=URLMgr.processOutgoingURL("OA.jsp?OAFunc=FWK_TOOLBOX_HELLO &OAPB=FWK_TOOLBOX_BRAND&OAHP=FWK_TOOLBOX_TUTORIAL_APP 320
  • 321. Oracle Application Framework Developer's Guide, Release 12.1.3 &OASF=FWK_TOOLBOX_HELLO&transactionid=" + transactionid + "&dbc=" + dbcName, macKey) %>">Hello,World!</a><br> Alternatively, you can specify the product branding on the page itself: Step 1: For each page in your application, select the pageLayout region in the JDeveloper structure pane, right-click and select New > productBranding. Set the corresponding item's Style to formattedText. Assign the formattedText item a standards-compliant ID, and set the Text property to product name that you want to display in the branding area. Note: The branding context that you set declaratively on a page is not retained across the application. If you want to retain the branding context across an application, you should set the OAPB parameter, as it was introduced specifically for that purpose. The following matrix describes the precedence order for the different sources of the branding text value. The OAPB parameter, if specified, always prevails. The declarative page setting also overrides the automatic setting of the grouping menu value. The responsibility name displays only if no other options are available. OAPB Parameter Declarative Product Grouping Result: Branding Source Branding Submenu Not specified Not specified Specified Grouping Submenu Specified Not specified Specified OAPB Not specified Specified Specified Declarative Product Branding Specified Specified Specified OAPB Not specified Not specified None Responsibility Once the branding context is set with the OAPB parameter value, it remains unchanged until you explicitly reset the OAPB parameter value. Options for resetting this value include: • Defining in in a URL associated with a item • Defining it in a navigation function's Web HTML call • Passing it as a parameter in a JSP forward or client redirect method call Tip: If you support switching application contexts at runtime, remember to change your brand! Pages Launched from Forms For OA Framework pages launched from a form, the branding text should render as the display name of the current form function. To do this, call fnd_function.user_function_name in your form and set the OAPB branding parameter to this value when you open the OAF page. For additional information about opening OA Framework pages from Forms, see the Forms / OA Framework Integration document. 321
  • 322. Oracle Application Framework Developer's Guide For OA Framework pages launched from a link in the Forms Navigator, the branding text should render as the display name of the associated form function. So, when you define this form function's Web HTML Call, set the OAPB parameter value to the current function name. In-Context Branding The in-context branding includes the corporate and product brand images. Additionally, contextual information renders below the corporate and product information as shown in Figure 4. Figure 4: Example of in-context branding Note that this style of branding is intended to be used only for cases where the user makes a contextual selection when starting work that remains unchanged for the life of the application or task. Declarative Implementation Step 1: For each page in your application, select the pageLayout region in the JDeveloper structure pane, right-click and select New > productBranding. Set the corresponding item's Style to formattedText instead of "image" as you did above. Assign the formattedText item a standards-compliant ID, and set the Text property to product name that you want to display in the branding area. Step 2: Select the pageLayout region again, right-click and select New > inContextBranding. Set the corresponding formattedText item's ID and set the Text property to the context you wish to display (for example, this would be "Customer <b>Sun Microsystems - Menlo Park</b>" in Figure 4 above). Note: Creating an inContextBranding component without a productBranding component is invalid. The OA Framework throws a Developer Test Mode error for this condition if you work with this test mode enabled. Runtime Control If you need to change the contextual information programmatically, you can do the following: public void processRequest(OAPageContext pageContext, OAWebBean webBean) { 322
  • 323. Oracle Application Framework Developer's Guide, Release 12.1.3 super.processRequest(pageContext, webBean); OAFormattedTextBean inContextTextBean = (OAFormattedTextBean)createWebBean(pageContext, FORMATTED_TEXT_BEAN); // Remember that you must pass a translated value obtained from message dictionary, // not a static String as shown here. inContextTextBean.setText("Text for In-Context Branding"); // Ensures the correct CSS style is applied. inContextTextBean.setStyleUsage(IN_CONTEXT_BRANDING_STYLE); OAPageLayoutBean page = pageContext.getPageLayoutBean(); page.setInContextBranding(inContextTextBean); } Personalization Considerations • See a summary of Branding personalization considerations in the Oracle Application Framework Personalization Guide. • You can also refer to the section called Personalizing Your System: Branding in the Oracle Application Framework Personalization Guide for additional information. Known Issues • The default Small branding text does not display in a mobile page. 323
  • 324. Oracle Application Framework Developer's Guide Related Information • BLAF UI Guidelines o Branding [ OTN Version ] • Javadoc o oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBe an 324
  • 325. Oracle Application Framework Developer's Guide, Release 12.1.3 Bulleted List Overview Simple, HTML bulleted lists appear in numerous BLAF UI Guideline specifications. For example, they are routinely used in content containers as shown below: Figure 1: Example of a content container with a bulleted list. As implemented in the OA Framework, the bulleted list is a container that can hold any kind of children (although, for all practical purposes, most bulleted lists are simply comprised of plain text or links). Each region item is rendered with a bullet. The bulleted list can be split into columns by specifying the maximum number of rows (bullet items) that should render in a column before starting another until the 3 column maximum is reached. Once the total number of rows would exceed 3 columns using the specified multiplier, all rows are allocated as evenly as possible to 3 columns. Declarative Implementation To add a bulleted list to your page, follow these steps. The OA Framework will create an oracle.apps.fnd.framework.webui.beans.layout.OABulletedListBean. Step 1: Create a region item set its style to bulletedList. Step 2: Set the region's ID property in accordance the OA Framework FIle Naming Standards. Step 3: Add one or more items to the bulletedList. They can be of any item style. Step 4: (optional) Set the Height property to determine how many items should render before a new column is created. Step 5: Save your work. Runtime Control 325
  • 326. Oracle Application Framework Developer's Guide Warning: You should create web beans programmatically only if you cannot create them declaratively. Programmatically created web beans cannot be personalized, reused, or extended easily. See the OA Framework Controller Coding Standards for additional information about this and other guidelines that you should consider when writing web bean manipulation code. Instantiate See the oracle.apps.fnd.framework.webui.OAControllerImpl Javadoc for other createWebBean*() signatures. Note: Always choose a signature that lets you specify the web bean's internal name. import oracle.apps.fnd.framework.webui.OAWebBeanConstants; import oracle.apps.fnd.framework.webui.beans.layout.OABulletedListBean; ... processRequest(OAPageContext pageContext, OAWebBean webBean) { ... // Create the list bean container OABulletedListBean bullets = (OABulletedListBean)createWebBean(pageContext, OAWebBeanConstants.BULLETED_LIST_BEAN, null, "bulletList"); // Create and add a link, plain text and an image to the bulleted list 326
  • 327. Oracle Application Framework Developer's Guide, Release 12.1.3 OALinkBean link = (OALinkBean)createWebBean(pageContext, OAWebBeanConstants.LINK_BEAN, null, "linkEx"); OAStaticStyledTextBean text = (OAStaticStyledTextBean)createWebBean(pageContext, OAWebBeanConstants.STATIC_STYLED_TEXT_BEAN, null, "textEx"); OAImageBean image = (OAImageBean_createWebBean(pageContext, OAWebBeanConstants.IMAGE_BEAN, null, "imageEx"); bullets.addIndexedChild(link); bullets.addIndexedChild(text); bullets.addIndexedChild(image); ... Control Visual Properties To set the multiple after which the rows are split into columns, get a handle to the bulleted list bean and call setRows(int). The default split size is 10. You can also pass the value Integer.MAX_VALUE as the parameter if you want all your bullet items to render in a single column, regardless of their number. Personalization Considerations • None Known Issues 327
  • 328. Oracle Application Framework Developer's Guide • None Related Information • BLAF UI Guideline o Content Containers in a Page [ OTN Version ] • Javadoc o oracle.apps.fnd.framework.webui.beans.layout.OABulletedList Bean • ToolBox Tutorial / Sample Library o oracle.apps.fnd.framework.toolbox.samplelib.webui.SampleBro wserPG.xml 328
  • 329. Oracle Application Framework Developer's Guide, Release 12.1.3 Buttons (Action/Navigation) Overview As described in the BLAF UI Guideline: Buttons (Action/Navigation) [ OTN Version ] specification, action/navigation buttons can be used to: • Perform actions without navigating the user off the page (the page redraws with evidence that an action has been performed) • Navigate the user to another page without performing any actions • Perform an action and navigate the user to another page Action/navigation buttons can be placed as follows within a page. • In relation to a single field, poplist, or text area • In relation to a group of standard widgets • In relation to a table • In relation to the entire page (as individual action buttons, or within a multistep navigation control) Figure 1: BLAF UI Guidline illustration of all possible action/navigation button usages within a page 329
  • 330. Oracle Application Framework Developer's Guide 330
  • 331. Oracle Application Framework Developer's Guide, Release 12.1.3 This document describes how to implement each of the following: • Action (Submit) Buttons • Navigation (Link) Buttons It also describes how to position buttons in different page locations (for example, page-level buttons). For information on implementing buttons for navigating multistep transaction flows, see the Locator Element: Page/Record Navigation document. Action (Submit) Buttons Action buttons submit the page form when selected by the user (they perform an HTTP POST). Declarative Implementation To add a submit button to your page (regardless of its location) follow these steps. The OA Framework will instantiate an oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean with the name you assign the region item in Step 1. Step 1: Create a region item and set its style to submitButton Step 2: Set the region item's ID property in accordance the OA Framework File naming standards. Step 3: (optional): I you're adding a common button (like the "Apply," "Go," or "Cancel" buttons, or a standard button for your product), specify an attribute set. For example, the standard OA Framework "Go" button attribute set is: /oracle/apps/fnd/attributesets/Buttons/Go See Implementing the View for additional information about using attribute sets. Step 4: (assuming no attribute set): Specify the button label by setting the Prompt property. Step 5: (assuming this isn't inherited from the attribute set): Specify the ALT text by setting the Short Description property. This value is required for assistive technologies, and is also displayed as tooltip text when a mouse moves over the button. Runtime Control Warning: You should create web beans programmatically only if you cannot create them declaratively. Programmatically-created web beans cannot be personalized, reused, or extended easily. 331
  • 332. Oracle Application Framework Developer's Guide See the OA Framework Controller Coding Standards for additional information about this and other guidelines that you should consider when writing web bean manipulation code. Instantiate To instantiate an OASubmitButtonBean, call the appropriate createWebBean() factory method in the oracle.apps.fnd.framework.webui.OAControllerImpl class. If you select a signature that requires a constant to determine what kind of bean to create, use oracle.apps.fnd.framework.webui.OAWebBeanConstants.BUTTON_SUBMIT_BEAN. Control Visual Properties The only visual property of a button that you might change at runtime is its text. To do this, get a handle on the OASubmitButtonBean and call its setText(pageContext, String) method. Remember when setting String values displayed in the user interface to always obtain the value from Applications Message Dictionary first. Never set a hard-coded value. Control Behavior and Data In rare cases, the BLAF UI Guidelines allow for buttons to be disabled. To disable a button, get a handle on OASubmitButtonBean and call its setDisabled(boolean) method. You might also want to turn off Javascript onSubmit validation when the button is pressed (for example, you have a submit button that might be pressed before a page's data is fully entered by the user, and you don't want to annoy him with premature validation errors). In your controller's processRequest() method, get a handle to the OASubmitButtonBean and call its setUnvalidated(Boolean) method. Finally, you can also turn off server-side validation when a submit button is pressed. In this case, all page data will be pushed to the underlying view object(s) (and corresponding entity objects) where server-side validation will be performed, however, any exceptions will be ignored so code that you write in processFormRequest() will proceed as if there had been no validation performed in the processFormData() phase. To implement this in your controller's processRequest() method, get a handle to the OASubmitButtonBean and call its setServerUnvalidated(Boolean) method. For additional information about the submit processing phases, see Implementing the View. For information about bypassing validation, see Implementing the Controller. Tip: If you define a button and you don't want it to perform either client or server-side validation (a transaction "Cancel" button is a common example if you don't need to implement special processing when it's pressed), consider making it a plain navigation button instead. Handle Button Press Events 332
  • 333. Oracle Application Framework Developer's Guide, Release 12.1.3 When the user selects a submit button, the browser performs an HTTP POST while adding the button's name to the request (note that this name is set to the button's ID property, or the name value specified when creating the web bean programmatically). To ascertain whether a particular submit button has been pressed , add the following code to a controller associated with a region above the button in the page's bean hierarchy. public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { ... // Check to see if a submit button named "Go" has been pressed. if (pageContext.getParameter("Go") != null) { ... If the action button that you're implementing should also navigate the user to another page after performing an action (or you need to forward back to the current page so you can edit the web bean hierarchy in processRequest()), use the setForward*() methods in the oracle.apps.fnd.framework.webui.OAPageContext. Blocking on Submit Whenever a submit action takes place on a page, subsequent submits can be blocked. When using a blocking on submit technique, when the submit action takes place, the cursor becomes busy and prevents any other submit action until the current submit event has been handled. The block on submit behavior is not enabled by default on a page. However, For Partial Page Refresh (PPR) events alone, it is enabled by default. To implement the block on submit behavior on a specfic page, add the following code to the processRequest() of that page: 333
  • 334. Oracle Application Framework Developer's Guide import oracle.apps.fnd.framework.webui.beans.OABodyBean; public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OAWebBean body = pageContext.getRootWebBean(); if (body instanceof OABodyBean) { ((OABodyBean)body).setBlockOnEverySubmit(true); } ... ... } . Navigation (Link) Buttons Navigation buttons navigate the user to a new destination without performing any actions. In other words, they are simply fancy links that perform an HTTP GET when selected by the user. Note: It is perfectly appropriate for a navigation button to perform an HTTP POST instead of a GET if necessary for your page design. In this case, simply define the button with a submitButton item style. When selected, the button will submit the page form as described above. Declarative Implementation To add a plain, link-like button to your page (regardless of its location) follow these steps. The OA Framework will instantiate an oracle.apps.fnd.framework.webui.beans.nav.OAButtonBean with the name you assign the region item in Step 1. Step 1: Create a region item and set its style to button. Step 2: Set the region item's ID property in accordance the OA Framework File Standards. 334
  • 335. Oracle Application Framework Developer's Guide, Release 12.1.3 Step 3: (optional): If you're adding a standard button for your product, specify an attribute set. See Implementing the View for additional information about using attribute sets. Step 4: (assuming no attribute set): Specify the button label by setting the Prompt property Step 5: (assuming no attribute set): Specify the ALT text by setting the Short Description property. This value is required for assistive technologies, and is also displayed as tooltip text when a mouse moves over the button. Step 6: Specify the Destination URI property as shown in the following examples: OA.jsp?OAFunc=FWK_TBX_EMPLOYEE&retainAM=Y OA.jsp?page=/oracle/apps/fnd/framework/toolbox/tutorial/webui/PoDetail sPG See Implementing the View for additional information about specifying URL parameters. Runtime Control Warning: You should create web beans programmatically only if you cannot create them declaratively. Programmatically-created web beans cannot be personalized, reused, or extended easily. See the OA Framework Controller Coding Standards for additional information about this and other guidelines that you should consider when writing web bean manipulation code. Instantiate To instantiate an OAButtonBean, call the appropriate createWebBean factory method in the OAControllerImpl class. If you select a signature that requires a constant to determine what kind of bean to create, use OAWebBeanConstants.BUTTON_BEAN. Control Visual Properties The only visual property of a button that you're likely to change is whether it's displayed or not. To do this, get a handle to the OAButtonBean and call its setRendered(boolean) method. You can also change its prompt by calling its setText(pageContext, String) method, and its ALT text by calling setShortDescription(String). Remember when setting String values displayed in the user interface to always obtain the value from Applications Message Dictionary first. Never set a hard-coded value. Control Behavior and Data In rare cases, the BLAF UI Guidelines allow for buttons to be disabled. To disable a button, get a handle the OAButtonBean and call its setDisabled(Boolean) method. 335
  • 336. Oracle Application Framework Developer's Guide If you need to set the button's destination programmatically, always specify the URL in relation to the document root node. For example: Handle Button Press Events When the user selects a plain navigation button, the browser issues an HTTP GET request to display the new target page. There is no need to write any code to ascertain whether the button is pressed. If you must handle the button press before navigating to a new page, create an OASubmitButtonBean instead. Location-Specific Button Implementations This section describes how to add action/navigation buttons to specific locations within a page. In all cases, create either a submit button or a plain button as described above. Page-Level Buttons (Page Button Bar) Page-level action/navigation buttons render below both the page tile and the page contents bottom line (the "ski") as shown below. Figure 2: example of page-level action/navigation buttons Declarative Implementation Note: You must specify a page title for your page if you want the page-level action/navigation buttons to appear at the top of the page. If you don't set this value, they will appear only beneath the "ski." See Headers and Subheaders for additional information about specifying a page title. To add page-level action/navigation buttons: 336
  • 337. Oracle Application Framework Developer's Guide, Release 12.1.3 Step 1: Select the pageLayout region and add a region beneath it with the style pageButtonBar. The OA Framework will an instantiate an oracle.apps.fnd.framework.webui.beans.nav.OAPageButtonBarBean. Step 2: Add one or more buttons to the pageButtonBar region (follow the instructions above for adding specific button types). Add them in ascending sequence as you want them to appear from left to right. So, for example, if you have a "Cancel" and "Apply" button on your page, and you want them to render with "Apply" being the rightmost button as specified in the UI Guidelines, add the "Cancel" button first. Note: The OA Framework automatically adds the correct amount of space between buttons when you add them to the pageButtonBar. Runtime Control Warning: You should create web beans programmatically only if you cannot create them declaratively. Programmatically created web beans cannot be personalized, reused, or extended easily. See the OA Framework Controller Coding Standards for additional information about this and other guidelines that you should consider when writing web bean manipulation code. To instantiate the OAPageButtonBarBean for page-level action/navigation buttons, follow this example showing an OASubmitButtonBean "Apply" and an OAButtonBean "Cancel": import oracle.apps.fnd.framework.webui.OAWebBeanConstants; import oracle.apps.fnd.framework.webui.form.OASubmitButtonBean; import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean; import oracle.apps.fnd.framework.webui.beans.nav.OAButtonBean; import oracle.apps.fnd.framework.webui.beans.nav.OAPageButtonBarBean; ... processRequest(OAPageContext pageContext, OAWebBean webBean) { ... // Assuming the controller is associated with the pageLayout region OAPageLayoutBean page = (OAPageLayoutBean)webBean; 337
  • 338. Oracle Application Framework Developer's Guide // Remember to use Message Dictionary for UI Strings; never hard- code Strings as shown here. // Always use the createWebBean signatures that let you specify the component's internal name, // unless you're creating a web bean defined in JDeveloper. OAPageButtonBarBean buttons = (OAPageButtonBarBean)createWebBean(pageContext, OAWebBeanConstants.PAGE_BUTTON_BAR_BEAN, null, "pbBar"); OASubmitButtonBean applyButton = (OASubmitButtonBean)createWebBean(pageContext, OAWebBeanConstants.BUTTON_SUBMIT_BEAN, null, "applyButton"); applyButton.setText("Apply"); OAButtonBean cancelButton = (OAButtonBean)createWebBean(pageContext, OAWebBeanConstants.BUTTON_BEAN, null, "cancelButton"); cancelButton.setText("Cancel"); // Now add the buttons to the page button bar. Remember to add them as you want them // to display from left to right (in an American UI). buttons.addIndexedChild(cancelButton); buttons.addIndexedChild(applyButton); // Finally, set the page button bar on the page layout. This example assumes the // page title was set declaratively. page.setPageButtons(buttons); 338
  • 339. Oracle Application Framework Developer's Guide, Release 12.1.3 ... Region-Level Buttons Buttons that relate to a region render right-justified immediately below the region header as shown below. Figure 3: example of a region-level button For a reference implementation, select the Buttons (Action/Navigation) option in the ToolBox Sample Library. Note that adding a pageButtonBar region to any region other than the pageLayout region results in its child(ren) button(s) rendering only once beneath the region's header. Component Group Buttons Buttons that relate to a group of components render immediately below the group. Figure 4: example of a button for a group of related widgets For a reference implementation, select the Buttons (Action/Navigation) option in the ToolBox Sample Library. Component Button 339
  • 340. Oracle Application Framework Developer's Guide A button that relates to a single component (like a field or poplist) renders immediately to the right of the component as shown below. A "Go" button for a single search field is a common example. Figure 5: example of a button in relation to a single widget For a reference implementation, select the Buttons (Action/Navigation) option in the ToolBox Sample Library Table Button Buttons that relate to an entire table render right-justified immediately above the table as shown below. A button for creating objects displayed in the table is a common example. Figure 6: example of a button in relation to a table For a reference implementation, select the Buttons (Action/Navigation) option in the ToolBox Sample Library. Buttons that perform actions on a selected table row are a special case. See the tables (classic or advanced) documentation for additional information about implementing control bar buttons and poplists. Known Issues • None Related Information • BLAF UI Guideline(s) o Buttons (Action/Navigation) [ OTN Version ] • Javadoc o oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBe an o oracle.apps.fnd.framework.webui.beans.nav.OAButtonBean o oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBe an 340
  • 341. Oracle Application Framework Developer's Guide, Release 12.1.3 o oracle.apps.fnd.framework.webui.beans.nav.OAPageButtonBarBe an • OA Framework ToolBox Tutorial / Sample Library 341
  • 342. Oracle Application Framework Developer's Guide Buttons (Global) Overview As described in the BLAF UI Guideline: Buttons (Global) [ OTN Version ] specification, global buttons provide access to tasks that apply to an entire application , and as such, are accessible from every page in the application. Global buttons render in the upper right-hand corner of an application above its tabs as shown below: Figure 1: OA Framework ToolBox Tutorial Application global buttons with "Regular" branding For information about Application Switchers (which appear with the global buttons) see Switchers (Application, Context, Table Content). Declarative Implementation Global buttons are included in an application's menu definition; they are not defined as an OA component region in JDeveloper. Customers can disable global buttons for specific responsibilities and users by leveraging the Application Object Library function security features. Tip: Menus are cached. If you change a menu for an application that you're running within JDeveloper, remember to terminate the OC4J server (Run > Terminate) and re-run your .jsp page to see your menu changes. If you change a menu for a deployed application (as opposed to one that you're running within JDeveloper), remember to bounce the web application server's listener and JVM to see your menu changes. Standard Global Buttons The standard global buttons that appear in all applications (Home, Logout, Preferences, and Help) are included in a seeded menu called ICX_STANDARD_GLOBAL_MENU. To incorporate these buttons in your application, simply add this predefined menu to your application's top-level "Home Page" menu as shown below for the OA Framework ToolBox Tutorial "Home Page" menu. Note that the global submenu does not have an associated prompt. Note: The ICX_STANDARD_GLOBAL_MENU_G menu has never been supported. Please refer to Bug 3508626 Tip: This document assumes you are familiar with creating OA Framework application menus. If not, you might want to read Tabs / Navigation first. 342
  • 343. Oracle Application Framework Developer's Guide, Release 12.1.3 Figure 3: FWK_TBX_TUTORIAL_APPLICATION "Home Page" menu definition in Oracle E-Business Suite Release 12. Diagnostics and Personalize Global Buttons There are two additional "standard" global buttons that render only if corresponding profile options are set: • As shown in Figure 1 above, the Diagnostics button gives users the ability to view log messages for a page (customers generally use this feature under the guidance of an Oracle Support representative). To enable this global button, set the FND: Diagnostics profile option value to Yes at the appropriate level for your needs. See Logging for additional information. • The "Personalize" button gives users the ability to personalize the current page. To enable this global button, set the Personalize Self-Service Defn profile option to Yes at the appropriate level for your needs. See the Personalization Guide for additional information. Help Global Button When a user selects the global Help button, OA Framework uses the Application Object Library online Help technology to present page-level context-sensitive help content. To enable context-sensitive Help for a page, you must specify the Help Target property in JDeveloper for the pageLayout region. Note that any Help Target property set for a child of the pageLayout region is ignored. • The Help Target value must be unique. 343
  • 344. Oracle Application Framework Developer's Guide • The Help Target value must start with an alpha character, and may not be longer than 40 characters. • The Help Target must comply with the following syntax: <appShortName>_<packageFunctionalComponent>_<pageName> (for example, FND_tutorial_HelloWorldPG and FND_labsolutions_HelloWorldPG). The package functional component in this context helps to clearly differentiate pages given that you could have the same page name in different packages owned by the same product. If necessary, you may abbreviate the functional component name. Never abbreviate the product short code; abbreviate the page name only as a last resort. • Remember to coordinate with your technical writer so she can incorporate the target in the page's documentation. For detailed information about defining and deploying online Help content, see the Oracle E- Business Suite System Administrator's Guide. Oracle's internal E-Business Suite developers should also review the Applications Documentation Operations web site for other instructions. Product-Specific Global Buttons You can also display product-specific global buttons (see the BLAF Global Buttons Guideline for limits on the number of buttons that you should add, and criteria that you should evaluate before designing a product-specific global button). To do this, you must define a custom menu including the buttons you want to display. 1. Add the ICX_STANDARD_GLOBAL_MENU to your "Home Page" menu as described above. 2. Define functions for each of your product-specific global buttons as you would for any page that you include in a menu, with one small difference: you must also specify an icon (these images should be added to your $APPL_TOP/MEDIA directory). 3. Create a new menu of type Global and add your button functions. Remember to specify a prompt for each function (this value displays as the link text). 4. Add your custom global menu to your "Home Page" menu. Do not specify a prompt. Product-Specific Preferences When a user selects the global Preferences button, OA Framework displays both general and any product-specific preferences in a side navigation menu (if you add them to a PREFERENCES menu using the following instructions). Additional Information: Please refer to the Oracle Applications User's Guide for details about how to use the general Preferences page. You can configure the General Preferences Show Flag profile option to hide the General Preferences menu entry if you wish. Figure 4: Example of "General" and "Application" preferences. 344
  • 345. Oracle Application Framework Developer's Guide, Release 12.1.3 For Oracle's in-house E-Business Suite developers: If you think you have content to add to the General Preferences menu, please contact the OA Framework team. Note: If you do add pages to the General Preferences menu, you must create a global grant to the function's direct parent menu (or permission set). For Oracle's in-house E-Business Suite developers, you may package that grant to ship with the related page patch to enable the rendering of the page in the General Preferences menu. Note that any other page security requirements are fully honored, as the global grant simply ensures the menu gets rendered with the valid page patch present and will not override more specific security rules. Warning: You must retain the application module for all preference page menus and transactions so that when a user returns to his or her original page (prior to selecting the Preferences global button), the transactional context is not lost. The following instructions assume you know how to create menus and functions. If not, please read Tabs / Navigation first. Step 1: Create a menu of type PREFERENCES ("App Pref Menu Container"), and add it to your responsibility root menu. Be sure to leave the prompt null. For example: FWK_TOOLBOX_TUTORIAL_APP (responsibility root menu) • ICX_STANDARD_GLOBAL_MENU • FWK_TOOLBOX_PREFERENCES (Application-specific Preferences container, prompt = "") • FWK_TOOLBOX_HELLO_TAB (Tab menu, prompt = "Hello, World") • FWK_TOOLBOX_SEARCH_TAB (Tab menu, prompt = "Search") Step 2: Create one or more submenus (of any type; OA Framework ignores whatever value you set here) and add them to the PREFERENCES menu with prompts. The submenu prompts 345
  • 346. Oracle Application Framework Developer's Guide render as peers to the General Preferences as shown for the Application link in Figure 4 above. Add page-level functions to these submenus. For example, to include an application-specific preferences menu entry called "ToolBox,", we would create the following menu structure for the ToolBox Tutorial. Note that this example creates two different preferences pages under the "ToolBox" menu entry. FWK_TOOLBOX_TUTORIAL_APP (responsibility root menu) • ICX_STANDARD_GLOBAL_MENU • FWK_TOOLBOX_PREFS_CONTAINER (Application-specific Preferences container, prompt = "") o FWK_TOOLBOX_PREFERENCES (Peer to "General Preferences", prompt = "ToolBox")  FWK_TOOLBOX_PREF_FUNC1 (prompt = "Some Page")  FWK_TOOLBOX_PREF_FUNC2 (prompt = "Another Page") • FWK_TOOLBOX_HELLO_TAB (Tab menu, prompt = "Hello, World!") • FWK_TOOLBOX_SEARCH_TAB (Tab menu, prompt = "Search") Note: Although you can have nested submenus in your PREFERENCES menu, the UI Guidelines recommend that you create as flat a menu as possible. Furthermore, if you want to display only a single page, you can add a function for this page directly to the PREFERENCES menu. Specify a prompt in this case. Note: All Application (product-specific) preferences (menu of Type PREFERENCES) in the current responsibility are added to the side navigation menu. If there are no product-specific PREFERENCES menu defined, and only one preference page exists, the side navigation menu is not displayed. Runtime Control At runtime, OA Framework reads the global menu definition(s), reconciles the standard buttons with your buttons, and instantiates an oracle.apps.fnd.framework.webui.beans.layout.OAGlobalButtonBarBean, to which it adds indvidual oracle.apps.fnd.framework.webui.beans.layout.OAGlobalButtonBeans. OA Framework then sets the OAGlobalButtonBarBean on the oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean by calling its setGlobalButtons(UINode globalButtonsNode) method. Instantiate You should not instantiate global buttons yourself; always create them declaratively. Control Visual Properties 346
  • 347. Oracle Application Framework Developer's Guide, Release 12.1.3 At runtime, there are rare occasions when you might need to do the following (we say "rare" because, by definition, global buttons are universally applicable, so it is fairly uncommon to disable or hide them if a user has function security access): To hide or disable an individual global button, use the following processRequest code: if (< condition >) { OAPageLayoutBean page = pageContext.getPageLayoutBean(); // You must call prepareForRendering() if the following code is // included in a pageLayout controller. If you add it further down // in the layout hierarchy, the menus will be fully processed so you // don't need to do this. page.prepareForRendering(pageContext); OAGlobalButtonBarBean buttons = (OAGlobalButtonBarBean)page.getGlobalButtons(); // Note OA Framework automatically assigns global buttons their corresponding // function name, so this is how you find them. OAGlobalButtonBean button = (OAGlobalButtonBarBean)buttons.findIndexedChildRecursive("<FUNCTION_NA ME>"); 347
  • 348. Oracle Application Framework Developer's Guide // Note that you wouldn't do both at the same time... button.setRendered(false); // Hide the global button, or button.setDisabled(true); // Disable the global button so it renders, but is not selectable } To hide all the global buttons, use the following processRequest code: Warning: Hiding all the global buttons is not recommended; you must get UI team approval before doing this, and you must verify that there isn't a declarative alternative (for example, you could create multiple "Home Page" menus for your application and alternate between the one with and the one without global buttons). if (< condition >) { OAPageLayoutBean page = pageContext.getPageLayoutBean(); page.prepareForRendering(pageContext); page.setGlobalButtons((UINode)null); // Must come after prepareForRendering() // And, if for some reason, you don't want to display any tabs, // do the following. page.setTabs(null); } Tip: If you want to create a page with no "chrome" ( no tabs, global buttons and so forth -- typically required when you display content in a secondary browser window), it would be better to create the page without a pageLayout region. In this case, simply create the page 348
  • 349. Oracle Application Framework Developer's Guide, Release 12.1.3 starting with a stackLayout, a header with a messageComponentLayout, or whatever other layout you need for your content. If the page has form elements, you must remember to add a form to your page. For example, a typical layout might look like: stackLayout // top region for the page |-- form | -- everything else Without a pageLayout region, OA Framework won't try to display any menu components, so you don't need to programmatically hide them. Handle Standard Global Button Selection In some cases, you might need to incorporate custom processing when a user selects a standard global button (the "Logout" button is a common case). Since there is no event point for handling this (for example, selecting the standard "Logout" button forwards to the OALogout.jsp), you should programmatically change the destination URL on the "Logout" global button so you can intercept the selection as shown in the following sample code. Note: The following code is provided to assist in cases when it's absolutely essential that you intercept these standard button actions (and any UI deviations have been approved by the UI Design and Usability team). As a rule, this should be avoided. Warning: You must preserve the original destination URL of the standard logout JSP, and your custom JSP should foward to this destination URL when it completes its processing. If you don't preserve the correct URL, or you forget to forward to OALogout.jsp, you may cause a memory leak (the application module will not be released) and a hung session (the session will not be invalidated). processRequest(...) { // Assume you create a JSP called "MyLogout.jsp" to implement your custom processing. String myLogoutDestination = "MyLogout.jsp&<someParam>=...&<someOtherParam>=..."; myLogoutDestination = new OAUrl(myLogoutDestination).createURL(pageContext); 349
  • 350. Oracle Application Framework Developer's Guide String oldLogoutDestination = null; // Find global logout button OAGlobalButtonBean logoutButton = findGlobalButton("ICX_LOGOUT"); // Save old destination url oldLogoutDestination = logoutButton.getDestination(); saveLogoutDestination(oldLogoutDestination); //Set the new destination url logoutButton.setDestination(myLogoutDestination); ... ... } In your custom MyLogout.jsp: ... // do some custom processing // Always redirect to OALogout.jsp when you're done 350
  • 351. Oracle Application Framework Developer's Guide, Release 12.1.3 String finalDestination = getOldLogoutDestination(); <jsp:forward page="<%= finalDestination %>" /> Personalization Considerations • See a summary of Buttons (Global) personalization considerations in the Oracle Application Framework Personalization Guide. Known Issues • None Related Information • BLAF UI Guideline(s): o Buttons (Global) [ OTN Version ] • Developer's Guide o Tabs / Navigation • Javadoc o oracle.apps.fnd.framework.webui.beans.layout.OAGlobalButton BarBean o oracle.apps.fnd.framework.webui.beans.layout.OAGlobalButton Bean o oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBe an • OA Framework ToolBox Tutorial / Sample Library 351
  • 352. Oracle Application Framework Developer's Guide Charts and Graphs Overview The OA Framework provides a user interface (UI) web bean that allows for graphs and graphs with tables. This UI bean is based on the Business Intelligence (BI) web bean, but does not provide all the options and configurations allowable in the BI web bean. The Gantt chart is also based on the BI web bean, but further aggregates functionality from the OA Hgrid component. Contents The following topics are covered in this document: • Overview • A Chart and Graph Primer o About Graphs o About Gantt Charts o Supported Chart and Graph Types  Bar Graphs  Line Graphs  Area Graphs  Pie Graphs  Combination Graphs  Secondary Graph Types  Scatter Graph  Stock Graph  Gantt Chart • Graphs o Declarative Implementation o Runtime Control o Laying Out Graphs in a Matrix o Personalization Considerations o Known Issues • Charts o Declarative Implementation o Usage Notes o Runtime Control  Adding Dependency Lines  Using FireAction on the Project Column  Using Save Model on the Hierarchy Column  Per Row Dynamic Poplist  Optimizing Child Row Retrieval o Personalization Considerations o Known Issues • Related Information A Chart and Graph Primer 352
  • 353. Oracle Application Framework Developer's Guide, Release 12.1.3 About Graphs The OA Framework Graph web bean is a complex object with numerous variations. It would be impractical to provide examples of each of those variations. But, we can discuss the general characteristics of the Graph web bean, and develop a common vocabulary to help with your understanding. Before looking at the different kinds of graphs you can create and the instructions for creating them, familiarize yourself with the following graph vocabulary. Figure 2: A Sample Graph with labeled components About Gantt Charts Gantt charts are used for visualizing project planning and scheduling information. A Gantt chart is a matrix. Project tasks that make up the project are listed on the left vertical axis of the Gantt chart, while the total time span of the project divided into increments is listed on the horizontal axis of the Gantt chart. A Gantt chart is based on the HGrid web bean (see Figure 1). An extra column is added to the HGrid to display the graph area that contains the task bars and the calendar axis of the chart. Because this requires a special HGrid configuration, the HGrid web bean is not programmatically accessible. Instead, its properties are exposed at the Gantt web bean level. Figure 1: Gantt Design Concepts 353
  • 354. Oracle Application Framework Developer's Guide Familiarize yourself with the following Gantt chart vocabulary. Figure 3: A Sample Gantt Chart with labeled components In a Gantt chart: 354
  • 355. Oracle Application Framework Developer's Guide, Release 12.1.3 • The Project column is the tree component of the HGrid and lists the project(s) and project tasks. • The Resource column identifies additional information such as who is responsible for the task. This column is set as an indexed child of the Gantt web bean; you can add as many resource columns as needed. • The last column in the HGrid displays the graph area of the Gantt chart. A row in a Gantt chart HGrid provides the whole visual representation of a single task. • The Calendar axis is a date table appearing at the top of the last column of the HGrid. Horizontal bars, or markers, representing tasks, are positioned relative to this axis. • The Minor scale determines the calendar increments shown on the second row of the Calendar axis. Valid choices are: days, weeks, months, quarters, half years and years. In Figure 3 above, the Minor scale is months. For the minor scale, you can specify a Start Time and an End Time. • The Major scale determines the calendar increments shown on the first row of the Calendar axis. It has the same valid choices as the minor scale. In Figure 3 above, the Major scale is years. • A Start Time and an End Time define the time span of the chart. • A Primitive is a visual component defined by its geometric shape, color and pattern. • A Marker is a graphical representation of a task in the graph area. It is composed of up to three primitives representing the task's start, middle and end. A marker's start time and end time are bound to the task's DataObject keys. For example, the marker for a default "normal" task type spans the time returned by the GanttConstants.START key to the time returned by the GanttConstants.END key. • A Task Type is the type of graphical representation assigned to a task. It is represented by one or more combination of markers. For example, the default "milestone" task type is drawn with a single "milestone" marker that is defined as a black diamond primitive. There are 4 task types in the default set, they are: "normal" (TaskTypeMap.NORMAL_TASK), summary" (TaskTypeMap.SUMMARY_TASK), "milestone" (TaskTypeMap.MILESTONE_TASK) and "variance" (TaskTypeMap.VARIANCE_TASK). o milestone o normal without percentage complete specified o normal with percentage complete specified o summary o variance You can also add customized Task Types to the TaskTypeMap. The customized Task Type may be constructed with a customized marker. For example, you can define a customized Marker called CRITICAL_MARKER, which is red in color, and use it in the customized Task Type, "criticalTask", as such: criticalTask 355
  • 356. Oracle Application Framework Developer's Guide Primitive red_bar = new Primitive(Primitive.FULL_BAR, Primitive.SOLID, Color.red); Marker critical = new Marker(null, red_bar, null, CRITICAL_START, CRITICAL_FINISH); map.addMarker(CRITICAL_MARKER, critical); // get default set of Task types TaskTypeMap type_map = TaskTypeMap.getDefault(); type_map.addType(CRITICAL_TASK, new Object[]{CRITICAL_MARKER, MarkerMap.PROGRESS_BAR}); • A Dependency Line is a black line that connects two or more tasks together to show a dependency between these tasks. Supported Graph and Chart Types The following list defines the graph types supported by the Graph bean. • Primary Graph Types o absolute area o absolute line o combination graph o horizontal clustered bar o horizontal percent bar o horizontal stacked bar o percent area o percent line o pie o stacked area o stacked line o vertical clustered bar o vertical percent bar o vertical stacked bar • Secondary Graph Types (Secondary graph types are special usage or less common graphs that are associated with particular data types or ways to display unique cases of data. Do not use secondary graph types if the data can be adequately represented by a primary graph type.) o point o scatter o vertical high-low-close stock o gantt (***see exception note below) Note: This is a significantly smaller list than the graph types supported by the BI Bean. 356
  • 357. Oracle Application Framework Developer's Guide, Release 12.1.3 Attention: All the above graphs are created with the graphTable region style, with the exception of Gantt charts, which are created with the gantt region style. The following section provides you with thumbnail examples of each graph type, including Gantt charts. Note: All images in this section are thumbnail images, and are only intended as sample representations of real graphs. It is not recommended that graphs be this small. Bar Graph A standard graph with vertical and horizontal axes where data is represented as a series of bars. Subtypes include: clustered bar graph, stacked percentage bar graph, absolute percentage bar graph, and dual-Y graph. Graph Thumbnail Graph Type Description Usage Notes Vertical and Each cluster of Trends over time. Horizontal bars represents a Comparison of items at the Cluster Bar column of data, same time. Graph for easy comparison of Percentage or changes in the values in a percentage. column. Relationship of parts to the whole. Changes in all parts of a whole. Vertical and Bars always add See Cluster Bar Graph. Horizontal up to 100%. Useful when viewing Stacked proportions of a total Percentage percentage. Bar Graph Vertical and Bars always See Cluster Bar Graph Horizontal show absolute Useful when showing Stacked values. accumulations or cumulative Absolute Bar data. Graph Line Graph A standard graph using vertical and horizontal axes where data is represented by a line, or by series of data points connected by a line. It is optional to display the marker points. If the graph contains only marker points (and no line), then it is a point graph. Subtypes include: stack line graph, percentage line graph, absolute line graph, and dual-Y graph. Graph Thumbnail Graph Type Description Usage Notes Vertical Stacked A graph in which the lines Shows trends over time. 357
  • 358. Oracle Application Framework Developer's Guide Line Graph are stacked. The values of Shows comparisons of items each series are added to at the same time. the values for previous series. The size of the stack represents a Shows rate of data change cumulative total. See Pie Graph for more examples. Vertical Lines are stacked and To show differences or Percentage Line always add up to 100%. trends in parts of a whole. Graph Shows cumulative relationship between the data (out of 100% or total data values) rather than exact data values. Vertical A graph in which each See Vertical Stacked Line Absolute Line data marker reflects the Graph Graph exact data values Useful when showing accumulations or cumulative data. Area Graph A standard graph using vertical and horizontal axes where data is represented as a filled in area. Subtypes include: stacked area graph, percentage area graph, absolute area graph, and dual-Y graph. Graph Graph Type Description Usage Notes Thumbnail Vertical Stacked Area markers are stacked. Shows trends over time. Area Graph The values of each series Shows rate of data change. are added to the values for previous series. The size of Shows percentage or the stack represents a changes in percentage. cumulative total. Shows relationship of parts to the whole. Shows changes in all parts of a whole. Vertical Area markers show the Useful when viewing Percentage series percentage and proportions of a total Stacked Area always add up to 100%. percentage. Graph 358
  • 359. Oracle Application Framework Developer's Guide, Release 12.1.3 Vertical Each area marker reflects Useful when showing Absolute exact data values. accumulations or cumulative Stacked Area data. Graph Pie Graph A graph in which data is represented as sections of one or more circles, making the circles look like sliced pies. Subtypes include: pie, multiple-pie graph, pie bar, ring, multiple-ring, and ring bar graph. Graph Graph Type Description Usage Notes Thumbnail Pie Graph Graph in which one group Shows relationship of parts to of data is represented as a whole. sections of a circle, making Shows percentage or change the circle look like a sliced in percentage. pie. Shows changes in all parts of a whole Combination Graph A graph in which data is represented in a combination of two graph types against a single Y axis. Subtype includes: dual-Y graph. Graph Graph Type Description Usage Notes Thumbnail Combination Emphasizes one or more A single graph with one or graph series of data. Must have at more graph types. least two series to use this You can have a combination graph type. Shows the of one or more graph types, relationship of one series to where each series plotted as another. "data" is assigned a combination graph type (bar, line or area). For example, with two series plotted as "data", the first series can be set as bar graph type and the second series can be assigned a "line" type. Most often used as a Dual-Y graph, where not only do different series correspond to a different graph type, but also to different Y axes. 359
  • 360. Oracle Application Framework Developer's Guide Scatter Graph A graph in which data is represented by the location of markers in an area bound by horizontal and vertical axes, where one measure is plotted against another to show correlation. Graph Thumbnail Graph Type Description Usage Notes Scatter Graph Data is represented Shows correlation between two by the location of data different measures, or two markers. dimension members in the same measure. Especially useful with a number of data items to show the general relationship between them. Stock Graph A graph specifically designed to show, at a minimum, 3 values for each stock (high low close) during a certain time period. A stock graph may additionally show opening stock value and volume. For displaying stock prices over long time periods, it may be preferable to use a line graph, alone or in combination with a stock graph. Graph Graph Type Description Usage Notes Thumbnail High-Low-Close Data shows the high, low Use to show the high, low Stock Graph and closing prices of a stock. and closing prices of a Each stock marker displays stock. three separate values. Gantt Chart A graph used extensively in project management applications to track individual events and the overall progress of a complex project. Graph Thumbnail Graph Type Description Usage Notes Gantt Chart Data is represented Useful for visualizing project by the location and planning and scheduling size of data information. markers. Location indicating a date, and size indicating duration. 360
  • 361. Oracle Application Framework Developer's Guide, Release 12.1.3 Graphs Declarative Implementation To add a Graph web bean to your page, follow these general instructions. Note: All code that you write (and declare) must comply with the OA Framework Standards and Guidelines in Chapter 8. Please pay special attention to the performance standards. Step 1: Create an application module for your Graph web bean, if a root UI application module does not already exist. If a root UI application module exists, your work can be done there, or you can create a new application module and nest it within your root UI application module. Step 2: Create a view object for your Graph web bean, and add it to the application module defined in Step 1. Note that the graph and the data table (if used) must be based on the same view object. All graph columns must also be based on the same view object. As an example, the following query could be used for a graph-related view object. SELECT position_code, count(position_code) FROM fwk_tbx_employees GROUP BY position_code In this example, position_code defines the column to plot on the X-axis, and count(position_code) defines the column to plot on the Y-axis. Note: A graph does not have to plot all columns specified for the graphTable. When you want to render multiple graphs, you can specify each graph to pick a different subset of columns to plot. Step 3: Add your graph to a page. Select the parent region in the OA Extension Structure pane, then choose New > Region from the context menu. (You can alternatively create this as a reusable region). Note: OA Framework does not support graphs under the Detail Disclosure region of a table, under a table or Advanced table region or under a layout region beneath a table or Advanced table region. Set the following properties on the new region: • Give the region a standards-compliant ID. • Set the Region Style property to graphTable. • Set the Graph Render Style property to one of the following: o graph - to display only a graph. If you define multiple graphs, the graphs render one below the other. 361
  • 362. Oracle Application Framework Developer's Guide o both - to display a data table as well as a graph, with the graph rendering below the table. If you define multiple graphs, a poplist of graph titles below the table lets you choose the graph to display. The first graph defined is displayed by default under the graph table. • Create a controller and specify it in the Controller Class property. (See the Runtime Control section.) A default graphs container is automatically created. Figure 4: Sample structure panel after creating a graphTable region Step 4: OA Extension automatically adds a graph to the graphs container. You can also add other graphs to the graphs container by selecting the graphs container in the Structure pane, and choosing New > Graph from the context menu. Set the following properties on the graph. Required properties are marked with an asterisk (*). • Give the graph a standards-compliant *ID. • Set the *Title property to the title you want to display for the graph. Long titles are truncated and appended with an ellipse (...). • Set the Size property to the graph size you wish to display: o very-small - generates a graph of 200 x 125 pixels (width x height). o small - generates a graph of 295 x 250 pixels. (The default size.) o medium - generates a graph of 375 x 295 pixels. o large - generates a graph of 450 x 325 pixels. o custom - generates a graph of custom size, based on the values, in pixels, that you must specify for the width and height properties. • Set the *Graph Type property to the graph type you wish to define. Valid values are: o absolute area o absolute line o horizontal clustered bar o horizontal percent bar o horizontal stacked bar o percent area o percent line o pie o point o scatter o stacked area o stacked line o vertical clustered bar - default o vertical high-low-close stock o vertical percent bar o vertical stacked bar • Set the *Y Axis Label and the X Axis Label properties as appropriate. 362
  • 363. Oracle Application Framework Developer's Guide, Release 12.1.3 • You can optionally set the Aggregate Function property to apply an aggregate function on all columns defined as data, after they are grouped by the specified groupLabels. Valid values are: o none o avg o max o min o sum • Set the Display Data Markers property to True if you wish to plot the data markers on the graph. The default is False. • Set the Display Data Bubble Text property to True if you wish to display bubble text when a user moves the mouse over a data point on the graph. When this property is set to True, the image map for the graph is generated. The bubble text for each data point includes the following: Group, Series, and Value. The default is True. • For a combination graph with multiple series of data plotted as a combination of graph types against a single Y axis, also set the Allow Combination Graph property to True. For non-combination graphs, set this property to False. Note that you can only set the Graph Type property to one of the following for a combination graph: o horizontal clustered bar o vertical clustered bar o horizontal stacked bar o vertical stacked bar o absolute line o stacked line o absolute area o stacked area graph Attention: If the Allow Combination Graph property is set to True on a graph with a Graph Type other than the ones listed above, OA Extension displays a warning at design time and you will also get a run time Exception. • For a dual-Y combination graph with multiple series of data plotted as a combination of graph types against two Y axes, also set the Allow Combination Graph property to True and the Display Secondary Axis property to True. For non-combination graphs, set this property to False. Note also that you can only set the Graph Type property to one of the allowed graph types for a combination graph. • For a dual-Y (non-combination) graph with multiple series of data plotted as one graph type against two Y axes, also set the Display Secondary Axis property to True and enter a value for the Secondary Y Axis Label property. Note also that you can only set the Graph Type property to one of the following for a dual-Y (non-combination) graph: o horizontal clustered bar o vertical clustered bar o horizontal stacked bar o vertical stacked bar o absolute line o stacked line Step 5: Define the columns of the graphTable (graphData) by expanding the default dataMap container beneath the graph in the Structure pane. OA Extension automatically creates two 363
  • 364. Oracle Application Framework Developer's Guide default graphData columns for you and labels them graphDataN. Select a graphData column and in the Property Inspector: • Give the column a standards-compliant ID. • Set the View Instance and View Attribute properties to the appropriate view object and view object attribute from which this column gets its data. • Set the Purpose in Graph property to one of the following valid values: o data - indicates that this column is to be plotted on the Y-axis. You must define one or more data columns. If you define a column as data, you can optionally enter a value for the Prompt property. The value of the Prompt property is used for the legend when multiple data columns are defined or when no seriesLabels column is defined. See the Notes About Graph Columns for more details. o groupLabels - indicates that this column is to be plotted on the X-axis as the group labels. When there are many groupLabels, the graph attempts the following options in the order listed to prevent the labels from overlapping: 1. Stagger labels. 2. Rotate labels. 3. Skip labels. o seriesLabels - indicates that this column determines the Series in the graph. The View Attribute property for this column defines the values for the legend. • For high-low-close stock graphs, set the Stock Value Type property to high, low, or close as appropriate. For all other graph types, set the Stock Value Type property to none. • For a combination graph with multiple series of data plotted as a combination of graph types against a single Y axis, you must map at least two data columns. Set the Combination Graph Type property to bar, line or area and optionally specify a value for the Prompt property. Then set the Combination Graph Type property to bar, line or area for the second data column and optionally specify a value for the Prompt property. Repeat the latter step for other data columns that you may have. • For a dual-Y combination graph with multiple series of data plotted as a combination of graph types against two Y axes, you must map at least two data columns: o For the first data column, set the Combination Graph Type property to bar, line or area, optionally specify a value for the Prompt property and set the Secondary Axis property to True or False. o For the second data column, set the Combination Graph Type property to bar, line or area, optionally specify a value for the Prompt property and set the Secondary Axis property to True or False. Just be sure that at least one column has the Secondary Axis property to True. o Repeat the latter step for other data columns that you may have. • For a dual-Y (non-combination) graph with multiple series of data plotted as a a single graph types against two Y axes, you must map at least two data columns: o For the first data column, set the Secondary Axis property to True or False and specify an optional value for the Prompt property. o For the second data column, specify an optional value for the Prompt property and set the Secondary Axis property to True or False. Just be sure that at least one column has the Secondary Axis property to True. o Repeat the latter step for other data columns that you may have. 364
  • 365. Oracle Application Framework Developer's Guide, Release 12.1.3 Make certain you have at least one column defined as data, and only one column defined as groupLabels. If you need to define another column as seriesLabels, select the dataMap container and choose New > graphData from the context menu. Set the properties as described above. Figure 5: Sample structure panel after creating a graph Notes About Graph Columns • Pie Graphs - Only two columns are required to plot a pie graph: data and groupLabels. Values returned by the groupLabels column are plotted as pie slices. • Combination Graphs and Dual-Y Graphs - No column can be mapped as seriesLabel since the series have to be derived from the explicitly defined multiple data columns for the combination graph, rather than the resulting rows of any view object attribute. • Scatter Graphs - By definition, the two columns, data and groupLabels, required for the scatter graph must be number columns. • Legend Labels - The space that a legend area can occupy is one-fourth the size of the graph. If there are too many legends, the legend text is truncated and appended with an ellipse (...). The legend displayed for a graph is dependent on its graph column definitions. There are three possible scenarios from which legend labels can be derived: o From static data - If no seriesLabels column is defined for the graph and a column is defined as data, then the value specified in that data column's Prompt property appears as the legend label. Note that if no value is specified for the Prompt property, then the value returned from the data column's View Attribute property is used as the legend label. o From query data - If a column is defined as seriesLabels, the values returned from the View Attribute property of this column is used as the legend. If a single data column is also defined, it's Prompt property value, if defined, is ignored. o From both query and static data - If a seriesLabels column and multiple data columns, with Prompt property values are defined for a graph, the legend label is a concatenation of the values specified in the Prompt property and the view attribute value returned by the seriesLabels column. For example, if you have 2 data columns with Prompt set to Salary and Commission, and one seriesLabels column, returning view attr values of slvaN the concatenation looks like: "Salary, slva1", "Salary, slva2", "Commission, slva1" and "Commission, slva2" 365
  • 366. Oracle Application Framework Developer's Guide Step 6: If you want to add a data table to your graph, select your graphTable region in the Structure pane, and choose New > tabularFormat from the context menu. OA Extension automatically creates a table region for you under the tabularFormat container. Figure 6: Sample structure panel after creating a tabularFormat showing the table created Step 7: For the data table, you can define new columns in the table or extend from an existing table. To extend from an existing table, select the table region in the Structure pane, and in the Property Inspector, set the Extends property to the table you want to reference. To create a new table, add columns to the table region by selecting the table region and choosing New > Item from the context menu for each column you wish to create. For each item (or table column), set the following properties: • Give the item a standards-compliant ID. • Set the Item Style property to messageStyledText. • Set the Prompt property. • Set the View Instance and View Attribute properties. These table columns should be a superset of the information shown in your graph. For more information about tables, see Tables - Classic. Figure 8: Sample structure panel with items in table Runtime Control To complete your graph implementation: Step 1: Create a controller and associate it to your graphTable region in the Property Inspector by specifying the controller name in the Controller Class property. 366
  • 367. Oracle Application Framework Developer's Guide, Release 12.1.3 Warning: It is mandatory for the view object associated with the graph to be executed. If it is not executed, a runtime exception is thrown. Step 2: In the processRequest method of this controller class, add an initQuery method for the view object you defined for the graph. Any parameters that are set must be bound before executing the query. Step 3: Add an initGraphQuery() method (you may name this whatever you would like) to the application module you defined for your Graph web bean. In this method, call your view object's initQuery() method. For example: public void initGraphQuery() { PositionGraphVOImpl vo = getPositionGraphVO1(); if (vo == null) { MessageToken[] tokens = { new MessageToken("OBJECT_NAME","PositionGraphVO1")}; throw new OAException("ICX", "FWK_TBX_OBJECT_NOT_FOUND",tokens); } // Per Back Button guidelines, never do a blind query without first checking // to see if it's necessary. if (!vo.isPreparedForExecution()) { vo.initQuery(); } 367
  • 368. Oracle Application Framework Developer's Guide } // end initGraphQuery() Step 4: In your controller's processRequest method, invoke the AM's initGraphQuery() method. Destination URI You can programmatically define a destination URI on a graph, that allows users to drill down to additional information. If the Destination URI property is defined on a graph, the URI specified is used as the drill-down URL. The Destination URI can be an absolute URL or a relative URL to an OA Framework page. The group and series values for each data point are appended to the specified destination URI, so that the resulting URL is specifically associated to a particular data point plotted in the graph. The group and series values can be obtained by the destination page using the parameters OAGgroup and OAGseries. For the drill down feature to work, you must also set the Display Data Bubble Text property on the graph to True. Enabling this property generates an image map, which is required for the drill-down feature to work. When a user selects any data point in the graph, the specified URL is launched. The following sample code can be added to the processRequest method in your controller if you wish to programmatically set the drill-down property: //for FWK_TEST_GRAPHSERVLET -Programmatic test for drill down and image map if(webBean.getUINodeName().equals("region2")) { OAGraphTableBean g1 = (OAGraphTableBean)webBean; //Test -If image map is disabled, drill down should not work g1.setDisplayToolTip(0,false); g1.setDrillDownUrl(0,"http://www.oracle.com"); } //Test image map and drill down if(webBean.getUINodeName().equals("region3")) { OAGraphTableBean g2 =(OAGraphTableBean)webBean; g2.setDisplayDataMarkers(0, true); g2.setDrillDownUrl(0, "OA.jsp?page=/oracle/apps/ak/pages/FWK_TEST_AGR_SUM&akRegio nApplicationId=601&sal={@Salary}"); //Test line graph with data markers and drill-down g2.setDisplayToolTip(1,true); g2.setDisplayDataMarkers(1, true); g2.setDrillDownUrl(1,"http://www.oracle.com"); } Laying Out Graphs in a Matrix 368
  • 369. Oracle Application Framework Developer's Guide, Release 12.1.3 A matrix layout for graphs provides you with better layout control when you need to display multiple graphs on a page. Rather than lay out multiple graphs one below the other, you can better utilize the layout of the page by displaying the graphs in a matrix. Although the number of graphs that can be displayed in a row can be set to any valid number, you should follow the BLAF UI guidelines carefully to avoid creating pages that require too much horizontal scrolling. To lay out your graphs in a matrix: Step 1: Follow the instructions described in the Declarative Implementation and Runtime Control sections to define more than one graph. Step 2: In OA Extension, select your graphTable region and set the following properties on this region: • Graph Render Style - set to graph. • Graphs per Row - set to the number of graphs you wish to display in each row of the matrix. Example Suppose you define five graphs in your graphTable region and you set Graph Render Style to graph and Graphs per Row to 2 on the region. When the region renders, it will display two graphs in the first row, two graphs in the second row, and one graph in the third row. Note The matrix layout for graphs is not applicable if Graph Render Style is set to both. When this property is set to both, only one graph displays beneath the data table, along with a poplist of available graphs. Personalization Considerations • See a summary of Charts and Graphs personalization considerations in the Oracle Application Framework Personalization Guide. Known Issues • None Charts Declarative Implementation To add a Gantt chart to your page, follow these instructions. Figure 9: Sample of completed Gantt chart 369
  • 370. Oracle Application Framework Developer's Guide Note: All code that you write (and declare) must comply with the OA Framework Standards and Guidelines in Chapter 8. Please pay special attention to the performance standards. Step 1: Create an application module for your Gantt chart web bean, if a root UI application module does not already exist. If a root UI application module exists, your work can be done there, or you can create a new application module and nest it within your root UI application module. Step 2: Create 2 view objects and 1 view link for your Gantt chart, and then add them to the application module discussed in Step 1. The first view object should query the Project/Task Name list. For example, it may look like this: SELECT project_id, name, start_date, completion_date, start_date start_from, 'summary' task_type, completion_date end_to, '' text_right FROM pa_projects_all WHERE project_id in (2667, 2225) The second view object should query the details of each task. For example, it may look like this: 370
  • 371. Oracle Application Framework Developer's Guide, Release 12.1.3 SELECT project_id, top_task_id, task_id, task_number, task_name, scheduled_start_date start_from, scheduled_finish_date end_to, task_manager_name text_right, decode(scheduled_start_date, scheduled_finish_date, 'milestone', decode(top_task_id, task_id, 'summary', 'normal')) task_type FROM pa_tasks_v The view link should link the tasks (first view object) with the task details (second view object), as shown in the example below: Figure 10: Example of View Link SQL Step 3: Add your Gantt chart to a page. Select the parent region in the JDeveloper Structure panel, then choose New > Region from the context menu (note that you can alternatively create this as a reusable region). Set the following properties on the new region: • Give the region a standards-compliant ID. • Set the Region Style property to gantt. • The following property values are examples, and are set based on values from our sample view objects shown above. o Set the Task Start Date View Attribute property to the attribute that returns the start date for the marker. In the example shown in Step 2, this would be the StartFrom view attribute. 371
  • 372. Oracle Application Framework Developer's Guide o Set the Task End Date View Attribute property to the attribute that returns the end date for the marker. In the example shown in Step 2, this would be the EndTo view attribute. o Set the Axis Start Date View Attribute property to the attribute that returns the start date for the axis. In the example shown in Step 2, this would be the StartDate view attribute. o Set the Axis End Date View Attribute property to the attribute that returns the end date for the axis. In the example shown in Step 2, this would be the CompletionDate view attribute. o Set the Bar Type View Attribute property to the attribute that returns the task type for the chart. In the example shown in Step 2, this would be the TaskType view attribute. This is from the standard task types, or any additional custom task types you have added. o Set the Right Text View Attribute property to the attribute that returns the text shown to the right of the marker. In the example shown in Step 2, this would be the TextRight view attribute. o There are additional properties we don't use in this example, they are:  Left Text View Attribute property is for any text added to the left of the marker.  Completed Through View Attribute property is the date that designates how much progress has been completed on a task.  Percent Complete View Attribute property is the percentage of task complete. Ignored if non-null value is returned for the Completed Through View Attribute property. If null is returned for both properties, the progress bar will not be shown.  Actual Start Date View Attribute property is used for variance task types, and is the start date for the actual bar.  Actual End Date View Attribute property is used for variance task types, and is the end date for the actual bar.  Baseline Start Date View Attribute property is used for variance task types, and is the start date for the baseline bar.  Baseline End Date View Attribute property is used for variance task types, and is the end date for the baseline bar.  These following properties are not used in this example but allow you to define dependency lines in the Gantt chart. In order to draw dependency lines, a unique ID needs to be assigned to every task in the Gantt chart. For each task that has a dependency on other tasks, the task IDs of those other tasks must be set as predecessors of the original task. This relationship is defined as a view link.  Show Dependency Lines - set to True to render dependency lines. The default is False.  Task ID View Attribute - specify the view attribute name that returns a unique task ID.  Predecessor Accessor - specify the acessor name in the view link for getting the rowset which contains predecessors.  Predecessor View Attribute - specify the view attribute in the predecessor rowset for getting the task ID of a predecessor. 372
  • 373. Oracle Application Framework Developer's Guide, Release 12.1.3 Note You must have a working Gantt chart before you add dependency lines to the Gantt chart. • Set the Auto Scale property to true or false. false is recommended as you set your own scaling with the Axis Major and Axis Minor properties. When set to true, the Axis Major and Axis Minor properties are ignored. • Set the Axis Major property to days, weeks, months, quarters, half-years, or years. • Set the Axis Minor property to days, weeks, months, quarters, half-years, or years. • Set the Show Current Date property to true or false. • Set the Show Bubble Text property to true or false. Step 4: At this point, it is important to refer back to Figure 1, and reacquaint yourself with the fact that a Gantt chart is essentially composed of 2 components. The timeline side of the Gantt chart is driven off of the Gantt web bean. The project/task list side of the chart is a HGrid component. You have just created the timeline side, now you must create the HGrid for the project/task list side. Select the gantt region in the Structure pane, and choose New > Tree from the context menu to create a HGrid tree component. For more information, refer to the HGrid tree component documentation. • Give the region a standards-compliant ID. • Set the Text property to an appropriate value for the column header of your project/task list. For example, use Project/Task Name. • Beneath your tree component, a member category is created, along with an initial item in that category labeled as nodeDef1. Set the properties for nodeDef1. This node is going to be the first column you want to add to your HGrid side. In our example, this is the Project/Task Name data from the first view object. • Set the View Instance property to your first view object. • Set the View Attribute property to the appropriate attribute from your first view object. For example, in our example, this would be Name. • Set the Text property to an appropriate value for the column header of your project/task list. For example, use Project/Task Name. • Add a new item to the member category. Right-click on members, and select New > childNode. The childNode is going to provide the means to link the tasks with the task details through the view link you created. The childNode is labeled as childNode1. • Set the View Link Instance property of childNode1 to your view link instance. Be sure to use the instance, not just the view link name. • Add a new item to the childNode1 category. Right-click on childNode1, and select New > members. There are 2 items created, nodeDef2 and childDef2. For our example, set nodeDef2, and ignore childDef2 as it is not needed. • Set the View Instance property to your second view object's second instance. This sounds a bit confusing, however, when you add your view link to your application module, both a view link instance (usually VLname1), and a second instance of your base view object (usually VOname2) is created. Since we are tying the data together through the view link, the view object Instance that you must use in this reference is the one used by the view link. • Set the View Attribute property to the appropriate attribute from your first view object. In our example, you would set it to TaskName. 373
  • 374. Oracle Application Framework Developer's Guide • Finally, because the test data for the Gantt chart resides in another database, change your project settings. Select your project, choose Project Settings from the context menu, then navigate to Common > Oracle Applications > Runtime Connection. Change the following settings to reflect the location of your test data: o DBC File Name o Username o Password o Responsibility Key Attention: If you intend to support the Export feature on a Gantt chart, then different viewAttributeNames cannot be used at different levels in the hierarchy column (Project). All levels of the hierarchy column (that is, all nodeDefs) should have the same viewAttributeName. This is analogous to the definition of all other columns of a HGrid or Gantt. This restriction does not apply if the Export feature is not being used. Step 5: To define table actions, select your gantt region in the Structure pane of OA Extension. Display the context menu and under New, choose the tableActions. This automatically creates a tableActions named child consisting of a flowLayout region. Step 6: Specify a standards-compliant ID for the region and leave the Region Style as flowLayout or set it to rowLayout. Suggestion If you have only buttons to add to the table actions area, then you can use either layout styles, flowLayout being preferrable. However, if you are adding message web beans such as messageChoice or messageTextInput, along with buttons to the table action area, then you should use the rowLayout style. Using a flowLayout instead of a rowLayout in this case may cause alignment problems. Step 7: Under the Layout region, layout the children you want to render as table actions, such as submitButton or messageChoice. Select the Layout region, and choose New > Item from the context menu. Select the new Item that is created and set the item style as appropriate. Enabling Search on a Gantt Chart You can enable the ability to search the HGrid component of the Gantt chart. Refer to the Enabling Search on an HGrid section of the Chapter 4: HGrid topic for detailed steps on how to accomplish this. Usage Notes Usage in Non-screen reader mode There is a named child under the gantt component, and it is called descriptionColumns. Figure 11: Example of descriptionColumns named child 374
  • 375. Oracle Application Framework Developer's Guide, Release 12.1.3 This named child allows developers to specify information to be displayed for replacing the graphical component in screen reader mode. Developers can specify as many messageStyledText items as they need beneath it. There is an additional property, Render Description Columns, on the gantt component. Developers can set it to true for rendering Description columns. This can be useful even in non- screen reader mode for people with poor vision. Figure 12: Example of 1 description column and Render Description Columns set to true. If the Render Description Columns property is set to true, and there are no description columns defined, the gantt bean generates a default description for you. Figure 13: Example of a default generated description 375
  • 376. Oracle Application Framework Developer's Guide Partial Page Rendering (PPR) in a Gantt Chart If you map an updateable column in a Gantt chart to a view attribute that is used for drawing the Gantt chart, PPR can be enabled so that you can automatically refresh the Gantt chart. For example, suppose you add a messageTextInput item to a gantt region and its view attribute is also the "start date" view attribute for drawing the Gantt chart. When a user changes the date in the column, the Gantt chart is automatically re-drawn to reflect that date. Adjusting the Width of the Gantt Chart OA Framework does not support adjusting the width of a Gantt chart by any means. Even though the Gantt chart is based on the HGrid component (which does allow you to set the width), you should not attempt to alter the width of a Gantt chart by any programmatic means as this may cause distortion of the right image column. For example, if you alter the width of the Gantt chart to 100%, which ties it to the width of the browser, the Gantt chart time line gets distorted when you start to alter the dimensions of the browser window. Runtime Control To complete your Gantt chart implementation: Step 1: Create a controller and associate it with your Gantt chart's parent region. Step 2: Add an initQuery() method to the first view object you used for your Gantt chart. Step 3: Add an initGanttQuery() method (you may name this whatever you would like) to the application module you used for your graph. In this method, call your view object's initQuery() method. For example: 376
  • 377. Oracle Application Framework Developer's Guide, Release 12.1.3 public void initGraphQuery() { TaskListVOImpl vo = getTaskListVO1(); if (vo == null) { MessageToken[] tokens = { new MessageToken("OBJECT_NAME","TaskListVO1")}; throw new OAException("ICX", "FWK_TBX_OBJECT_NOT_FOUND",tokens); } // Per Back Button guidelines, never do a blind query without first checking // to see if it's necessary. if (!vo.isPreparedForExecution()) { vo.initQuery(); } } // end initGanttQuery() Step 4: In your controller's processRequest method, invoke the application module's initGraphQuery() method. Adding Dependency Lines If you wish to add dependency lines to your Gantt chart, you should add them declaratively. If you must add them programmatically, you can do so by adding similar lines of code to the processRequest method of your controller: 377
  • 378. Oracle Application Framework Developer's Guide myGanttChart.setDependencyLinesVisible(true); myGanttChart.setPredecessorsAccessorName("ParentPredecessorsVO"); myGanttChart.setTaskIdViewAttributeName("TaskId"); myGanttChart.setPredecessorsViewAttributeName("TaskId"); Using FireAction on the Project Column If you want to configure the hierarchy (Project) column of a Gantt chart to perform a form submit when selected, see the Using FireAction on the Hierarchy Column section of the Chapter 4: HGrid topic. Using Save Model on the Hierarchy Column If you wish to implement a Save Model ("Warn About Changes" dialog with links), on the hierarchy column of the Gantt chart, you must code it manually, by including the following code example: OATreeDefinitionBean webBean = ... webBean.setAttributeValue(WARN_ABOUT_CHANGES, Boolean.TRUE); Per Row Dynamic Poplist OA Framework provides programmatic support for the implementation of a choice list (poplist or pulldown) in an updatable Gantt chart, such that its poplist values can vary on a row-by-row basis. Refer to Dynamic Poplists in Standard Web Widgets for programmatic instructions. Optimizing Child Row Retrieval When any given level of a Gantt chart is rendered, the rendering engine must first determine whether the node is expandable so that it can render the Expand icon if necessary. To do this, the rendering engine checks whether the node has children by using the Gantt chart's BC4J view links. This translates to firing the detail view object query just to check for the presence of children, which for large Gantt charts, can be a serious performance drain. Using treeChildPresentVOAttr Since data models in Oracle E-Business Suite often have a master row level attribute that keeps track of the presence or absence of children, you can optimize performance in this case. You can instruct the Gantt chart to use this attribute instead of firing a detail view object query to determine whether the expansion icon needs to be rendered. In order to do this, set the 378
  • 379. Oracle Application Framework Developer's Guide, Release 12.1.3 treeChildPresentVOAttr attribute on the <oa:childNode> in the metadata. Unfortunately, since this attribute is currently not supported in metadata, you must set this attribute programatically on the oracle.apps.fnd.framework.webui.beans.nav.OATreeChildBean, which is the runtime web bean corresponding to <oa:childNode>. For example: OATreeChildBean.setChildPresentVOAttr(String childPresentVOAttr) The String parameter in this case is the name of a master view object row attribute that returns "Y" or "N" to indicate whether there are any children. Important: All Applications should use this feature to avoid unnecessary queries against the database. Using treeLevelChildCountAttr Some Oracle E-Business Suite data models also maintain information about the number of children of a master row, at the master row itself. If you have such an attribute available, you may use it instead of treeChildPresentVOAttr. The treeLevelChildCountAttr has two advantages: • You can use this attribute to determine whether a node has children and hence, whether an expansion icon needs to be rendered for a node. • For a Gantt chart that uses record navigation, when a node is expanded, you can use this attribute to properly adjust the record navigation links ("Previous" and "Next") without triggering the fetch of all rows being displayed. In order to do use this attribute, set the treeLevelChildCountAttr attribute on the <oa:nodeDef> in the metadata. Unfortunately, since this attribute is currently not supported in metadata, you must set this attribute programatically on the OATreeDefinitionBean, which is the runtime web bean corresponding to <oa:nodeDef>. For example: OATreeDefinitionBean.setChildCountVOAttr(String childCountVOAttr) The String parameter in this case is the name of a master view object row attribute that returns an oracle.jbo.domain.Number indicating the number of children. Note that this number must match the number of rows actually returned by the detail view object query. Personalization Considerations • See a summary of Charts and Graphs personalization considerations in the Oracle Application Framework Personalization Guide. Also, see a summary of Standard Web Widgets personalization considerations if you plan to implement a dynamic poplist in a Gantt chart. 379
  • 380. Oracle Application Framework Developer's Guide Known Issues • None Related Information • BLAF UI Guideline(s) • Javadoc o oracle.apps.fnd.framework.webui.beans.layout.OAGraphTableBe an • ToolBox Tutorial Lessons • ToolBox Tutorial Sample Library 380
  • 381. Oracle Application Framework Developer's Guide, Release 12.1.3 Dynamic User Interface Overview OA Framework allows you to implement dynamic pages using declarative techniques. This document describes the following in response to user actions, security grants and data state. • Partial Page Rendering (PPR) • Component-Based Function Security • Table Content Switchers Partial Page Rendering As described in the Oracle Browser Look-and-Feel (BLAF) UI Guideline: Partial Page Rendering (PPR) [ OTN Version ], Partial Page Rendering (PPR) is a means by which designated parts of a page -- as opposed to the whole page -- are refreshed when the user performs certain actions. When PPR is enabled, UIX issues requests including the list of any partial page refresh targets. The response includes only these nodes, which are then redisplayed on the page. PPR technology doesn't require any Javascript to achieve the dynamism; it is built in to the components that support it. For example, when the user selects a Show More Search Options Hide/Show link, the associated content refreshes using PPR as illustrated in Figure 1: Figure 1: example of PPR refresh behavior for the Hide/Show component. In OA Framework, PPR technology is automatically implemented for the following components and actions. Assuming the prerequisites listed later in this document are satisfied, the targets of these actions are rendered using PPR. 381
  • 382. Oracle Application Framework Developer's Guide • Table (data set navigation, sorting, totaling, row insertion, row and cell-level Hide/Show toggling) • Hide/Show (toggling) • HideShowHeader (toggling) • List of Values field (populating LOV input) You can also declaratively define your own PPR events for selected components. For example, you can: • Configure the selection of a poplist to cause related fields to render, be updateable, be required, or be disabled based on the selected value. • Configure the value change of a text field to set related field values. For example, set a Supplier value and tab out, the dependent Supplier Site defaults automatically. • Configure the selection of a master table's singleSelection radio button to automatically query and display related rows in a detail table. Contents • Implementing Partial Page Rendering Events • Back Button Behavior • Programming Alternatives to PPR • Changing UI Properties • PPR and Tables • Cascading Data Changes • Coordinating Master/Detail Tables • PPR Event Queuing • PPR Auto-Tabbing • PPR Debugging Implementing Partial Page Rendering Events You can declaratively enable PPR events for the following item styles: • resetButton • link • singleSelection • messageCheckBox • messageTextInput • messageChoice • button • selectionButton • submitButton • radioSet • radioGroup • radioButton • updateable Gantt chart columns mapped to a view attribute used for drawing the Gantt (see Charts and Graphs for additional information after you read this document) • subtabs (see Sub Tab Navigation for additional information after you read this document) 382
  • 383. Oracle Application Framework Developer's Guide, Release 12.1.3 When the user selects a PPR enabled clickable source item (and the item's internal ON-CLICK event is fired), or changes the data value in a messageTextInput (its internal ON-CHANGE event fires), OA Framework sets the PPR event name for the request parameter named "event." Prerequisites For partial page rendering to work, the following prerequisites must be satisfied: • Any bean to be partially refreshed must have an associated ID, either set declaratively in JDeveloper or specified when calling createWebBean() programmatically). This ID must be unique on the page. Tip: UIX does not render IDs for rawText (OARawTextBean) items. To refresh the content in a rawText item, first add it to a stack layout or other region, then make this containing region the refresh target. • Your web bean hierarchy must remain unchanged for the life of the page. In other words, build the page to include all conditionally displayed components, then use the technique described below to map the Rendered property to a special "application properties" view object. Do not programmatically add or remove components from the hierarchy. • The user's browser must support iFrame (currently, Microsoft Internet Explorer 5.5+, Netscape 6+, Mozilla and so on). For other browsers, full page rendering is used. • The user must not use browser-based autocomplete mechanisms (such as Google Suggest), as these interfere with PPR and cause the user to see error messages. • The FND: Disable Partial Page Rendering profile option must be set to No. If this profile value is set to Yes, a Go button renders next to each item you configure to raise a PPR event. • Note: PPR is not supported on the mobile platform. Back Button Behavior When using the browser Back button, PPR behavior varies according to the browser's cache setup as well as the sequence of user actions. For example, a user navigates from Page A to Page B. On Page B, they perform an action which generates a PPR refresh (this page is now in a "B1" state). They then perform "n" number of PPR actions so the page renders in a "Bn" state. • If the user navigates from Bn to Page C and then selects the browser Back button, they should return to Page Bn. This is assuming that the application module was retained and the page is regenerated from the server. If the page is regenerated locally from the browser's cache, the behavior is undefined. • If the user is on page Bn (after performing "n" PPR actions) and selects the browser Back button, the behavior is undefined. In all likelihood, it will take the user "n" back- button clicks, (amount equal to the number of PPR actions performed), to return to the last page they visited before the PPR page -- in this case, Page A. 383
  • 384. Oracle Application Framework Developer's Guide Note: The user can access only one state of the previous page. Although they cannot go back to the intermediate PPR states, the user may need to click the browser Back button more than once to go back to the previous page. Programmatic Alternatives to PPR Previously, if a page needed to change in response to user actions, such as executing a search or pressing a button, you typically handled the initiating event in a processFormRequest() method, then issued a JSP forward back to the same page so that web bean hierarchy changes in processRequest() could be made. With PPR, this is no longer necessary for most UI changes. Whenever possible, leverage the declarative PPR features instead of the programmatic solution. Javascript remains a prohibited technology for Oracle's internal E-Business Suite developers (see Implementing the Controller: Javascript). Changing UI Properties Assuming you've added an item to your page with a style in the list above, the following instructions describe how to configure it to generate PPR events to control the properties of related items. For example, hide or show appropriate fields when a poplist value changes. You can use the industry-standard Simplest Possible Expression Language (SPEL) binding () to declaratively bind the values of certain properties to view object attributes. Tip: Rendered, Read Only, Disabled, and Required are the only properties for which SPEL bindings can be defined. To control other properties, use bound values. For example, use an oracle.apps.fnd.framework.webui.OADataBoundValueViewObject to bind a property to a view object attribute. Note: To change page properties based on a user's List of Values selection, follow a different procedure. See Use the LOV as a Context Switcher in the List of Values document for specific instructions after you read this document. Step 1: Select your item in the JDeveloper Structure pane and set the following properties: • Action Type - set to firePartialAction to enable a PPR event. (The default value is none). • Event - set to the name of the event that OA Framework puts on the request when a PPR action occurs. (The default value is update). • Note: OA Framework doesn't impose any restrictions on the event name. • Parameters - To pass parameters for firePartialAction, select the ... button in the Parameter property to open a Parameters window, then in the Parameters window, specify the name and value of each parameter that you want to pass. The values can be static text or bound values using SPEL syntax, such as: 384
  • 385. Oracle Application Framework Developer's Guide, Release 12.1.3 ${oa<viewInstanceName>.viewAttributeName>} • Submit - set to True for the PPR action to submit the form; or False for the PPR action to perform an HTTP GET request. In both instances the event is handled in your processFormRequest() method. • Note: False is not a supported value. However, you may experiment with it. • Disable Client Side Validation - set to True if you don't want client side validation to be performed when the PPR event is fired. • Note: This applies only if the PPR item is configured to perform a form submit. See Implementing the Controller: Disabling Validation for additional information. • Disable Server Side Validation - set to True if you don't want server-side validation errors to be displayed. See Implementing the Controller: Disabling Validation for additional information. Step 2: Create the items whose property values should be set in response to the PPR event. For example, assume you have several text fields whose Rendered and Read Only properties are determined by a poplist value. Create these messageTextInput items and configure their standard properties. Note: UIX currently does not support the ability to hide components whose direct parent region is a cellFormat or a rowLayout. As a workaround, to hide a component such as a button in a cellFormat, add flowLayout to your cellFormat region first, then add the button to the flowLayout. Additionally, if the target component that you want to effect with the PPR event is a table content switcher, you must add a flowLayout to your table, then add the switcher region to the flowLayout region. Configure the flowLayout region's properties as described in Step 4 below, and not the switcher's properties. Step 3: In the same package where you created the page's root UI Application Module and any UI-specific view objects, create a special application properties view object. Add this view object to your page's root UI application module or, if you're implementing PPR in a shared region, associate this view object with the shared region's application module. Note: This view object should follow the naming convention of: ApplicationModuleName PVO. Therefore, an application properties view object created for an EmployeeAM should be named EmployeePVO. Furthermore, each application module should have no more than one application properties VO. • Add a Number primary key transient attribute named RowKey. (A default value of 1 will be set in Step 7 below). Select the Key Attribute checkbox. • Add one or more transient attributes for the properties that you want to set in response to PPR events. • Configure the view object so that all the transient attributes are passivated. (This is the default configuration). See OA Framework State Persistence Model (Passivation) for additional information about passivation. • Verify that all the attributes are designated as Updateable Always. 385
  • 386. Oracle Application Framework Developer's Guide The transient attributes should be of the following types based on the properties to be set in response to PPR events. Note the list of corresponding valid values for reference when you write code to set these attribute values. Property Attribute Data Valid Values Type Required String • yes • no • uiOnly • validatorOnly Read Only Boolean • Boolean.TRUE • Boolean.FALSE Rendered Boolean • Boolean.TRUE • Boolean.FALSE Disabled Boolean • Boolean.TRUE • Boolean.FALSE For example, in the ToolBox Sample Library, we created a SampleBrowserPVO (associated with the SampleBrowserAM) with the following transient attributes: • PoApproveReadOnly • PoApproveRequired • PoApproveRender • PoApproveReject Although these transient attributes serve a specific purpose, they should be as abstract as possible to allow use by several different components within a page or shared region. For example, the PoApproveReadOnly property listed above is intended to be referenced by several different components when the PO approval status changes. This approach is more abstract than creating a VO property specifically intended to control the updateable property of "component X." Note: Individual attributes should not be set and referenced by multiple pages; each attribute should be used exclusively within a single page. Since each application module has only one application property view object, and a single root UI application module can be associated with many pages, your application property VO may include attributes for several pages. Step 4: Open the JDeveloper property inspector for each of the PPR event target items you created in Step 2. Set the Rendered, Read Only, Disabled and/or Required property values to bind to the view object attributes you created in Step 3 using the following SPEL syntax: 386
  • 387. Oracle Application Framework Developer's Guide, Release 12.1.3 ${oa.<ViewInstanceName>.<ViewAttributeName>} For example, in the ToolBox Tutorial Sample Library, a text field has its Rendered property configured to: ${oa.EmployeePVO1.PoApproveRender) Step 5: In the application module that contains your application properties view object, add a method to set the application property values. For example, in the ToolBox Tutorial Sample Library we have a method called handlePoApprovaChangeEvent() that reads the current value of the PPR event source poplist from the page's underlying entity object, and sets the appropriate property values as shown: public void handlePoApproveChangeEvent() { // Get the special, single-row application properties and make the first // (only) row current. OAViewObject vo = (OAViewObject)findViewObject("SampleBrowserPVO1"); OARow row = (OARow)vo.first(); // Get the value of the view object attribute with the PO Approval status. OAViewObject poVO = (OAViewObject)findViewObject("PurchaseOrderHeadersVO1"); OARow poRow = (OARow)poVO.getCurrentRow(); String status = (String)poRow.getAttribute("StatusCode"); // Set the application property values based on the PO Approval status value. if ("APPROVED".equals(status)) { 387
  • 388. Oracle Application Framework Developer's Guide row.setAttribute("PoApproveRender", Boolean.TRUE); row.setAttribute("PoRejectRender", Boolean.FALSE); row.setAttribute("PoApproveReadOnly", Boolean.TRUE); row.setAttribute("PoApproveRequired", "yes"); } else if ("REJECTED".equals(status)) { row.setAttribute("PoApproveRender", Boolean.FALSE); row.setAttribute("PoRejectRender", Boolean.TRUE); } else { row.setAttribute("PoApproveRender", Boolean.TRUE); row.setAttribute("PoRejectRender", Boolean.TRUE); row.setAttribute("PoApproveReadOnly", Boolean.TRUE); row.setAttribute("PoApproveRequired", "no"); } } // end handlePoApproveChangeEvent() Step 6: In an appropriate controller for handling the PPR event source item's actions, add code to the processFormRequest() method to detect the PPR event and invoke the application module method you created in Step 4. The ToolBox Sample Library's controller for the purchase order approval poplist includes the following code. Note: This example is checking for two different PPR events. The second is described below in Coordinating Master/Detail Tables. public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) 388
  • 389. Oracle Application Framework Developer's Guide, Release 12.1.3 { super.processFormRequest(pageContext, webBean); OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean); String event = pageContext.getParameter("event"); // If the user changes the value of the po approval poplist, call the // event handler in the AM to set the appropriate SampleBrowserPVO // values. if ("poApproveChange".equals(event)) { am.invokeMethod("handlePoApproveChangeEvent"); } else if ("supplierSelect".equals(event)) { am.invokeMethod("handleSupplierSelectionEvent"); } } // end processFormRequest() Tip: If PPR is disabled (the FND: Disable Partial Page Rendering profile value is Yes), this same code executes when the user selects the PPR event source item's Go button. Step 7: In the application module that contains your application properties view object, add a method to initialize this view object (if this application module already has a page initialization method, simply add this code to it). For example, in the ToolBox Sample Library we have a method called initializePPRExamplePage() that automatically creates a purchase order header EO and initializes the application properties VO: 389
  • 390. Oracle Application Framework Developer's Guide public void initializePPRExamplePage() { // Create purchase order header ... OAViewObject appPropsVO = (OAViewObject)findViewObject("SampleBrowserPVO1"); if (appPropsVO != null) { // If the VO already has a row, skip its initialization. Note that // calling getFetchedRowCount() won't perform a DB hit on a VO with // no SELECT and only transient attributes. if (appPropsVO.getFetchedRowCount() == 0) { // Setting the match fetch size to 0 for an in-memory VO // prevents it from trying to query rows. // Calling executeQuery() is a small workaround to a known // BC4J issue that ensures that modified rows in this // transient view object are not lost after commit. See // View Objects in Detail for additional information about // both of these calls. 390
  • 391. Oracle Application Framework Developer's Guide, Release 12.1.3 appPropsVO.setMaxFetchSize(0); appPropsVO.executeQuery(); // You must create and insert a row in the VO before you can start // setting properties. Row row = appProposVO.createRow(); appPropsVO.insertRow(row); // Set the primary key value for this single-row VO. row = (OARow)appPropsVO.first(); row.setAttribute("RowKey", new Number(1)); } // Initialize the application properties VO (and the UI) based on the // default PO approval value set on the underlying object. handlePoApproveChangeEvent(); } else { // throw exception } 391
  • 392. Oracle Application Framework Developer's Guide } // end initializePPRExamplePage() Step 8: In your page's processRequest() method, invoke the application module page initialization method you created in Step 7. For example: public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean); am.invokeMethod("initializePPRExamplePage"); } // end processRequest() PPR and Tables You can also fire row-level PPR events for items in a table, including advanced tables and table- in-table. First and foremost, configure the items as described above. Note: If you are working with a table-in-table or HGrid that uses view links, you need to modify your SPEL syntax as shown: ${oa.current.viewAttrName}. The inclusion of current keyword lets you say "get the value from whatever row BC4J is using to render the current row" since you won't know how to access the view objects and row sets created dynamically for these complex components. To ascertain in which row the column's PPR event was fired, add the following code to your processFormRequest method: public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); 392
  • 393. Oracle Application Framework Developer's Guide, Release 12.1.3 OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean); String event = pageContext.getParameter("event"); if ("<ItemPPREventName>").equals(event)) { // Get the identifier of the PPR event source row String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE ); Serializable[] parameters = { rowReference }; // Pass the rowReference to a "handler" method in the application module. am.invokeMethod("<handleSomeEvent>", parameters); } } In your application module's "handler" method, add the following code to access the source row: OARow row = (OARow)findRowByRef(rowReference); 393
  • 394. Oracle Application Framework Developer's Guide if (row != null) { ... } Cascading Data Changes Use one of the following recommendations when managing cascading data changes during a PPR request: • If the cascaded data change is dependent on more than one EO attribute, then this validation/resolution and final setting of the dependent attributes should be in the validateEntitiy() method. This is because BC4J does not guarantee the order in which the EO attributes are set. See the Update/Validate section of the Java Entity Objects document for more information. • Perform the necessary validation/resolution of dependent attributes in the setAttribute() method and set the dependent attributes. See the following example. Note: If this attribute is an editable field, this newly set value may be overwritten by the form data that is being processed. To update data values when the user changes the value in a given field, such as if the user specifies a supplier value you want to set the default supplier site, follow these instructions: Step 1: Configure a messageTextInput item to issue a PPR event (see Step 1 in Changing UI Properties above). When the data value changes and a PPR event is fired, OA Framework sets the selected data on the underlying view object. Step 2: Assuming the underlying view object is based on an entity object, the entity object setter associated with the PPR source item should implement the logic to call the setters on the associated target entity object attributes. For example, in a purchase order header the setSupplierID() method calls the SupplierEOImpl's Entity Expert to obtain the ID for its default supplier site, which it then passes to the setSupplierSiteID() method. Note: In some circumstances, you may want to suppress this behavior in your entity object. For example, when loading data from an XML file and both the supplier and site IDs are specified. This is currently an open design issue; contact the OA Framework team if you need assistance. To cascade data in a region whose items have no data source, such as (a search criteria region, set the downstream item values directly in your controller. You can still invoke a custom method on the application module that asks a static Entity Expert for information on what value to set, and returns this value to the controller. Whenever possible, all data-related logic should be consolidated in the entity objects and their experts. 394
  • 395. Oracle Application Framework Developer's Guide, Release 12.1.3 See the OA Framework ToolBox Tutorial for a complete, working example of cascading data changes. Note: If you want a poplist to automatically reflect changes to its data as a consequence of a PPR event, you must specify the Picklist View Instance when you define it (also set by calling setPicklistViewUsageName()) and not the Picklist View Definition (also set by calling setPicklistViewObjectDefinitionName()). This will not work if you choose to create a poplist that is cached in the JVM. Coordinating Master/Detail Tables To automatically display rows in a detail table based on the selection of a row in a master table, and the tables are displayed on the same page, follow these instructions to comply with the BLAF Master/Detail Page Template [ OTN Version ]: Step 1: If you have not already done so, create an application properties view object as described above. Step 2: Add a String attribute to your application properties view object. Give it a name like DETAIL_TABLE_TEXT. Set this value dynamically to display a contextual title for the details table as shown in Figure 2. In this example from the ToolBox Sample Library, when the user selects a supplier from the master table, the contextual title for the details table indicates that it is displaying supplier sites for the selected supplier. Figure 2: Example of Master / Detail Tables Step 3: Create a message in Message Dictionary to be used for the details table title. It should include a token for the master table unique (user) identifier. For example: &SUPPLIER_NAME: Supplier Sites. Also, create a generic message to display when no master rows are selected. (In this case, we want to display Supplier Sites). Step 4: Create the master and detail view objects, then configure a view link between them as described in Implementing the Model: View Objects and View Links. Add the master and detail view objects (with the detail view object accessed via the view link) to the page's application 395
  • 396. Oracle Application Framework Developer's Guide module. Finally, add an updateable, transient "SelectFlag" column to the master view object to use as a data source for the table's singleSelection radio button item. Step 5: Create the master table as you normally would (see the Advanced Tables documentation for additional information) and include a singleSelection component. Bind the items to the master view object you created in Step 4, and configure the singleSelection item to issue a PPR event (see Step 1 in Changing UI Properties above). Step 6: Create the detail table and bind it to the detail view object that you created in Step 4. Step 7: Add a method to the page's application module to handle the singleSelection choice. This code must find a selected row in master view object's data set and simply mark it as the current row. Because of the view link configuration, BC4J automatically queries the detail view objects. This logic also updates the application properties DetailTableText attribute value based on the current master row. For example: import oracle.apps.fnd.common.MessageToken; import oracle.apps.fnd.framework.OAViewObject; import oracle.apps.fnd.framework.server.OADBTransaction; ... public void handleSupplierSelectionEvent() { OADBTransaction txn = getOADBTransaction(); String detailTableText = null; // Find the selected radio button so we can mark the current row OAViewObject vo = (OAViewObject)findViewObject("SuppliersVO1"); Row row = vo.getFirstFilteredRow("SelectFlag", "Y"); 396
  • 397. Oracle Application Framework Developer's Guide, Release 12.1.3 // This check assumes getFirstFilteredRow returns null if // it finds no matches. if (row != null) { // Set the master row and get the unique identifier. Row masterRow = row; vo.setCurrentRow(masterRow); String supplierName = (String)masterRow.getAttribute("Name"); MessageToken[] tokens = { new MessageToken("SUPPLIER_NAME", supplierName)}; detailTableText = txn.getMessage("AK", "FWK_TBX_SITES_FOR_SUPPLIER", tokens); } else { // If there is no selected row, display a default generic message. detailTableText = txn.getMessage("AK", "FWK_TBX_SUPPLIER_SITES", null); } // Now set the text message on the DETAIL_TABLE_TEXT attribute in // the application properties VO. 397
  • 398. Oracle Application Framework Developer's Guide SampleBrowserPVOImpl appPropsVo = getSampleBrowserPVO1(); Row appPropsRow = appPropsVo.getCurrentRow(); if (appPropsRow != null) { appPropsRow.setAttribute("DetailTableText", detailTableText); } } // handleSupplierSelectionEvent() Step 8: In your root application module's initialization method where you configured your application properties view object, call the event handler you created in Step 7. This ensures that the header text renders properly when the page first displays before the user makes a selection. For example, in the ToolBox Sample Library, we have the following initialization logic that calls the handleSupplierSelectionEvent() method. ... OAViewObject appPropsVO = (OAViewObject)findViewObject("SampleBrowserPVO1"); if (appPropsVO != null) { // This checks the in-memory cache (doesn't cause a database hit). // If the VO doesn't include a row yet, create and insert one. if (appPropsVO.getFetchedRowCount() == 0) { // Calling executeQuery() is a small workaround to a known // BC4J issue that ensures that modified rows in this 398
  • 399. Oracle Application Framework Developer's Guide, Release 12.1.3 // transient view object are not lost after commit. See // View Objects in Detail for additional information about // both of these calls. appPropsVO.setMaxFetchSize(0); appPropsVO.executeQuery(); appPropsVO.insertRow(appPropsVO.createRow()); // Set the primary key value for this single-row VO. OARow row = (OARow)appPropsVO.first(); row.setAttribute("RowKey", new Number(1)); } ... // Initialize the header text for the supplier sites detail table. handleSupplierSelectionEvent(); ... Step 9: In an appropriate controller for your master table, add code to processFormRequest() to detect the radio button selection and invoke the application module method that marks the current row in the master data set. Step 10: Add the following processRequest() logic to your controller to bind the child table header's Text property to a specially created attribute in the application properties VO. 399
  • 400. Oracle Application Framework Developer's Guide import oracle.apps.fnd.framework.webui.OADataBoundValueViewObject; import oracle.apps.fnd.framework.webui.OAWebBeanConstants; import oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean; ... public void processRequest(OAPageContext pageContext, OAWebBean webBean) { ... // This also works with an advanced table. OAHeaderBean header = (OAHeaderBean) webBean.findIndexedChildRecursive("<RegionName>"); header.setAttributeValue(OAWebBeanConstants.TEXT_ATTR, new OADataBoundValueViewObject(header, "<AttributeName>", "<AppPropertiesViewInstanceName>"); ... } PPR Event Queuing By default, when a PPR event fires, all subsequent events on the page are queued and processed. For example, a page has a text input field configured to fire a PPR event when the user leaves and also has a Submit button. The user makes a change to the data in the text input field and then selects the Submit button. In this case, the text field's PPR event fires and the button click is queued. After receiving the PPR response, the Submit action is performed. Note: To disable this feature, set the value of the profile FND_PPR_EVENT_QUEUE_DISABLED to Y. In this case, when a PPR event fires, all subsequent events on the page are ignored. 400
  • 401. Oracle Application Framework Developer's Guide, Release 12.1.3 To implement event queuing on a specific page, add the following code to the processRequest() of that page. The default behavior is then enabled for only that page: import oracle.apps.fnd.framework.webui.beans.OABodyBean; ... public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OAWebBean body = pageContext.getRootWebBean(); if (body instanceof OABodyBean) { body.setFirstClickPassed(true); } ... ... } PPR Auto-Tabbing By default, when you tab out of a text input field that triggers a partial page rendering event, the focus moves to the next field on the page. If the profile option FND_PPR_DISABLE_AUTOTABBING is set to 'Y', the focus will not be saved during ppr and the focus handling is left to browser. Currently, tabbing out of a PPR enabled field in Mozilla 401
  • 402. Oracle Application Framework Developer's Guide takes the focus to next focusable item but in Internet Explorer (IE) it remains in the same field. The default for this profile option is 'N'. PPR Debugging The PPR Debugging feature is used to see the changes in the partial targets. By default, the PPR Debugging is disabled. This feature can be enabled by setting the value of the profile option FND_ENABLE_PPR_DEBUGGING to Y. (See the PPR section of the Profile Options document for more information about this option). When the PPR debugging feature is enabled, the partial targets are displayed at the top of the screen as the page renders. Known Issues • None Personalization Considerations • None Component-Based Function Security You can also configure item properties using function security and the same SPEL syntax that you use to bind item properties to the "application properties" view object. Read Implementing Partial Page Rendering Events before reading this section. Currently, you can control the following item properties using this approach: • Rendered • Read Only • Disabled • Required Note: This section does not describe how to create menus, functions, or grants; it assumes you know what they are and how to create them. For additional information about these topics, see Tabs / Navigation and Page Security. Step 1: Create a function with a name that describes the rule you want to implement. For example, you have a text field whose Read Only property should be True if the user does not have access to the SUPPLIER_READ_ONLY function when logged in using the BUYER responsibility. Step 2: Create a grant for this function. In this example, we would create a function grant for SUPPLIER_READ_ONLY in the context of the responsibility BUYER. Step 3: Create the items whose Read Only property should be set based on the state of this security grant. Set the Read Only property using the following SPEL syntax: ${oa.FunctionSecurity.<FunctionName>} 402
  • 403. Oracle Application Framework Developer's Guide, Release 12.1.3 The test will return False if <FunctionName> is granted to the current user/responsibility; otherwise True. In this example, we would set the Read Only property to: ${oa.FunctionSecurity.SUPPLIER_READ_ONLY} If the user is logged in to the BUYER responsibility and has been granted access to this function, OA Framework returns False in the function security test. When the Read Only property is set to False, the item is updateable. Expressions and Test Results The following table summarizes the properties you can set and the corresponding results that OA Framework sets as the property's value. Propert Property Internal Expression Test Result y Name Rendere RENDERED_ATT ${oa.FunctionSecurity.<myFunctionNa Returns True if d R me>} <myFunctionNam e> is granted, otherwise False. Read READ_ONLY_AT ${oa.FunctionSecurity.<myFunctionNa Returns False if Only TR me>} <myFunctionNam e> is granted, otherwise True. Disabled DISABLED_ATTR ${oa.FunctionSecurity.<myFunctionNa Returns False if me>} <myFunctionNam e> is granted, otherwise True. Require REQUIRED_ATT ${oa.FunctionSecurity.<myFunctionNa Returns no if d R me>} <myFunctionNam e> is granted, otherwise yes. * * To set one of the other two Required property values (uiOnly or validatorOnly), you must configure the Required property to bind to a String attribute in the application properties VO, and in this attribute's getter, call function security and return the desired property based on the security test result. Table Content Switchers Unlike an Application or Context Switcher, which is a UI control that allows a user to switch the application or page context to display, a table content Switcher is a region with two or more display alternatives. The display alternatives are predefined items of which only one is selectively rendered at any given time. 403
  • 404. Oracle Application Framework Developer's Guide If your table column is a Switcher, then you can: • Assign a header label for the column by setting the OA Extension Prompt property for each Switcher nested region item. • Enable sorting for the item by setting the OA Extension Initial Sort Sequence property for each Switcher nested region item. OA Framework determines the view attribute to sort by using the following list, in order of precedence: 1. Sort By View Attribute of the Switcher nested region item. 2. Sort By View Attribute of the selected child region item, that is, the named child of the switcher that is selected by the decode SELECT statement. 3. View Attribute of the selected child region item. Note: Do not use the View Attribute of the Switcher Nested Region item for sorting because it simply determines which named child is selected. Switcher Usage Limit the use of Switchers to within tables, advanced tables, or HGrids, particularly when you want to switch between different kinds of web beans, such as a poplist or a checkbox, or when you want to switch between different images. Although you can technically use a Switcher (OASwitcherBean) outside a table, instead use SPEL binding for the Rendered property of the content that you want to conditionally display. The image switching case is demonstrated in the ToolBox Tutorial Delete Lab. The tutorial example creates an employee table that contains a Delete column. The Delete column allows you to delete employees from the table, depending on the status of the employee - if the employee is active, the Delete icon is enabled, otherwise it is disabled. However, to meet accessibility standards, ALT text is associated with the enabled icon as well as the disabled icon. At runtime, to be able to display the enabled Delete icon, with its ALT text, or the disabled Delete icon with its appropriate ALT text, the tutorial uses the convenience of a table content Switcher to switch between the two distinct sets of attribute values for the same web bean type. Using bound values instead of a Switcher in this case, would bind the image source of the Delete icon to a view object attribute to get the image file name, and bind the ALT text to another view object attribute to get the ALT text for the image. You can implement a Switcher declaratively by defining two or more items representing your display alternatives and adding these to a Switcher region within your parent table. When exportByViewAttr is set on a switcher level, instead of depending on the datatype of the component rendered, OA Framework exports the value based on the sqldatatype (database). For example, the datatype of a component can be either DATE or DATETIME. If the datatype is DATE, only the date is exported and if the datatype is DATETIME, both the date and the time are exported. However, when basing values on the database, the sqldatatype can be either DATE or TIMESTAMP and both contain date and timestamps, (such as DD-MM-YYYY hh:mm:ss). In either case, both the date and the time are exported. Declarative Implementation 404
  • 405. Oracle Application Framework Developer's Guide, Release 12.1.3 Step 1: To add a Switcher to a table region, update the SQL query for the table region's view object to include a "Switcher" column or attribute. The Switcher attribute must return the name of the conditionally displayed item or region to render. Remember that a Switcher region can contain two or more nested region items as display alternatives. You can add this "Switcher" attribute to your view object by including a DECODE statement in your SELECT statement. The DECODE statement determines which child item name to return. For example, in the ToolBox Tutorial Delete Lab, a Delete column is added to a results table in the Employee search page. The Delete column is a Switcher region that can either display the enabled Delete icon and its ALT text or the disabled Delete icon and its ALT text. The underlying EmployeeSummaryVO query includes the following DECODE statement to determine whether the employee can be deleted based on the employee's status: decode(nvl(to_char(EmployeeEO.END_DATE), 'N'), 'N','DeleteDisabled', 'DeleteEnabled') AS DELETE_SWITCHER Step 2: Create a Switcher region, by right-clicking your table region in the Structure pane and selecting New > switcher from the context menu. Select the Switcher region and update the following properties in the Property Inspector with these values: • ID - <the name of the Switcher region>. Set in accordance with the OA Framework File naming standards • Item Style - switcher • Prompt - <the label that appears in the table column> • Rendered - True • View Instance - <name of the underlying the view instance> • View Attribute - <name of the "Switcher" attribute that you added to the view object in Step 1> Step 3: Right-click the default Switcher case that JDeveloper created for you and select New > Item or New > Region from the context menu. • Select the item/region and update the ID property with the OA Framework File Standards. Note: The ID must match the corresponding SQL DECODE function return value that determines when this item or region should be displayed. For example, if you are creating a Switcher for the ToolBox SQL snippet shown above, the image item that you define for the disabled Delete icon will have its ID set to DeleteDisabled. • Configure other properties as needed for your item or region. Step 4: Add additional cases to represent display alternative for the Switcher region. Right-click the Switcher region in the Structure pane and select New > case from the context menu. Configure your item or region as described in Step 3, and repeat as necessary until all display alternatives are defined. 405
  • 406. Oracle Application Framework Developer's Guide Step 5: (Required only if you add images to a Switcher in a classic table) You must manually center align the images as shown in the code example below: import oracle.cabo.ui.data.DictionaryData; import oracle.cabo.ui.data.DataObjectList; import oracle.apps.fnd.framework.webui.beans.table.OATableBean; ... public void processRequest(OAPageContext pageContext, OAWebBean webBean) { // Always call this first. super.processRequest(pageContext, webBean); // This controller is associated with the table. OATableBean table = (OATableBean)webBean; // We need to format the Switcher image column so the image is centered // (this isn't done automatically for Switchers as it is for // plain image columns). We start by getting the table's // column formats. // NOTE!!! You must call the prepareForRendering() method on the table *before* // formatting columns. Furthermore, this call must be sequenced *after* the 406
  • 407. Oracle Application Framework Developer's Guide, Release 12.1.3 // table is queried, and *after* you do any control bar manipulation. // We need to get a handle to the table so we can set it's width to 100%. table.prepareForRendering(pageContext); DataObjectList columnFormats = table.getColumnFormats(); DictionaryData columnFormat = null; int childIndex = pageContext.findChildIndex(table, "DeleteSwitcher"); columnFormat =(DictionaryData)columnFormats.getItem(childIndex); columnFormat.put(COLUMN_DATA_FORMAT_KEY, ICON_BUTTON_FORMAT); } Runtime Control There are no programmatic steps necessary to implement a Switcher region. However, if you wish to set a default case for a Switcher region, you can do so programmatically by calling the following oracle.cabo.ui.beans.SwitcherBean API: public static void setDefaultCase(MutableUINode bean, java.lang.String defaultCase) Usage Notes • If the view object associated with a switcher returns a value for a case that does not match any of the existing cases, then: o If a default case is defined, the default case renders. See the Runtime Control section for more information. o If a default case is not defined, a developer mode error is thrown. • For a table or HGrid web bean, you can display a named child under a switcher. However, if the switcher's view attribute returns a value that does not match the named child's name, nothing renders (that is, the switcher region is blank). You can use this behavior to your advantage, such that you do not need to define any additional spacer bean if you purposely do not want anything to display for a case. 407
  • 408. Oracle Application Framework Developer's Guide • If ExportByViewAttr is set on the switcher level, the datatype of the exported value will depend on the sqldatatype and not the datatype of the component rendered. Personalization Considerations • See a summary of Dynamic User Interface personalization considerations in the Oracle Application Framework Personalization Guide. Related Information • BLAF UI Guidelines o Partial Page Rendering (PPR) [ OTN Version ] o Master / Detail Page Template [ OTN Version ] • Javadoc Files o oracle.cabo.ui.beans.SwitcherBean o oracle.apps.fnd.framework.webui.beans.OASwitcherBean • OA Framework Developer's Guide o OA Framework State Persistence Model (Passivation) o OA Framework File Standards o Classic Tables o Advanced Tables o Tabs / Navigation • OA Framework ToolBox Tutorial / Sample Library o ToolBox Tutorial Partial Page Rendering (PPR) Lab o ToolBox Tutorial Delete Lab (table switcher) o oracle/apps/fnd/framework/toolbox/sampleLib/webui/PartialPa geExamplePG.xml o oracle/apps/fnd/framework/toolbox/sampleLib/webui/PartialPa geExampleCO.java o oracle/apps/fnd/framework/toolbox/sampleLib/server/SampleBr owserAMImp.java o oracle/apps/fnd/framework/toolbox/sampleLib/server/SampleBr owserPVO.xml 408
  • 409. Oracle Application Framework Developer's Guide, Release 12.1.3 Concurrent Processing: Request Submission and Monitoring Overview The Concurrent Processing Request Submission and Monitoring user interfaces are available as OA Framework-based pages. The Request Submission flow includes multiple pages that steps the user through submitting a specific program or allowed programs (based on their responsibility) to run. The Request Monitoring (Viewing) flow includes pages that allow users to search for and view their concurrent requests. Oracle Application Object Library provides a seeded menu that contains the standard functions for Request Submission and Monitoring. The internal name for this menu is FND_REQUESTS (user menu name is "Requests"), and contains the standard seeded functions FNDCPSRSSSWA and FNDCPVIEWREQUEST. You can add this menu to your application if you want to utilize these functions. Alternatively, as this document describes, you can create your own functions to launch Request Submission and Monitoring from your application. Note: This document assumes you are familiar with the Concurrent Processing feature. Refer to the Oracle E-Business Suite User's Guide or Oracle E-Business Suite System Administrator's Guide if you need further information. Contents • Adding Request Submission to Your Product o Declarative Implementation  Configuring Request Submission with Optional URL Parameters • Adding Request Monitoring to Your Product o Declarative Implementation  Configuring Request Monitoring with Optional URL Parameters o Runtime Control • Personalization Considerations • Known Issues • Related Information Adding Request Submission to Your Product The Standard Concurrent Request Submission flow takes place across the following six pages with a train implementation: • Program Name - allows the user to select the program to submit. It contains a required field called Program Name. • Parameters - if the program has required parameters, this page is displayed, otherwise, it is skipped. • Schedule - allows the user to schedule when the program runs. It contains the default scheduling of "As Soon As Possible". 409
  • 410. Oracle Application Framework Developer's Guide • Notifications - allows the user to optionally send notifications to designated users when the request completes. • Printer - allows the user to optionally specify printing options with the configured request. • Summary - displays a summary of submitted requests. With Oracle E-Business Suite, you can restrict some of the train steps that a user must navigate through to submit a concurrent request. You can configure request submission within your application such that some of the information required for a request is pre-entered. End-users need only enter a limited amount of data specific to a current request. As a result, you can hide some of the pages described above from the end-user, because they are no longer necessary. Declarative Implementation To call the first page of Request Submission from your application, registering your function in the Form Functions form with the following URL parameters in the HTML Call field: akRegionCode=FNDCPPROGRAMPAGE akRegionApplicationId=0 Note: The FND seeded function name that contains these parameters is FNDCPSRSSSWA. Configuring Request Submission with Optional URL Parameters If you wish to restrict some of the pages in the Request Submission flow, you can do so by specifying the following parameters in the URL that you specify in the HTML Call field of the Form Functions form: • requestURL = <URL value> URL Value is the page to which you want the user to be redirected to when the user selects Cancel or when the request is submitted. If this parameter is not specified, the user is redirected to the View Requests page. • programApplName =<program application short name>& programName=<program short name> Use these parameters to allow your users to submit a specific program from your application without having to enter a program name. If these parameters are specified by the calling application, the Request Submission Program Name page will render without the Program Name LOV. The Program Name field will instead display as a text-only item showing the program specified. • programDesc=<program description> 410
  • 411. Oracle Application Framework Developer's Guide, Release 12.1.3 Use this parameter to provide a description to your request. The description appears as Request Name on the Request Submission Program Name page. You can later search for requests based on the supplied request name (description). • programRegion=Hide Use this parameter to hide the Program Name page during request submission. Note that if you specify this parameter, you must also indicate the program name to submit by coding the calling application to provide the programApplName and programName parameters. • parameterRegion=Hide If the program you are configuring to submit does not require any parameters, you can specify this parameter with the value 'Hide'. This parameter hides the Parameters page during request submission. • scheduleRegion=Hide If you do not want to allow users the option of scheduling the request submission, specify this parameter with the value 'Hide' to hide the Schedule page. By default, if the Schedule page is hidden, the request is submitted with the schedule, "As Soon As Possible". • notifyRegion=Hide Specify this parameter with the value 'Hide' to hide the Notification page during request submission. • printRegion=Hide Specify this parameter with the value 'Hide' to hide the Printer page during request submission. • pageTitle=<page title> Specify this parameter to set the page title for the Request Submission flow. Examples 1. To launch the full Request Submission flow: HashMap parameters = new HashMap(); String url = "OA.jsp"; parameters.put("akRegionApplicationId", "0"); parameters.put("akRegionCode", "FNDCPPROGRAMPAGE"); 411
  • 412. Oracle Application Framework Developer's Guide 2. To launch the Request Submission flow specifically for the Active Users program (program short name=FNDSCURS): HashMap parameters = new HashMap(); String url = "OA.jsp"; parameters.put("akRegionApplicationId", "0"); parameters.put("programApplName", "FND"); parameters.put("programName", "FNDSCURS"); parameters.put("programDesc", "Some Description"); 3. To launch the Request Submission flow specifically for the Active Users program (FNDSCURS), such that the program is submitted with default values only (that is, you do not want the user to provide any information in the request submission): HashMap parameters = new HashMap(); String url = "OA.jsp"; parameters.put("akRegionApplicationId", "0"); parameters.put("akRegionCode", "FNDCPPROGRAMPAGE"); parameters.put("programApplName", "FND"); parameters.put("programName", "FNDSCURS"); parameters.put("programDesc", "Some Description"); parameters.put("programRegion", "Hide"); parameters.put("parameterRegion", "Hide"); parameters.put("scheduleRegion", "Hide"); parameters.put("notifyRegion", "Hide"); parameters.put("printRegion", "Hide"); parameters.put("requestMode", "DEFERRED"); parameters.put("requestId", <req id>); if (pageContext.getParameter("uploadCat") != null) { try { // get the JDBC connection Connection conn = (Connection) ((RequestAMImpl)pageContext. getApplicationModule(webBean)).getDBConnection(); ConcurrentRequest cr = new ConcurrentRequest(); 412
  • 413. Oracle Application Framework Developer's Guide, Release 12.1.3 // set it as deferred request mode. cr.setDeferred(); // call submit request int reqId = cr.submitRequest(progAppl, progName, desc, scRSTime, false, para); dbTran.commit(); // redirect page to Request Scheduling page com.sun.java.util.collections.HashMap parameters = new HashMap(); String url = "OA.jsp"; parameters.put("akRegionApplicationId", "0"); parameters.put("akRegionCode", "FNDCPPROGRAMPAGE"); String id = "" + requestId + ""; parameters.put("requestMode", "DEFERRED"); parameters.put("requestId", id); pageContext.setForwardURL(url, null, OAWebBeanConstants.KEEP_MENU_CONTEXT, null, parameters, true, OAWebBeanConstants.ADD_BREAD_CRUMB_NO, OAWebBeanConstants.IGNORE_MESSAGES); } catch { ...} } 413
  • 414. Oracle Application Framework Developer's Guide Adding Request Monitoring to Your Product The Request Monitoring user interface provides the ability to search for a current user's requests based on three categories: all requests, completed requests and running requests. It also allows a user to specify criteria to search for a request based on a specific request ID, requests for a specific program or a range of scheduled requests. Using the search results list, a user can select a request to see the details of that request or view its output file. From the Details page for a request, a user can place a hold on a pending request, cancel a pending request or view the request's log file. Declarative Implementation To call the first page of Request Monitoring from your application, registering your function in the Form Functions form with the following URL parameters in the HTML Call field: akRegionCode=FNDCPREQUESTVIEWPAGE akRegionApplicationId=0 Note: The FND seeded function name that contains these parameters is FNDCPVIEWREQUEST. Example To launch the View Requests page: OA.jsp?akRegionCode=FNDCPREQUESTVIEWREGION&akRegionApplicationId=0 Configuring Request Monitoring with Optional URL Parameters If you wish to restrict some of the pages in the Request Monitoring flow, you can do so by specifying the following parameters in the URL that you specify in the HTML Call field of the Form Functions form: • printRegion = Hide Specify this parameter with the value 'Hide' to hide the Print region in the Request Details page, so that users do not see the print information for a request. • requestID =<request id> Specify this parameter, to search for a specific request based on the supplied request id. • requestDesc =<request description> 414
  • 415. Oracle Application Framework Developer's Guide, Release 12.1.3 Specify this parameter, to search for request(s) based on the supplied request description. • startDate =<startdate> Specify this parameter, to search for request(s) based on the supplied startdate. • endDate =<enddate> Specify this parameter, to search for request(s) based on the supplied enddate. • progApplShortName =<program application short name>&progShortName=<program short name> Use these parameters to search for requests for a specific program. Runtime Control There are no runtime control steps necessary to add request monitoring to your product. Personalization Considerations • See a summary of Concurrent Processing personalization considerations in the Oracle Application Framework Personalization Guide. Known Issues • None. Related Information • BLAF UI Guideline(s) • Javadoc File(s) • Lesson(s) • Sample Code 415
  • 416. Oracle Application Framework Developer's Guide Content Containers Overview Per the Oracle Browser Look-and-Feel (BLAF) UI Guideline Content Containers in Page [ OTN Version ], content containers are regions with special graphical characteristics (border, shape and background color) that help set off the information they contain from the rest of the page. They are often used to hold related information or shortcuts as shown in Figure 1. Figure 1: Example of content containers used for related information and shortcuts. Implementation Content containers can be added to the side of the page in a dedicated column as shown in Figure 1 (so the page content renders beside them), or within the page content as just another region. The implementation instructions differ somewhat in each case. Within Page Content To add a content container to a region within your page contents: Step 1: In the JDeveloper structure pane, select the region to which you want to add your content container, right-click and select New > Region. Step 2: Specify an ID in accordance with the OA Framework Naming Standards and set the Region Style to contentContainer. 416
  • 417. Oracle Application Framework Developer's Guide, Release 12.1.3 Step 3: Set the Text property to the title that you want to display in the content container, and optionally set the Image URI to the name of the BLAF image you want to display (for example: bullseyeicon_cctitle.gif). Tip: See Images in Your Pages for information on using the BLAF icon repository. Step 4 (optional): By default, content containers render with a light background as shown above. If you want a different color scheme, set the Background Shade accordingly (valid options are presented in a list). Step 5: Set the Width to 100% to ensure that the content container renders fully within the space allowed. Step 6: Add regions and items to the contentContainer region as you normally would. For example, to create the Related Information and Shortcuts content containers shown in Figure 1, you would first add a bulletedList region to the contentContainer, and then add link items to the bulletedList. At runtime, the OA Framework instantiates an oracle.apps.fnd.framework.webui.beans.layout.OAContentContainerBean. Beside Page Content To add a content container to the side of your page: Step 1: Create a shared region for your content container (see the Shared Regions instructions in Implementing the View if you need help). Step 2: Configure your content container region as described above. Step 3: Instantiate your content container programmatically and add it to the page in the named "end" area as shown: public void processRequest(OAPageContext pageContext, OAWebBean webBean) { // Always call this first. super.processRequest(pageContext, webBean); 417
  • 418. Oracle Application Framework Developer's Guide // Instantiate the content container that you defined declaratively. OAContentContainerBean content = (OAContentContainerBean)createWebBean(pageContext, "/oracle/apps/fnd/framework/toolbox/samplelib/webui/ContentContainRN", null, // ignore item for regions true); // using OAExtension // Get the page layout bean, and specify the content container as the // end content. OAPageLayoutBean pageLayoutBean = pageContext.getPageLayoutBean(); pageLayoutBean.setEnd(content); } Note: For information about the "start" and "end" areas in a page (including ensuring that you have the correct amount of horizontal space between your primary page content and anything that you render in the start and end areas), see Page Layout (How to Place Content). Tip: If you want to add multiple content containers to the "end" area, see the Home Page example in the ToolBox Tutorial / Sample Library. Even though the content containers are fully constructed programmatically in the example, it will show you how to place them on a stack layout with vertical space between them. You would follow the same example even if you instantiated declaratively defined content containers as shown above. Personalization Considerations • None Known Issues 418
  • 419. Oracle Application Framework Developer's Guide, Release 12.1.3 • None Related Information • BLAF UI Guidelines o Content Containers in a Page [ OTN Version ] • Javadoc o oracle.apps.fnd.framework.webui.beans.layout.OAContentConta inerBean • Developer's Guide o Bulleted List o Related Links / Shortcuts o Images in Your Pages o Page Layout (How to Place Content) • OA Framework ToolBox Tutorial / Sample Library o Home Page Lab o oracle.apps.fnd.framework.toolbox.samplelib.webui.BasicStru ctPG.xml o oracle.apps.fnd.framework.toolbox.tutorial.webui.HomePageCO .java 419
  • 420. Oracle Application Framework Developer's Guide Contextual Information Overview In a multipage task flow, it is often helpful to remind users of selection(s) made in previous pages by displaying static, contextual information at the top of the page. As described in the Oracle Browser Look-and-Feel (BLAF) UI Guideline: Contextual Information [ OTN Version ] this standard layout appears as follows: Figure 1: Double Column Layout Contextual Information Example Note that, if page-level action/navigation buttons are present, the contextual information should render in parallel with the top-level buttons (not below them). Furthermore, if page-level instruction text and/or keys are also present, they should render below the blue separator line that indicates the end of the contextual information. Declarative Implementation To add a contextual information region to your page: Note: All package, region and item names must comply with the OA Framework Package / File / Directory standards. Step 1: Create your pageLayout region as you normally would; be sure to specify the Title property (represented by the "Page Title" text value in Figure 1). Step 2: Select your pageLayout region in the Structure pane, right-click and select New > pageStatus. • JDeveloper automatically creates a pageStatus node and adds a flowLayout default region beneath it. Change this region's Style to messageComponentLayout. Step 3: Set the messageComponentLayout region's Rows and Columns properties as described in the Page Layout (How to Place Content) document. • For example, for the double column layout shown in Figure 1 above, set both the Rows and Columns property values to 2. 420
  • 421. Oracle Application Framework Developer's Guide, Release 12.1.3 • If you want to display two items next to one another, set the Rows property value to 1 and the Columns property value to 2. Step 4: Add the items that you want to display in the appropriate sequence. For example, to achieve the layout shown in Figure 1 above, you would need to add the corresponding items as shown in Figure 2 below. Select the messageComponentLayout region, right-click and select New > messageStyledText. For each messageStyledText item: • Specify an Attribute Set in accordance with the attribute set usage guidelines (see Implementing the View for general information about attribute sets, and the OA Framework View Coding Standards). This should set the Prompt and Data Type values correctly; verify that they are correct. • Set the CSS Class to OraDataText (for display-only data that should render in bold). • Set the View Instance and View Attribute names for the underlying data source. Note that you can use a view object that you explicitly query when this page renders, or you might bind to a cached row if this page shares a retained application module with a previous page. Figure 2: Contextual Information Item Sequence for the Layout in Figure 1 Step 5: Select your pageLayout region again, right-click and select New > Item. Set this Item Style to separator. Step 6: Add remaining items and regions to the pageLayout region as needed for your design. Runtime Control There are no particular runtime actions associated with these standard components used in this particular context, however, remember to execute the underlying query in a processRequest() method if these fields bind to a task-specific view object (see Implementing the Model and Implementing the Controller for examples of this). Also see the Standard Web Widgets documentation for additional information about working with OAMessageStyledTextBeans, and Page Layout (How to Place Content) for information about using different layout components. 421
  • 422. Oracle Application Framework Developer's Guide Related Information • BLAF UI Guidelines: o Contextual Information [ OTN Version ] • Developer's Guide: o Separator o Standard Web Widgets o Page Layout (How to Place Content) • Javadoc o oracle.apps.fnd.framework.webui.beans.layout.OAMessageCompo nentLayoutBean o oracle.apps.fnd.framework.webui.beans.message.OAMessageStyl edTextBean • OA Framework ToolBox Tutorial / Sample Library o See the /oracle/apps/fnd/framework/toolbox/samplelib/webui/ContextI nfoPG in the SampleLibrary.jpr. 422
  • 423. Oracle Application Framework Developer's Guide, Release 12.1.3 Controlling UIX Rendering Output Overview This document describes how to control the look-and-feel and/or facet used to render to your pages. • A Look-and-Feel (LAF) controls the appearance of an OA Framework application. An LAF provides the rendering logic for each component along with a Look-and-Feel- specific style sheet. This means that the LAF controls both the content that is generated for each component and the visual properties (colors, fonts, borders, etc...) used to style the component. • You can also implement optimized variations of the LAF for a specific output medium by setting a facet. Facets typically modify the implementation of a small set of components, but in general share the bulk of the LAF's rendering code. For example, the printable version of a general browser page excludes superfluous navigation and personalization controls that would consume space and clutter the printed output. The printable version of a page is implemented as a facet. Contents • Controlling the Look-and-Feel • Controlling the Facet Controlling the Look-and-Feel The OA Framework supports three LAFs (note that the first two are standard UIX LAFs while the third is provided exclusively in the OA Framework): • Oracle BLAF -- implements the Oracle Browser Look-and-Feel (BLAF) UI Guidelines. • Minimum LAF (MLAF) -- generates "minimal" content to reduce the size of HTML pages and overall network overhead (for example, this LAF uses fewer images than the BLAF version) • Plain Text -- produces a plain text version of the page (typically used to send a plain text version of a page to an e-mail client). Note that the plain text LAF does not support all the existing component styles. Note: In the text rendering mode, the content will be displayed in 'Table Style Layout' if the table width is less than page width (the maximum number of characters it can fit) else it will be displayed in 'Form Style Layout'. The page width in text rendering mode is 80 ,as scrolling and user interaction is not allowed in this mode. The Look-and-Feel of Oracle E-Business Suite application pages is controlled by the Oracle E- Business Suite Look and Feel profile option. By setting this centrally, customers can choose which seeded LAF is most appropriate for their uses cases, and they can quickly adopt a new, 423
  • 424. Oracle Application Framework Developer's Guide custom LAF. To create a custom LAF or modify an existing custom LAF, use the Customizing Look and Feel UI. If you need to control the LAF of a single page, you may do so by setting the LafConstants.OA_RENDER_LAF (or "OALAF") request parameter using one of the following values as shown in the example below (note that the OA Framework simply ignores any invalid values for this and defers in this case to the profile option value, or the default if no profile option value is specified). Note: The LafConstants class is in the oracle.apps.fnd.framework.webui.laf package. Constant Constant Description Value LafConstants.LAF_BLAF blaf Enables Oracle BLAF rendering. Note: This is the default LAF. LafConstants.LAF_MLAF minimal Enables minimal LAF rendering. LafConstants.LAF_TEXT oaText Enables plain text rendering. The plain text renderer should be used primarily to generate context suitable for e-mailing to a plain text e- mail client. As such, it supports only a very small subset of the available UI regions and items. These are: • flowLayout • column • header (and all the default* header styles) • labeledFieldLayout • messageStyledText • pageLayout • separator • stackLayout • staticStyledText • table Note: Any unsupported UI components on the page will not be rendered, however, warnings will be registered in the log. Example This example illustrates how to set the minimal look-and-feel when defining a function's Web HTML Call. 424
  • 425. Oracle Application Framework Developer's Guide, Release 12.1.3 OA.jsp?page=/oracle/apps/fnd/framework/toolbox/webui/HelloWorldPG&OALA F=minimal Controlling the Facet UIX (and the OA Framework) supports the following four facets for the HTML LAFs (when you use the plain text LAF, facets do not apply and are ignored if set). • Default - renders HTML designed for a general purpose browser. • Email - renders HTML suitable for a HTML-capable email client (it makes changes like deactivating JavaScript and inlining CSS styles as much as possible). • Portlet - optimizes the imports of CSS style sheets and (where possible) Javascript libraries to improve performance when multiple portlets try to load the same style sheets and libraries in a single portal page. • Printable - optimizes content for printing. To enable these facets, set the LafConstants.OA_RENDER_FACET (or "OARF") to one of the following values as shown in the example below. The OA Framework ignores any invalid values for this parameter and uses the default facet for HTML LAFs. Note: The LafConstants class is in the oracle.apps.fnd.framework.webui.laf package. Constant Constant Description Value LafConstants.FACET_DEFAULT default The default facet. Note: This is the default facet that is applied if no parameter value is specified, and the LAF renders HTML. LafConstants.FACET_EMAIL email The email facet. Use this facet if you want to send HTML email (for example, the Oracle Workflow Mailer uses this facet for notifications). LafConstants.FACET_PORTLET portlet The portlet facet. Warning: Do not use this facet. The OA Framework Web Portlet Provider will enable this facet for all OA Framework- based portlets. 425
  • 426. Oracle Application Framework Developer's Guide LafConstants.FACET_PRINTABLE printable The printable facet. Set this parameter to identify a printable page. Note: The earlier approach of naming a "Printable Page" button "IcxPrintablePageButton" is still supported, but setting the facet is the preferred approach. Example See the Printable Page document for a complete example. 426
  • 427. Oracle Application Framework Developer's Guide, Release 12.1.3 Custom HTML Overview In general, you should avoid using custom HTML and design pages using OA Framework components if you can, as they meet the NLS, accessibility, security, and Oracle Browser Look- and-Feel (BLAF) UI guidelines and standards. If you need to write custom HTML, UIX provides two alternatives that you should use instead of the OARawText bean: • oracle.apps.fnd.framework.webui.beans.OAHTMLWebBean - helps you create HTML tags to output text. Although HTMLWebBean creates only one tag, and you would have to create a hierarchy of OAHTMLWebBeans to duplicate the HTML achievable with oracle.apps.fnd.framework.webui.beans.OARawTextBean, OAHTMLWebBean does provide the following added features: o Automatic escaping o Pretty printing o XHTML syntax support o Debugging assistance • oracle.apps.fnd.framework.webui.beans.OAFormattedTextBean - helps you format text using the generic HTML formatting tags. Note that OAFormattedTextBean intentionally cannot accomplish everything that OARawTextBean does because it is designed to block cross-site scripting attacks and to provide only tags for formatting (and links). For Oracle's in-house E-Business Suite developers who have to use the RawText bean, you must get approval from the Oracle BLAF UI team to ensure that your implementation meets UI standards. Your use of the RawText web bean must also conform to the accessibility, NLS, and Oracle Application security guidelines. Displaying PDF Content Inline on Pages Tip: If you need to display some pdf content that's generated dynamically, we generally recommend that you use OAMessageDownloadBean instead of displaying the pdf content inline on a page. The following sample code, which you should add to your Controller, shows how to display pdf content inline on a page using OAHTMLWebBean. Note: You need to cache the generated pdf content in the session in advance. In DisplayPdf.jsp, retrieve the pdf content from the session, stream it out to the response, and then remove the cached pdf content from the session. OAHTMLWebBean pdfElement = 427
  • 428. Oracle Application Framework Developer's Guide (OAHTMLWebBean)createWebBean(pageContext, HTML_WEB_BEAN, null, "IFRAME"); //use IFRAME or EMBED pdfElement.setHTMLAttributeValue("src", "/OA_HTML/DisplayPdf.jsp"); //pdfBlob // p_output pdfElement.setHTMLAttributeValue("width", "100%"); pdfElement.setHTMLAttributeValue("height", "500"); Using HTML Tags in Messages You can insert HTML tags in messages displayed in a message box, inline tip, and dialog page, and in messages associated with tip region items (oracle.apps.fnd.framework.webui.beans.OATipBean). You can also create your own styled text region item with HTML tags in the message text using the formattedText region item style (oracle.apps.fnd.framework.webui.beans.OAFormattedTextBean). Internally, all these messages utilize the UIX oracle.cabo.ui.beans.FormattedTextBean to incorporate the HTML tags. To see which HTML tags are allowed in FormattedTextBean, refer to the UIX FormattedTextBean Javadoc. Some notes regarding the FormattedTextBean: • The FormattedTextBean also allows HTML links through the "<a href ...>" HTML tag. Note: If the HTML link references an OA Framework page, you need to first process its URL to retain the session values associated with the current transaction so that breadcrumbs can be retained. For example: String Url = "OA.jsp?.."; OAUrl url = new OAUrl(Url); Url = OAUrl.createURL(renderingContext); 428
  • 429. Oracle Application Framework Developer's Guide, Release 12.1.3 MessageToken [] tokens = {new MessageToken("TOKEN_NAME", Url)}; formattedTextBean.setText(pageContext.getMessage("FND", msgName, tokens ); • For messages in a message box, inline tip, and dialog page, and for messages associated with tip region items, UIX takes care of rendering the message text with the proper CSS style. However, if you create a formattedText region item yourself, you also need to specify the CSS style yourself. You can do so declaratively by setting the CSS Class property in OA Extension or programmatically through the OAFormattedTextBean setCSSClass method. For Messages in a Message Box or Inline Tip: When you seed your message in the FND_NEW_MESSAGES table, enclose your text in <html>...</html>. Example: <html>User authentication failed.<br>Cause: Invalid password.</html> Note The inline messages that appear in a rendered table do not reflect HTML tags properly. Also inline messages displayed in the Netscape browser do not reflect bold text properly. According to the UIX team, these are known limitations coming from the browser and operating system. UIX is generating the correct HTML syntax in the html output. For Messages in a Dialog Page: Seed your message in the FND_NEW_MESSAGES table with <html>...</html> to enable HTML tags in the dialog page message. The dialog page uses OAFormattedTextBean for the description and instruction messages to enable HTML tags as long as the message text is enclosed in <html>...</html>. The description message still appears in bold text and the instruction message still appears in plain text even when HTML tags are enabled. To have better control over what appears as bold, you can set a null value for the description message and just use the instruction message. Note The OAFormattedTextBean text itself does not require <html></html> enclosing tags, but the HTML-enabled messages in the message box and dialog page do. UIX automatically drops the extra <html></html> upon rendering the formatted text. Personalization Considerations • See a summary of Custom HTML personalization considerations in the Oracle Application Framework Personalization Guide. 429
  • 430. Oracle Application Framework Developer's Guide Known Issues • None Related Information • BLAF UI Guidelines • Javadoc o oracle.apps.fnd.framework.webui.beans.OARawTextBean o oracle.apps.fnd.framework.webui.beans.OAHTMLWebBean o oracle.apps.fnd.framework.webui.beans.OAFormattedTextBean 430
  • 431. Oracle Application Framework Developer's Guide, Release 12.1.3 Daily Business Intelligence / OA Framework Integration Overview OA Framework and Daily Business Intelligence (DBI) provide support for integration with OA Framework-based pages. Launching DBI Dashboards from OA Framework Pages To launch a DBI Dashboard from OA Framework, parameters must be passed from the OA Framework-based page to the DBI Dashboard. The instructions in this section describe how to invoke the DBI Dashboard and map the OA Framework parameters to a corresponding dimension and dimension level that DBI can interpret. Declarative Implementation Create a link in your OA Framework-based page that a user can select to invoke a DBI Dashboard. Refer to the Buttons (Links) topic in Chapter 4 for information on how to implement the link. Runtime Control Step 1: Programmatically update the controller class of the calling OA Framework-based transaction page to call the DBI Dashboard. Invoke bisviewp.jsp from the link, with the following parameters: • pFunction - fnd_form_function.function_name of the PMV function that you are invoking. The available DBI dashboard functions are listed below. • pPreFunction - fnd_form_function.function_name of the OA Framework page. • dbc - the dbc file name required by bisviewp to validate the context. The following sample code illustrates how the controller of an OA Framework-based page is updated to invoke a DBI Dashboard: processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OAApplicationModule am = pageContext.getApplicationModule(webBean); StringBuffer link = new StringBuffer(50); 431
  • 432. Oracle Application Framework Developer's Guide // Please contact your DBI counterpart for details // of a specific DBI dashboard function. // To invoke DBI Dashboards, you must pass the following parameters to // bisviewp.jsp (the jsp to call): // pFunction - fnd_form_function.function_name of the DBI Dashboard function // that you are invoking. // pPreFunction - fnd_form_function.function_name of the OA Framework // page from which you are calling the DBI Dashboard. // dbc - bisviewp validates the context and this requires the dbc // file name to be sent. Link.append("bisviewp.jsp?dbc=").append(am.getDbc)". append("pFunction=<DBI Dashboard function> &pPreFunction=<Current Page Function>"); OALinkBean dbiLink =(OALinkBean)createWebBean(pageContext, OAWebBeanConstants.LINK_BEAN, null, "dbiLink"); dbiLink.setDestination(link.toString()); // Retrieve and set the translated link text. String linkText = pageContext.getMessage("ISC", "ISC_FULFILLMENT", null); dbiLink.setText(linkText); } Step 2: Map the parameters from the OA Framework function that is calling the DBI Dashboard to a dimension and dimension level that DBI can understand. You can create the mappings by inserting new rows into the BIS_PARAM_DIMENSION_MAP table. The table columns are as follows: 432
  • 433. Oracle Application Framework Developer's Guide, Release 12.1.3 • function_name - this is the fnd_form_function.function_name for the OA Framework function calling the DBI Dashboard. • param_name - this is the name of the parameter that is being mapped. • dimension_level - this is the bis_levels.short_name to which the parameter is being mapped. This provides the mapping to the dimension and dimension level. • Application_id - your product Application ID. For example, to create a mapping entry for the function BIS_TEST_FUNC1 whose parameter ATTR3 maps to the ORGANIZATION dimension, and the ORGANIZATION dimension level, you would insert a record into BIS_PARAM_DIMENSION_MAP as follows: INSERT INTO bis_param_dimension_map ( function_name, param_name, dimension_level, application_id ) VALUES ( 'BIS_TEST_FUNC1', 'ATTR3', 'ORGANIZATION', 191); DBI provides the file BISDIMAP.lct to seed and ship records in this table. Instructions to use this file are within the first few lines of the file itself. DBI Dashboard Functions The following table lists the DBI dashboard functions in DBI Release 7.0.1. FUNCTION_NAME USER_FUNCTION_NAME BIV_DBI_SERV_MGMT_PAGE Customer Support Management ENI_DBI_PMS_PAGE Product Management FII_EXP_MGMT_PAGE_P Expense Management FII_GL_PROFIT_AND_LOSS_PAGE Profit and Loss FII_PL_BY_MGR_PAGE Profit and Loss by Manager PJI_OPERATIONS_MGT_PAGE Projects Operations Management PJI_PROFITABILITY_MGT_PAGE Projects Profitability Management BIL_BI_SLSMGMT_L Sales Management BIL_BI_OPPTYMGMT_L Opportunity Management BIX_DBI_EMC_PAGE Email Center Management ASO_BI_QUOTE_PORTAL_MAIN Quote Management IBE_BI_STORE_MGMT_LINK Store Management IBE_BI_TOP_ACTIVITY Store Top Activity BIM_I_MKTG_TOP_LEADS Top Campaigns and Events by Won Opportunities Amount 433
  • 434. Oracle Application Framework Developer's Guide BIM_I_MKT_TOP_LEAD Top Campaigns and Events by Leads HRI_DBI_OA_LINE_MGR HR Management BIM_I_LEAD_MGMT Lead Management BIM_I_MKTG_MGMT Marketing Management ENI_DBI_PME_PAGE Product Management - Engineering ISC_DBI_CUST_FULF_MGMT_PAGE Customer Fulfillment Management ISC_DBI_SHIP_MGMT_PAGE Shipping Management ISC_DBI_PLAN_MGMT_PAGE Plan Management BIL_BI_FRCSTMGMT_L Sales Forecast Management OKI_DBI_SRM_PAGE Service Renewals Management FII_AP_PAY_MGT_OA_PAGE Payables Management FII_AP_PAY_STATUS_OA_PAGE Payables Status POA_DBI_CSP_OA_MGMT Commodity Spend Management POA_DBI_CS_OA_MGMT Commodity Supplier Management PJI_CAPITAL_COST_MGT_PAGE Capital Projects Cost Management POA_DBI_PM_OA_PAGE Procurement Management POA_DBI_P2P_OA_PAGE Procure-to-Pay Management PJI_CONTRACT_COST_MGT_PAGE Contract Projects Cost Management OPI_DBI_INV_MGMT_PAGE Inventory Management OPI_DBI_MFG_MGMT_PAGE Manufacturing Management OPI_DBI_PRD_CST_MGMT Product Cost Management OKI_DBI_SCM70_PAGE Service Contracts Management ISC_DBI_REV_BACKLOG_PAGE Product Revenue Bookings and Backlog BIX_PMV_AI_PAGE Inbound Telephony Management Personalization Considerations • None Known Issues • None Related Information • BLAF UI Guideline(s) • Javadoc File(s) 434
  • 435. Oracle Application Framework Developer's Guide, Release 12.1.3 • Lesson(s) • Sample Code 435
  • 436. Oracle Application Framework Developer's Guide Data Export Overview As described in the Oracle Browser Look-and-Feel (BLAF) UI Guideline: Export/Import Page Templates [OTN version], you can implement an Export button that exports data displayed in one or more regions of an OA Framework page to a file. Export saves the data to a .csv (comma separated values) file or a .txt (tab separated values) file that you can view in Microsoft Excel. When you select the Export button, Microsoft Windows opens a dialog box that lets you view the file either by opening it directly in Microsoft Excel, or by saving it to a designated directory to open later. The export file format and encoding is determined by these three profiles: • Export MIME type • FND: NATIVE CLIENT ENCODING • FND: Unicode in Export Note: The program that is launched while saving exported data is dependent on each user's PC's setting. To launch a .csv file in Microsoft Excel, the .csv file type needs to be mapped to open with Microsoft Excel. If you try to open a .csv file that is not mapped to any program, Microsoft Windows will ask you to choose a program with which to open the file. A user can easily determine the file to program mapping on their PC by first selecting a .csv file in Windows Explorer, and then choosing Properties from the right mouse button context menu for that file. In the General tab of the Properties window, Opens With: lists the program that can open the selected file. Only web beans that are rendered on the page are ever exported. If you export data from multiple regions in a page, each region appears in the export file in a tabular format, with a row of column names for that region, followed by rows of corresponding values. Note: Data Import functionality is currently not supported. Contents • Exporting Data From All Regions On A Page • Exporting Data From a Specific Region On A Page • Personalization Considerations • Known Issues • Related Information Exporting Data From All Regions On A Page Declarative Implementation You can declaratively enable data export for all regions in a page by creating a page-level Export button. Page-level action buttons, such as Export, render below both the page title and 436
  • 437. Oracle Application Framework Developer's Guide, Release 12.1.3 the page contents bottom line (the "ski"). If a page title is not specified for the pageLayout region, the Export button only renders below the page contents bottom line. For more information, see the Page-Level Buttons discussion in the topic for implementing Buttons (Action/Navigation). Step 1: Select your pageLayout region and create a region with the style pageButtonBar beneath it. Step 2: Add an item of item style exportButton to the pageButtonBar region to automatically expose an Export button on the page. If you have more than one button to add to the pageButtonBar, be sure to add all the buttons in ascending sequence as you want them to appear from left to right. When a user selects the Export button, OA Framework exports the data from all the rendered regions on that page to a .csv file. Step 3: Generally, when you export data from a page, OA Framework exports the data from the view object attribute associated with each item in each region. In some cases, when you do not want to export the data from the view attribute associated with an item, you can specify a different view attribute to export from, by setting the Export View Attribute property for that item. If you don't set or set the Export View Attribute property to null, OA Framework exports data from the view attribute name associated with the item. An example of using the Export View Attribute is when you have a composite column in a table. You may have a composite column that consist of a flowLayout region that displays an image and some text. If you do not want to export the image file name from the composite column, you can set the Export Attribute Name property for that image item to some other view attribute from which you want to export data. Note: When exporting data from a table or advanced table, the data exported may be different from the data that is displayed in the leaf item of the table column. This may occur if the leaf item's Export View Attribute property is declaratively set to a different view attribute than the attribute whose data is displayed. Note: OA Framework provides limited support for exporting data from a switcher column under a table or advanced table. If the direct named children of the switcher web bean are leaf nodes that contain data, then OA Framework can export the data from the appropriate leaf node. If, however, the direct named children under the switcher web bean are containers, you must use the Export View Attribute property and add a transient view attribute to your view object as described in the Runtime Control section in order to export the data from the appropriate child container. Attention: If you intend to support the Export feature on a Gantt chart or HGrid, you cannot use different viewAttributeNames at different levels in the hierarchy column. All levels of the hierarchy column (that is, all nodeDefs) should have the same viewAttributeName. This is analogous to the definition of all other columns of a HGrid or Gantt. This restriction does not apply if the Export feature is not being used. 437
  • 438. Oracle Application Framework Developer's Guide Note: When exporting data from a page, data from hidden fields (FormValue items) or from the undisplayed child of a switcher region, cannot be exported. Step 4: Set the Export All Rows property on the exportButton item to True to export all rows from a table's view object regardless of the view object's setMaxFetchSize value. If the Export All Rows property is set to False, the total number of rows that can be exported from a table is defined by its view object's setMaxFetchsize. The default value for this property is False for existing Export buttons and True for any new Export button. Runtime Control There are no general runtime control steps necessary to enable the export of data from a page. Exporting Data from a Switcher Column in a Table OA Framework can successfully export data from a switcher column in a table only if the direct named children of the switcher column are leaf nodes (nodes that consist of data). If the named children of the switcher column are container web beans (for example, flowLayout web bean), then you must also perform the following steps to export the data from the child container: Step 1: Create a transient view attribute in the view object used for the switcher region. For example, ExportSwitcherViewAttr in MyVO. Step 2: In Jdeveloper, set the Export View Attribute property on the switcher region to the transient view attribute you created in Step 1. Continuing with the example in Step 1, suppose you have a switcher column in a table that switches between containers child1 and child2 and you would like to export data from the CustomerName or CustomerID view attributes under these containers, respectively. The general XML structure would look similar to the following, with the Export View Attribute property set to ExportSwitcherViewAttr: - table region - switcher region (View Instance = "MyVO1", View Attribute Name = "SwitcherViewAttr", Export View Attribute ="ExportSwitcherViewAttr") - header region (case "child1") - messageStyledText item (View Instance = "MyVO1", View Attribute Name = "CustomerName") 438
  • 439. Oracle Application Framework Developer's Guide, Release 12.1.3 - flowLayout region (case "child2") - messageStyledText item (View Instance = "MyVO1", View Attribute Name = "CustomerId") - etc. Step 3: Add code in the getter of your view object row accessor to return the data from the leaf items of the switcher column's child containers, based on the value of the switcher view attribute. Following the example in Steps 1 and 2, you would add the following code in the getter of MyVORowImpl.java: public String getExportSwitcherViewAttr() { if ("child1".equals(getSwitcherViewAttr())) return getCustomerName(); else if ( "child2".equals(getSwitcherViewAttr()) ) return getCustomerId(); return null; } Exporting Data From a Specific Region On A Page Declarative Implementation To export data from a specific region on a page: Step 1: Refer to the Oracle BLAF UI Guideline: Export/Import Page Templates [OTN version] for the placement of the Export button appropriate for the region for which you want to enable export. For example, if you are enabling export for a table region, the Export button should render as a right-justified global table button, above the table control bar, but beneath the table header. Step 2: In the OA Extension xml Structure pane, determine where you want to position the Export button for your region and create a new region item of item style exportButton. Step 3: Set the View Instance name for the exportButton region item to the same view object associated with the region for which you are enabling export. This ties the Export button to the correct data source. Attention: Make sure you do not associate the same view instance to multiple regions within the page that you want to export. If you do, you get a "NoDefException" if the region you try to export is an HGrid region. For all other region types within the page, data displayed across all the regions that share the same view instance will be exported rather than just the data displayed in the intended region for which the "Export" button is selected. To work around this issue, you can assign different view instances of the same view to the different regions of the page. 439
  • 440. Oracle Application Framework Developer's Guide Step 4: Generally, when you export data from a region, OA Framework exports the data from the view object attribute associated with each item in that region. In some cases, when you do not want to export the data from the view attribute associated with an item, you can specify a different view attribute to export from, by setting the Export View Attribute property for that item. If you don't set or set the Export View Attribute property to null, OA Framework exports data from the view attribute name associated with the item. Note: When exporting data from a table or advanced table, the data that is exported from the leaf item of the table column may be from a different view attribute than the data displayed. This occurs when the declarative definition of the table column's leaf item has a value specified for its Export View Attribute property. Note: OA Framework provides limited support for exporting data from a switcher column under a table or advanced table. If the direct named children of the switcher web bean are leaf nodes that contain data, then OA Framework can export the data from the appropriate leaf node. If, however, the direct named children under the switcher web bean are containers, you must use the Export View Attribute property and add a transient view attribute to your view object as described in the Runtime Control section in order to export the data from the appropriate child container. Attention: If you intend to support the Export feature on a Gantt chart or HGrid, you cannot use different viewAttributeNames at different levels in the hierarchy column. All levels of the hierarchy column (that is, all nodeDefs) should have the same viewAttributeName. This is analogous to the definition of all other columns of a HGrid or Gantt. This restriction does not apply if the Export feature is not being used. Note: When exporting data from a page, data from hidden fields (FormValue items) or from the undisplayed child of a switcher region, cannot be exported. Step 5: Set the Export All Rows property on the exportButton item to True to export all rows from a table's view object regardless of the view object's setMaxFetchSize value. If the Export All Rows property is set to False, the total number of rows that can be exported from a table is defined by its view object's setMaxFetchsize. The default value for this property is False for existing Export buttons and True for any new Export button. Runtime Control In the general case, there are no runtime control steps necessary to enable the export of data from a region. However, if you wish to export data from a Master/Detail region or a switcher column within a table, there are specific programmatic steps you need to consider. Exporting Data From Master/Detail Regions If you have a page that contains both a Master region and a corresponding Detail region and you want to export all the data from these two regions regardless of which Master row is selected, you must do so programmatically. There is no declarative support for this. 440
  • 441. Oracle Application Framework Developer's Guide, Release 12.1.3 First refer to the Coordinating Master/Detail Tables discussion for details on how to create such a region. Then add code, as shown in the following example, to the processRequest method of your controller: OAExportBean expBean = (OAExportBean)webBean.findChildRecursive("Export"); // set the exportDetails for this Master/Detail region. expBean.setExportDetails(oaPageContext,"masterRegionName", "detailRegionName", "masterVuName", " detailVuName"); Note: This type of Master/Detail export is supported only when you implement a region- level export and not a page-level export (where all the regions on a page are exported). Exporting Data from a Switcher Column in a Table OA Framework can successfully export data from a switcher column in a table only if the direct named children of the switcher column are leaf nodes (nodes that consist of data). If the named children of the switcher column are container web beans (for example, flowLayout web bean), then you must also perform the following steps to export the data from the child container: Step 1: Create a transient view attribute in the view object used for the switcher region. For example, ExportSwitcherViewAttr in MyVO. Step 2: In Jdeveloper, set the Export View Attribute property on the switcher region to the transient view attribute you created in Step 1. Continuing with the example in Step 1, suppose you have a switcher column in a table that switches between containers child1 and child2 and you would like to export data from the CustomerName or CustomerID view attributes under these containers, respectively. The general XML structure would look similar to the following, with the Export View Attribute property set to ExportSwitcherViewAttr: - table region - switcher region (View Instance = "MyVO1", View Attribute Name = "SwitcherViewAttr", Export View Attribute ="ExportSwitcherViewAttr") - header region (case "child1") - messageStyledText item 441
  • 442. Oracle Application Framework Developer's Guide (View Instance = "MyVO1", View Attribute Name = "CustomerName") - flowLayout region (case "child2") - messageStyledText item (View Instance = "MyVO1", View Attribute Name = "CustomerId") - etc. Step 3: Add code in the getter of your view object row accessor to return the data from the leaf items of the switcher column's child containers, based on the value of the switcher view attribute. Following the example in Steps 1 and 2, you would add the following code in the getter of MyVORowImpl.java: public String getExportSwitcherViewAttr() { if ("child1".equals(getSwitcherViewAttr())) return getCustomerName(); else if ( "child2".equals(getSwitcherViewAttr()) ) return getCustomerId(); return null; } Personalization Considerations There are no personalization restrictions. Known Issues • See a summary of key data export/import issues with suggested workarounds if available. Related Information • BLAF UI Guideline(s) o Export/Import Page Templates [OTN version] o Export/Import Flows [OTN version] • Javadoc File(s) o oracle.apps.fnd.framework.webui.beans.form.OAExportBean • Lesson(s) • Sample Code 442
  • 443. Oracle Application Framework Developer's Guide, Release 12.1.3 Date Picker Overview Users of Oracle E-Business Suite can enter a date for a date field by using a Date Picker. A Date Picker, as fully described in the Oracle Browser Look-and-Feel (BLAF) UI Guidelines: Date Picker [OTN version] is a feature that displays a graphical calendar from which a user can select a date to populate a date field on a page. The benefits of including a Date Picker in a page are that users can graphically select a date and visible restrictions of available dates can be enforced for specific application contexts. A Date Picker can be implemented inline, as shown in Figure 1 or in a secondary window, as shown in Figure 2. Figure 1: An example of a page with a date field and an Inline Date Picker. Figure 2: An example of a page with a date field and Date Picker icon. Selecting the Date Picker icon displays the Date Picker in a secondary window. Figure 3: Date Picker in a secondary window. 443
  • 444. Oracle Application Framework Developer's Guide Icon Access to Secondary Window OA Framework automatically renders a Date Picker icon when you define a date field in a page. Selecting the Date Picker icon next to the date field displays the Date Picker in a secondary window as shown in Figure 3. Note OA Framework only supports the month and year as separate pulldown lists in the Date Picker. Declarative Implementation To implement a Date Picker on your page so that it displays in a secondary window, simply create a messageTextInput item on your page and set its Data Type property to Date. Runtime Control Although there are no programmatic steps necessary to implement a Date Picker in a secondary window for a date field, if you wish to restrict the Date Picker to a range of dates, you must include the following code in the processRequest method of your controller: OAMessageDateFieldBean dateField = (OAMessageDateFieldBean) webBean.findIndexedChildRecursive("Date1"); dateField.setMinValue(minDate); dateField.setMaxValue(maxValue); Personalization Considerations • See a summary of Date Picker personalization considerations in the Oracle Application Framework Personalization Guide. 444
  • 445. Oracle Application Framework Developer's Guide, Release 12.1.3 Inline Datepicker When one or more date fields appear on a page, an Inline Date Picker can be associated with those date fields programmatically, allowing users to quickly select dates for those fields. An Inline Date Picker is displayed inline in the page contents. A user populates a date field by setting the focus on the desired date field and selecting a date from the Inline Date Picker. Note There should be ONLY one Inline Date Picker on a page even if multiple date fields exist on the page. Note OA Framework only supports the month and year as separate pulldown lists in the Date Picker. Declarative Implementation There is currently no declarative support for implementing an Inline Date Picker, however, you must define a date field on your page first by creating a messageTextInput item on your page and setting its Data Type property to Date. Runtime Control Creating an Inline Date Picker Once you declaratively define one or more date fields on your page, you can programmatically create an Inline Date Picker and associate the Inline Date Picker ID with these date fields. You can also programmatically determine the placement of the Inline Date Picker on the page. To create an Inline Date Picker, include the following code in the processRequest method of your controller. import oracle.apps.fnd.framework.webui.beans.form.OAInlineDatePickerBean; import oracle.apps.fnd.framework.webui.beans.message.OAMessageDateFieldBean; public void processRequest(OAPageContext pageContext, OAWebBean webBean) { : 445
  • 446. Oracle Application Framework Developer's Guide OAInlineDatePickerBean inlineDatePicker = (OAInlineDatePickerBean) createWebBean(pageContext, INLINE_DATEPICKER_BEAN); inlineDatePicker.setId("DatePicker"); OAMessageDateFieldBean dateField = (OAMessageDateFieldBean)webBean. findIndexedChildRecursive("Date1"); dateField.setPickerID("DatePicker"); // Set the same inlineDatePicker to another date field. dateField = (OAMessageDateFieldBean)webBean.findIndexedChildRecursive("Date2"); dateField.setPickerID("DatePicker"); WebBean.addIndexedChild(inlineDatePicker); } Creating an Inline Date Picker with Max and Min Values To display an Inline Date Picker in a page with a restricted range of dates, include the following code in the processRequest method of your controller. import oracle.apps.fnd.framework.webui.beans.form.OAInlineDatePickerBean; import oracle.apps.fnd.framework.webui.beans.message.OAMessageDateFieldBean import java.util.Date; public void processRequest(OAPageContext pageContext, OAWebBean webBean) { : 446
  • 447. Oracle Application Framework Developer's Guide, Release 12.1.3 Date minDate = new Date(100, 06, 04); // 4th July 2000 Date maxDate = new Date(104, 11, 17); // 17th December 2004 OAInlineDatePickerBean inlineDatePicker = (OAInlineDatePickerBean) createWebBean(pageContext,INLINE_DATEPICKER_BEAN); inlineDatePicker.setId("DatePicker"); inlineDatePicker.setMinValue(minDate); inlineDatePicker.setMaxValue(maxDate); OAMessageDateFieldBean dateField = (OAMessageDateFieldBean) webBean.findIndexedChildRecursive("Date1"); dateField.setPickerID("DatePicker"); // Should be set on the date field also. dateField.setMinValue(minDate); dateField.setMaxValue(maxValue); webBean.addIndexedChild(inlineDatePicker); } Personalization Considerations • See a summary of Date Picker personalization considerations in the Oracle Application Framework Personalization Guide. Known Issues • None Related Information 447
  • 448. Oracle Application Framework Developer's Guide • BLAF UI Guideline o Date Picker [OTN version] • Javadoc o oracle.apps.fnd.framework.webui.beans.form.OAInlineDatePick erBean o oracle.apps.fnd.framework.webui.beans.form.OADateFieldBean 448
  • 449. Oracle Application Framework Developer's Guide, Release 12.1.3 Declarative Page Flow Overview With the OA Framework you can declaratively define navigation relationships between pages using the following techniques. You can either: • Specify the personalizable Destination Function property for select UI components in a page or • Use Oracle Workflow to define a workflow that describes your navigation rules for a page flow, and then leverage this workflow at runtime to dynamically ascertain the target page for each navigation action With the "Destination Function" technique, you can associate a target navigation page with a UI component at design time. So, for example, if the user selects a particular link or button, you can navigate to the page whose UI function is associated with that link or button. Since the Destination Function UI property is personalizable, this approach lets customers easily change the target page for a given action. This technique is best used for simple, point-to-point navigation that can be statically defined. With the Workflow technique, you can model a complex page flow including forward/back navigation, looping and conditional branching. Each time the user tries to perform a navigation action, the workflow determines what the target page should be. Generally, the workflow technique is best suited to multistep transactions. In this case, customers can't simply change the logic that interrogates the workflow to obtain the destination page, but they can change the workflow definition itself if necessary. Destination Function Page Flow To define a navigation action that can be personalized by administrators, you simply need to set the Destination Function property value to the name of a UI function whose Web HTML call points to the target page (see the Tabs/Navigation document for information about creating functions). Customers can then create a function-based personalization for this page, for example, and substitute their new function for the one that you seed. The Destination Function property is supported for a select list of components. The corresponding behavior differs slightly based on whether the component renders as a link or a form submit item. Note: The Destination Function property is not yet supported on the navigationBar (oracle.apps.fnd.framework.webui.beans.nav.OANavigationBarBean) so it cannot be used with this component for step-by-step transaction flows. GET Implementation If you set the Destination Function property on a bean that normally renders as a link, the Destination URI property is ignored (if specified). When the user selects the link, a GET 449
  • 450. Oracle Application Framework Developer's Guide request is issued and the page associated with the target function displays. The list of beans in this category include: Note that this functionality existed previously for some beans. • button • image • link • nodeDef (in a tree) • staticStyledText • messageStyledText Tip: If you want to add parameters to the URL generated for the GET request, you can use the setInvokeFunctionParams(String functionParam) method on your bean. For example, you could add the following processRequest() logic to add the request parameter foo=bar to the URL when a button with a Destination Function is selected: public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OAButtonBean button = (OAButtonBean)webBean.findIndexedChildRecursive("<myButton>"); button.setInvokeFunctionParams("foo=bar"); } POST Implementation If you set the Destination Function property on a bean that normally submits the form when selected (a submitButton, for example, or another component configured to submit the form with a fireAction), setting this property does not change this behavior. You must handle the form submission event as you normally would with the code shown below. 450
  • 451. Oracle Application Framework Developer's Guide, Release 12.1.3 The list of beans in this category include: • button • image • link • nodeDef (in a tree) • staticStyledText • messageStyledText • singleSelection • messageRadioGroup • messageCheckBox • messageTextInput • messageChoice • messageLovChoice • messageRadioButton • submitButton If you set the Destination Function for one of these beans, you must code processFormRequest() logic to obtain the function name so you can pass it to a setForward*URL() method call. This is illustrated in the following example that handles the fireAction event for a messageChoice bean. public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); String event = pageContext.getParameter(EVENT_PARAM); String source = pageContext.getParameter(SOURCE_PARAM); if ( "<myEventName>".equals(event) && "<myPoplist>".equals(source) ) { OAMessageChoiceBean poplistBean = (OAMessageChoiceBean)webBean.findIndexedChildRecursive("<myPoplist>"); String invokeFunc = poplistBean.getInvokeFunctionName(); pageContext.setForwardURL(invokeFunc,...); } } Personalization Considerations 451
  • 452. Oracle Application Framework Developer's Guide • See a summary of Page Flow personalization considerations in the Oracle Application Framework Personalization Guide. Known Issues • None Workflow Page Flow Instead of adding complex, static logic to your page controllers to handle different navigation scenarios, this technique lets you leverage Oracle Workflow to handle all the conditional navigation rules. This section describes how to create an appropriate workflow definition for this purpose, and how to interact with it as the user navigates through the transaction. For additional information about the Workflow product, see the Oracle Workflow Developer's Guide, the Oracle Workflow Administrator's Guide, the Oracle Workflow User's Guide and the Oracle Workflow API Reference at the Oracle Applications Documentation Library. These instructions assume that you understand how to create, test and deploy Workflow process definitions; it focuses exclusively on the characteristics of a workflow that are important to this particular use case. Figure 1: Example of the first page in a multistep flow (this is the Multistep Create flow in the OA Framework ToolBox Tutorial which uses Workflow). Implementation To create a multistep page flow using Workflow, follow these steps: 452
  • 453. Oracle Application Framework Developer's Guide, Release 12.1.3 Step 1: Create Your Transaction Pages Create all the pages that need to participate in a multipage transaction, as you would create any OA Framework page. Step 2: Define the Page Flow Workflow Use Oracle's Workflow Builder to define your page flow in accordance with the rules and guidelines described below. Note that this document assumes that you know how to use the Workflow Builder. For general information on defining workflow processes refer to the Oracle Workflow Developer's Guide. Figure 2: Example of a Page Flow in Oracle Workflow Builder. To configure a workflow as a page flow: 1. Add a function activity for each page in the transaction. For each activity, decide whether to: o Associate a result with this activity (if appropriate for conditional navigation), or o Explicitly mark the activity as blocked by associating the wf_standard.block PL/SQL function with it. When the Workflow Engine encounters a blocking activity it stops and waits for some sub-process or external entity to provide the information it needs to proceed. So, with the mapping between transaction pages and the blocking activities in the Workflow, you can query the activity data to find out what page ought to be rendered. 453
  • 454. Oracle Application Framework Developer's Guide 2. Add FORM attribute to each page-related blocking activity. You will use this for page information as shown in Figure 4 below. Figure 3: Function definition in Oracle Workflow Figure 6: Function activity attribute with page information. You can also add blocking activities that do not correspond to a page for the following use cases: • You send a notification at the end of the transaction. 454
  • 455. Oracle Application Framework Developer's Guide, Release 12.1.3 For example, a Create Expense Report flow might send out a notification asking for manager approval. Once the manager responds, you want to send an FYI notification to the user who submitted the expense report. In this case, the blocking notification activity comes after the multiple page part of the transaction has concluded. • The workflow is comprised of two discrete transactions as described in this user flow: 1. User selects a "Create Expense Report" action. 2. User fills out Page 1, Page 2, Page 3 to create and submit an expense report (transaction #1) 3. Report submission causes a notification to the user's manager. 4. The manager can approve or reject the expense request. 5. If the manager rejects the expense, an FYI Notification is sent to the user asking him to update the expense report. 6. User selects an "Update Expense Report" action. 7. This time user steps through Page 4 and Page 5 to update and resubmit the expense report (transaction #2) In the corresponding workflow process definition, the two transactions are separated by a notification that requires a user response. The second part of the create expense report transaction is optional and is executed only if the expense report is rejected. The point here is that blocking activities that do not correspond to pages should only be inserted at appropriate points in the flow, otherwise the user won't able to finish the transaction. Note that in this second scenario your application has to do all the work to make sure that when the user returns to update the expense report, he is in the right context. Your application is also responsible for calling the correct OA Framework API to indicate that the page flow depends on a previously started workflow process Workflow activities that denote pages in a flow should not have OR joins. The following scenario won't work. In this flow, Page 1 can go to Page 2 or Page 3. Since there is no result type associated with Page 1, the Workflow Engine will randomly decide between Page 2 or Page 3. You can change this into a valid flow by attaching a result type to Page 2. Figure 7: Invalid workflow with an OR. 455
  • 456. Oracle Application Framework Developer's Guide Step 3: Start the Page Flow There are two ways you can start a Workflow process for a page flow based on whether your page flow is launched from an originating page or not (for example, the originating page might be a read-only summary with a "Create Object" button that launched the page flow). In the scenario where you have a launching page, your processFormRequest() logic for the button that launches the page flow should appear as follows: public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { ... if (OANavigation.isWorkflowInProgress(pageContext)) { String oldKey = OANavigation.getItemKey(pageContext); 456
  • 457. Oracle Application Framework Developer's Guide, Release 12.1.3 if (!OANavigation.abortProcess(pageContext, "FWKTBX2","FWKTBXPFLOW", oldKey, null, null)) { ...throw exception } } OAApplicationModule am = pageContext.getRootApplicationModule(); String wfKey = null; String nextPage = null; // Initialize the Workflow pageflow. Serializable[] parameters = { "fwk_tbx_wf_seq" }; wfKey = (String)am.invokeMethod("getWfKey", parameters); OANavigation.createProcess(pageContext, "FWKTBX2","FWKTBXPFLOW", wfKey); OANavigation.startProcess(pageContext, "FWKTBX2", "FWKTBXPFLOW",wfKey); // This is the correct signature for initializing a new workflow when you're going // to transition to the first activity. nextPage = OANavigation.getNextPage(pageContext, "FWKTBX2", wfKey,null, false); 457
  • 458. Oracle Application Framework Developer's Guide HashMap params = new HashMap(1); params.put("poStep", "1"); pageContext.setForwardURL(pageContext.getApplicationJSP() + "?" + nextPage, // target page null, KEEP_MENU_CONTEXT, "", // No need to specify since we're keeping menu context params, // Page parameters true, // Be sure to retain the AM! ADD_BREAD_CRUMB_NO, // Do not display breadcrumbs OAException.ERROR); // Do not forward w/ errors } // end processFormRequest() If you don't want to display a generic page and instead would like to start with the first page defined in the Workflow, your page controller must instantiate the workflow, query it for page information, and then redirect the request to this page as shown: public void processRequest(OAPageContext pageContext, OAWebBean webBean) { ... 458
  • 459. Oracle Application Framework Developer's Guide, Release 12.1.3 String wfKey = null; String nextPage = null; if (!OANavigation.isWorkflowInProgress(pageContext)) { OAApplicationModule am = pageContext.getRootApplicationModule(); // Initialize the Workflow pageflow. Serializable[] parameters = { "fwk_tbx_wf_seq" }; wfKey = (String)am.invokeMethod("getWfKey", parameters); OANavigation.createProcess(pageContext, "FWKTBX2", "FWKTBXPFLOW", wfKey); OANavigation.startProcess(pageContext, "FWKTBX2", "FWKTBXPFLOW", wfKey); } nextPage = OANavigation.getNextPage(pageContext, "FWKTBX2", wfKey, null, false); HashMap params = new HashMap(1); params.put("poStep", "1"); pageContext.setForwardURL(pageContext.getApplicationJSP() + "?" + nextPage, // target page 459
  • 460. Oracle Application Framework Developer's Guide null, KEEP_MENU_CONTEXT, "", // No need to specify since we're keeping menu context params, // Page parameters true, // Be sure to retain the AM! ADD_BREAD_CRUMB_NO, // Do not display breadcrumbs OAException.ERROR); // Do not forward w/ errors } } Step 4: Transition Between Pages Note: Please see the Multistep Create flow in the OA Framework ToolBox Tutorial for a complete code example. The OANavigation API provides three getNextPage() methods for transitioning the workflow. • getNextPage(OAPageContext pageContext) - transitions to the next page of the workflow. • getNextPage(OAPageContext pageContext, String resultCode) - transitions to the next page of the workflow based on the result type determined in your controller. • getNextPage(OAPageContext pageContext, String wfItemType, String wfItemKey, String wfProcess, boolean initialize) - used to resume a saved transaction. Figure 8: Second step of the purchase order. 460
  • 461. Oracle Application Framework Developer's Guide, Release 12.1.3 To transition to the next page of an active transaction of the workflow, use OANavigation.getNextPage(OAPageContext pageContext) in your proceessFormRequest() method. The getNextPage() completes the blocking activity corresponding to the current page and advances the workflow until it encounters the next blocking activity. The workflow transitions to a waiting state and control is transferred back to the calling getNextPage(). nextPage = OANavigation.getNextPage(pageContext); The method then queries the blocking activity and retrieves the page information associated with the activity's FORM type attribute and returns it to the processFormRequest() of the calling controller. You should write a setForwardURL to redirect the request to next page in flow. HashMap params = .....; params.put(.....); pageContext.setForwardURL(........); To transition to the next page as per the result type returned by the OA Framework controller use getNextPage(OAPageContext pageContext, String resultcode). public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { ... String workflowResultCode = null; if (pageContext.getParameter("Next") != null) { 461
  • 462. Oracle Application Framework Developer's Guide workflowResultCode = "Next"; } else if (pageContext.getParameter("Previous") != null) { workflowResultCode = "Previous"; } nextPage = OANavigation.getNextPage(pageContext,workflowResultCode); HashMap params = .... params.put(....); pageContext.setForwardURL(.........); } Step 5: Clear the Workflow Context Since the Workflow transaction holds an independent local JDBC connection, you must override the OADBTransaction.beforePoolCheckin() method in your root UI application module and call getDBTransaction.clearWorkflowInfo() to release the connection. public void beforePoolCheckin() { // Always call this first. super.beforePoolCheckin(...); getDBTransaction.clearWorkflowInfo(); } Saving the Transaction and Continuing Later 462
  • 463. Oracle Application Framework Developer's Guide, Release 12.1.3 OA Framework does not provide built-in support for "Save for Later" transactions. If you want to provide this feature, you must implement all the state management yourself. To resume a saved transaction, you must query a blocked workflow to retrieve the current page information by calling getNextPage(OAPageContext pageContext, String wfItemType, String wfItemKey, String wfProcess, Boolean initialize). Browser Back Button Support Workflow-based page flows automatically support browser Back button navigation at the Workflow technology layer. Whenever user moves between the pages using browser Back button and resubmits, the workflow rewinds itself to the appropriate blocking activity so it stays in synch with the user's current navigation position. See Supporting the Browser Back Button for additional information as it relates to the explicit Back button support required at the OA Framework layer. Page Flows with Train and Navigation Bar If the number of page flow steps is known, it is appropriate to use a train and associated navigation bar as shown in Figure 1 above (if the number of steps is indeterminate, this is not an appropriate UI design). For implementation instructions, see Locator Element: Train and Locator Element: Page Navigation in Chapter 4. Error Handling For the most part, you handle application errors in your Workflow-based page flows the same way that you do in any other context. That said, however, you need to consider the possibility that the user might fix mistakes and resubmit the form whenever you introduce workflow code. Known Issues • Parallel flows are not supported when using Workflow page flows. Related Information • BLAF UI Guideline(s) o Step-by-Step Page Flows [OTN Version] o Step-by-Step (3+ Step) Page Template [OTN Version] • Javadoc o oracle.apps.fnd.framework.webui.beans.nav.OANavigationBarBe an • OA Framework Developer's Guide o Tabs / Navigation o Submitting the Form o Locator Element: Train o Locator Element: Page / Record Navigation • OA Framework ToolBox Tutorial / Sample Library 463
  • 464. Oracle Application Framework Developer's Guide o See the Create (Multistep) example in the Tutorial.jpr (run the test_fwktutorial.jsp to try it) • Oracle Workflow Documentation o Oracle Workflow Developer's Guide o Oracle Workflow Administrator's Guide o Oracle Workflow User's Guide o Oracle Workflow API Reference 464
  • 465. Oracle Application Framework Developer's Guide, Release 12.1.3 Dialog Pages Overview As described in the BLAF UI Guideline: Message Flows [OTN Version] specification, messaging can be introduced into application flows when an Error, Information, Warning, Confirmation, or Processing Message needs to be displayed. There are two basic kinds of messaging flows: • Inline Message - The message appears inline on a page around the region item that requires attention. The inline message is also repeated in the message box on top of the page. • Dialog Page - The message appears on it's own dialog page in the flow. The inline message is described in detail in Chapter 4: Implementing Message Boxes. This document focuses on how to implement an Error, Information, Warning, or Confirmation message in a dialog page. The following figure shows an example of a Warning message displayed in a dialog page. Figure 1: Warning dialog page. Contents • Declarative Implementation • Runtime Control o New Dialog Page APIs o Using HTML Tags in Messages • Personalization Considerations • Known Issues • Related Information Declarative Implementation Since a dialog page is displayed in the context of runtime events and circumstances, there is no corresponding declarative implementation. Runtime Control You can display an exception as a message in a dialog page using the APIs in the oracle.apps.fnd.framework.webui.OADialogPage class and oracle.apps.fnd.framework.webui.OAPageContext interface. 465
  • 466. Oracle Application Framework Developer's Guide The OADialogPage class holds properties for the generic dialog page. To create a dialog page object, first use the constructors to instantiate the basic properties, then use the setter methods provided in the class to set additional properties. Please refer to the OADialogPage Javadoc for an explanation of basic usage and additional examples. To navigate (redirect) to a dialog page, use the OAPageContext.redirectToDialogPage methods. The OAPageContext interface contains the context and state information specific for a client request. The following redirectToDialogPage methods are provided in OAPageContext: // Redirects to a dialog message page. public void redirectToDialogPage(OADialogPage dialogPage); // Convenience method to create and redirect to a dialog page with basic properties set. Public void redirectToDialogPage(byte messageType, OAException descriptionMessage, OAException instructionMessage, String okButtonUrl, String noButtonUrl) Please refer to the OAPageContext Javadoc for further information on these methods. Example: Redirect to a Basic Warning Page You can include the following code example in your controller processFormRequest method to redirect to a basic warning page: OAException descMesg = new OAException("FND", "FND_CANCEL_WARNING"); OAException instrMesg = new OAException("FND", "FND_CANCEL_ALERT"); String okUrl = APPS_HTML_DIRECTORY + "OA.jsp?OAFunc=FND_REQUISITIONS_PAGE"; String noUrl = APPS_HTML_DIRECTORY + "OA.jsp?OAFunc=FND_REQUISITIONS_PAGE&retainAM=Y"; pageContext.redirectToDialogPage(OAException.WARNING, descMesg, instrMesg, okUrl, noUrl); Example: Make Dialog Page Action Buttons Submit Back to the Calling Page 466
  • 467. Oracle Application Framework Developer's Guide, Release 12.1.3 Refer to the setPostToCallingPage method, documented in the OADialogPage Javadoc for a code example of how to make the dialog page action buttons submit back to the calling page. In the example, the OK button commits the changes on the dialog page and the NO button rolls back the changes. Example: Display a Warning Page When a Delete Icon is Selected. Refer to Task 4 of the Delete exercise in the Oracle Application Framework Toolbox Tutorial for another example of how to create a Warning dialog page. The specific example is implemented in controller class EmployeeResultsCO in LabSolutions.jpr of the Toolbox. This example displays a Warning page when a user selects the Delete icon from an Employees Search page. The Warning page displays Yes and No submit buttons, as shown in Figure 1. Using HTML Tags in Messages You may insert HTML tags in the messages displayed in a dialog page. Please refer to the Chapter 4 topic: Custom HTML for further details. Handling Messages that Reference Web Beans Without Prompts If your page contains a web bean that does not have a prompt value associated with it and a user enters an invalid value for the web bean, the error message that results will be malformed. For example, if you have a messageTextInput field with no prompt and you enter an invalid value, the error message may display as: Value "A" in "" is not a number. To avoid these malformed messages, use oracle.apps.fnd.framework.webui.beans.message.OAMessagePromptBean. Create an OAMessagePromptBean and set: • Prompt - to the alternate prompt that is going to be displayed for the web bean. • LabeledNodeId - to those set of web bean ID's that you want associated with this alternate prompt. (These are the web beans without a current prompt associated with them). You can associate multiple web bean ID's to the LabeledNodeId of this OAMessagePromptBean. As a result, all those web beans will be associated with the prompt of the OAMessagePromptBean. The following code example illustrates this: ... OAMessagePromptBean bean = new OAMessagePromptBean(); bean.setID("someID"); bean.setPrompt("Alternative"); 467
  • 468. Oracle Application Framework Developer's Guide bean.setLabeledNodeID("RequiredBeanID"); webBean.addIndexedChild(bean); ... RequiredBeanID is the ID of the web bean with which this alternate Prompt is to be associated. New Dialog Page APIs The setFooterNestedRegionCode and setFooterNestedRegionApplicationID methods in the OADialogPage class have been deprecated. If you use the standard OK/NO buttons provided on the dialog page, you do not need to make any changes. However, if you are using the OADialogPage.setFooterNestedRegionCode and OADialogPage.setFooterNestedRegionApplicationID methods to render customized buttons under the footer region, you must update your code to use the new method OADialogPage.setPageButtonBarRegionRefName instead. This new method lets you set a reference to a page button bar region, built declaratively with OA Extension. You can add any number of custom buttons to the page button bar region. OA Framework renders the page button bar region under the footer. Adding your custom content to a page button bar region allows the page buttons to be rendered and positioned in the proper places specified by the latest UI standards. To render the Return To navigation link under the footer, use the existing setReturnToLinkLabel and setReturnToLinkURL methods in OADialogPage. To render a nested region, created with OA Extension, under a dialog page header, use the new OADialogPage.setHeaderNestedRegionRefName method. Personalization Considerations • See a summary of Dialog Pages personalization considerations in the Oracle Application Framework Personalization Guide. Known Issues • None Related Information • BLAF UI Guidelines o Messaging Flows [OTN Version] o Messaging Templates [OTN Version] • Javadoc File o oracle.apps.fnd.framework.webui.OADialogPage o oracle.apps.fnd.framework.webui.OAPageContext o oracle.apps.fnd.framework.webui.beans.OAFormattedTextBean 468
  • 469. Oracle Application Framework Developer's Guide, Release 12.1.3 o oracle.apps.fnd.framework.webui.beans.OATipBean o oracle.apps.fnd.framework.webui.beans.message.OAMessageProm ptBean o oracle.cabo.ui.beans.message.MessagePromptBean • Lesson o Delete exercise • Sample Code o oracle.apps.fnd.framework.toolbox.labsolutions.webui.Employ eeResultsCO in LabSolutions.jpr of the Toolbox Tutorial 469
  • 470. Oracle Application Framework Developer's Guide File Upload and Download Overview The File Upload feature enables the uploading of a file from a client machine to the middle tier, and is implemented by oracle.apps.fnd.framework.webui.beans.message.OAMessageFileUploadBean. The File Download feature enables downloading of a file from the middle tier to a client machine and is implemented by oracle.apps.fnd.framework.webui.beans.message.OAMessageDownloadBean. Contents • File Upload o Declarative Implementation o Runtime Control • File Download o Declarative Implementation o Runtime Control • Usage Notes • Personalization Considerations • Known Issues • Related Information File Upload You can now specify a view object instance and view attribute for the messageFileUpload web bean and associate a data type to it. The File Upload feature appears as an input field with a prompt, followed by a Browse button, as shown: If the view attribute returns a non-null value, that is, a file is already uploaded, OA Framework renders the File Upload feature as a View link with a prompt, followed by a Clear button: You can select the View link to see information about the uploaded file. If you select Clear, the feature clears the View link and redisplays an input field with a Browse button so you can specify a new file to upload. Note: You can alter the text of the View link to display some other text or the file name of an already uploaded file. See the Runtime Control section for more details. Note: You can set the profile option called UPLOAD_FILE_SIZE_LIMIT to specify the maximum size of the file a user can upload. For example, if you set 470
  • 471. Oracle Application Framework Developer's Guide, Release 12.1.3 UPLOAD_FILE_SIZE_LIMIT to 500K, then during the http POST request, OA Framework reads only up to 500K from the stream and throws an exception if the uploaded file is larger than 500K. Declarative Implementation Perform the following steps to implement the File Upload feature declaratively in an OA Extension page. Step 1: Create a region in your page layout region, with the Form property set to true for the page layout. Step 2: In the new region, create an item of item style messageFileUpload. Step 3: In the OA Extension Property Inspector, set the following properties for the messageFileUpload item: • View Instance - A view object instance of the underlying data source. • View Attribute - A view attribute in the specified view object instance, that maps to the column for storing the file content. • Data Type - The Oracle data type of the view attribute. The BLOB data type is supported for File Upload. For example, if you set the data type to BLOB, the view attribute must map to a column whose data type is also BLOB. Note: The data type must be set to the same data type as the column that the view attribute maps to, otherwise an error occurs when the user attempts to commit the file upload. Note: If you set Data Type to BLOB and you store your file content in FND_LOBS, be sure to populate the column FILE_CONTENT_TYPE (File MIME Type). Since FILE_CONTENT_TYPE is a non-null column, you will encounter an error is this column is not populated. Refer to the oracle.apps.fnd.framework.webui.beans.message.OAMessageFileUpload Bean Javadoc for additional information. • Prompt - The text label for the File Upload feature. Runtime Control You can programmatically alter the text of the link that appears when a file has already been uploaded to be something other than "View". To change it to some other static text, then in your controller code, call the setDisplayName method from the OAMessageFileUploadBean and pass in the text to display for the link. If you wish the link text to be dynamically determined, for example, to display the name of the file that is already uploaded, then you can data bind the display name as follows: OADataBoundValueViewObject displayNameBoundValue = 471
  • 472. Oracle Application Framework Developer's Guide new OADataBoundValueViewObject(uploadBean, "FileName"); uploadBean.setAttributeValue(DOWNLOAD_FILE_NAME,displayNameBoundValue) ; File Download The File Download feature appears as linked text on a page. For example, in the figure below, a default single column region contains a messageTextInput item (Image Name), followed by a messageDownload item that appears as a File Download link (Process.gif). The text that appears for the File Download link is the value returned by the View Attribute specified for the messageDownload item. When you select the file download link, a small window opens in your Browser. You can either open the file and display the content or save the file. If you choose Save, the file is created and saved to your client machine. Declarative Implementation Perform the following steps to implement the File Download feature declaratively in an OA Extension page. Step 1: Create a region in your page layout region, with the Form property set to true for the page layout. Step 2: In the new region, create an item of item style messageDownload. Note: If you implement a messageDownload item in a table or advanced table region, the view object used to render the table or advanced table must have a designated primary key, otherwise the messageDownload web bean will repeatedly download content from the first row. Step 3: In the OA Extension Property Inspector, set the following properties for the messageDownload item: • View Instance - The view object instance of the underlying data source. • View Attribute - The view attribute that maps to a column in the underlying data source. • File View Attribute - The view attribute that maps to the column that stores the file content. • File Name Override - The file name to save to when you select the File Download link and choose the Save option in the File Download window to save the file. The default file name that appears in the File Name field of the Save As dialog window is derived from the value returned from the view attribute specified by the View Attribute property. The value of the File Name Override property overrides that default file name and is especially useful if the view attribute returns instructional text, such as "Click on this link to download the file". If the File 472
  • 473. Oracle Application Framework Developer's Guide, Release 12.1.3 Name Override property is not defined, then the file name to save to is the value returned from the view attribute. • File MIME Type - The MIME type of the file. See the Runtime Control example below if you do not want to specify a static value for this property. • Data Type - The data type of the File View Attribute. The BLOB datatype is supported for File Download. • Prompt - The text prompt that proceeds the File Download link. Runtime Control If the file MIME type is stored in a view attribute, you can retrieve it through a data bound value programmatically. The following code example illustrates how this is done: // if content type is stored in a view attribute, it can be retreived through // data bound value. Otherwise, a static value can also be set: // e.g. downloadBean.setFileContentType("text/html") OADataBoundValueViewObject contentBoundValue = new OADataBoundValueViewObject(downloadBean, "FileContentType"); downloadBean.setAttributeValue(FILE_CONTENT_TYPE, contentBoundValue); Usage Notes • Avoid defining both a messageFileUpload and a messageDownload item in a region and mapping both items to the same view attribute. If you map both items to the same view attribute, the Clear button in the messageFileUpload web bean that clears the View link, will also clear the link for the messageDownload web bean. • A messageFileUpload item is not supported in a Table-in-Table region or Advanced Table-in-Advanced Table region. Personalization Considerations There are no personalization restrictions. Known Issues See a summary of key file upload/download issues with suggested workarounds if available. Related Information 473
  • 474. Oracle Application Framework Developer's Guide • BLAF UI Guidelines • Javadoc o oracle.apps.fnd.framework.webui.beans.message.OAMessageDown loadBean o oracle.apps.fnd.framework.webui.beans.message.OAMessageFile UploadBean 474
  • 475. Oracle Application Framework Developer's Guide, Release 12.1.3 Flexfields Overview A flexfield is a placeholder set of fields that can be configured by customers for use by their organizations. Once configured, the customer-defined fields in the set (label/widget pairs) may appear in either a form or tabular layout. Each field in the set has a name and a set of valid values. There are two types of flexfields, key and descriptive. Key flexfields provide a way for Oracle E-Business Suite to represent objects such as accounting codes, part numbers, or job descriptions, which comprise of multiple fields (or segments) as a single object of concatenated segments. For example, the Key Accounting Flexfield is a key flexfield that represents the multiple accounting codes throughout Oracle E- Business Suite. Similarly, descriptive flexfields provide a flexible way for Oracle E-Business Suite to provide customizable "expansion space" in applications, as well as provide a way to implement context- sensitive fields that appear only when needed. In essence, descriptive flexfields allow customizations of pages without writing either XML or Java and are configured as a set of fields on a page, much like the fields of the core application. Both types of flexfields let you customize Oracle E-Business Suite features without programming and these customizations are fully supported within Oracle E-Business Suite. Note: This document assumes a working knowledge of flexfields. If you are not familiar with flexfields or need further information, please consult the Oracle E-Business Suite Flexfields Guide Release 12 and Chapter 14 ("Flexfields") in the Oracle E-Business Suite Developer's Guide Release 12 . Contents This document contains the following topics: • Overview o Flexfield Features Supported and Unsupported by OA Framework • Descriptive Flexfields o Setting Up a Descriptive Flexfield in Oracle E-Business Suite o Declarative Implementation in JDeveloper  Descriptive Flexfield Segment List o Runtime Control o Personalization Considerations o Descriptive Flexfield Usage Restrictions • Key Flexfields o Setting Up a Key Flexfield in Oracle E-Business Suite o Declarative Implementation in JDeveloper  Key Flexfield Segment List o Runtime Control o Personalization Considerations 475
  • 476. Oracle Application Framework Developer's Guide • Reference Fields • Values and Value Sets • Flexfield Validation • Flexfields and Standard Request Submission • Developer Mode Errors • Troubleshooting Flexfield Problems • Known Issues • Related Information Flexfield Features Supported and Unsupported by OA Framework The following table lists the flexfield functionality (above and beyond regular flexfield functionality) that is supported and unsupported by OA Framework. The list also provides links to the area of this document where the supported or unsupported feature is discussed in more detail. Note: Warnings are raised at setup time in the Forms-based flexfield administration screens if a flexfield is using features not supported in OA Framework. Flexfield Supported Unsupported Features General • Specifying segments for a particular • Query a range of key context of a descriptive flexfield flexfield segments • Hiding certain segments for Key and Descriptive flexfields • Read-only segments for Key and Descriptive Flexfields • Descriptive flexfield default values • Using Reference fields Value Sets • Format Rules • Displaying as Poplist • Displaying as LOV • Using a $FLEX$ reference • Using a $PROFILES$ reference Validation • None • Pair Types • Independent • Special • Dependent • Table Key Flexfield- • Dynamic Insertion • Specifying a segment specific • Key flexfield within a table description • Multiple key flexfields on a page • Multiple key flexfields in a table • Generating the CCID • Combination LOV UI o Required key flexfield LOV 476
  • 477. Oracle Application Framework Developer's Guide, Release 12.1.3 o Dynamic Insert o LOV over LOV • Adding a VRule to a Key Flexfield web bean Descriptive • Context values • Specifying a segment Flexfield- • Context switching description specific • Setting context value through an API • Descriptive flexfield within a table • Multiple descriptive flexfields on a page • Multiple descriptive flexfields in a table • Setting a descriptive flexfield to be Read-only • Hiding or showing the context Flexfield Core UI • Date picker - supported for both key • Mobile Applications and descriptive flexfields. • Multiple key or descriptive flexfields using the same view object. • Programmatic implementation of descriptive and key flexfields • Merging a flexfield with its parent layout (see workarounds for key and descriptive flexfields) Flexfield • Turning On/Off unvalidated submit Validation Flexfield • Overriding an descriptive flexfield Customization segment LOV to populate multiple descriptive flexfield segments with values. Segments lists • enable/disable, reorder and mark as read-only for Descriptive and Key flexfields • Read-only and Rendered bound for descriptive and key flexfields Flexfields with • Query web bean (turning validation • Descriptive flexfield in a other off) Master/Detail page components • Descriptive flexfield or key flexfield in • Table-in-Table - a a messageLayout region developer mode error • Embedded mode - flexfields are results if you try to rendered when its parent page is implement a flexfield in embedded in a JTT application. • HGrid 477
  • 478. Oracle Application Framework Developer's Guide • Table Detail Disclosure a Table-in-Table. PPR support • Descriptive flexfield context switching • Dependent LOV PPR • Use descriptive flexfield or key flexfield as a PPR target Exporting • Descriptive flexfield data • Key flexfield data Descriptive Flexfields A descriptive flexfield is implemented as an oracle.apps.fnd.framework.webui.beans.OADescriptiveFlexBean. An OADescriptiveFlexBean automatically renders a layout for user input of segment values. For each descriptive flexfield, if the Display Context property is set to True, a context field renders as a poplist in the first row. After the first row, any global segments defined are rendered, followed by the context-sensitive segments that correspond to the selected value in the context poplist. Each descriptive flexfield segment has a prompt aligned to the right, and a corresponding input field aligned to the left. Figure 1 below is an example of the flexfield UI for a standard vertical layout: Figure 1: Visual Example of both a Key and Descriptive Flexfield on a Page 478
  • 479. Oracle Application Framework Developer's Guide, Release 12.1.3 The above example displays a descriptive flexfield. Packaging Type is the context field for the descriptive flexfield and Warehouse is a global field. No context-sensitive elements are displayed in this example because a context has yet to be selected. Currently flexfields support three types of input style: • Text Input (not shown above) • PopList, as shown for the segment Packaging Type • LOV, as shown for the segment Warehouse When you add an OADescriptiveFlexBean to your page, it: • Displays flexfield segments that allow input or update and may populate segments with database values from corresponding view objects. • Automatically refreshes with corresponding flexfield segments when a new context is selected. • Validates flexfield segment input values. • Automatically transfers valid values to the view object so that the calling page has access to valid flexfield values if no errors exist. If errors exist, the current page is redrawn with corresponding error messages. 479
  • 480. Oracle Application Framework Developer's Guide • If you need to wrap a long text of the MessageTextInput of a descriptive flexfield bean to fit the page, you can now call setWrapEnabled() on the descriptive flexfield bean before calling processFlex() by using the following command: dffBean.setWrapEnabled(true); Wrapping is disabled by default. PPR Support OA Framework provides PPR support for descriptive flexfields in the following ways: • If you change the context of a descriptive flexfield, OA Framework uses PPR to render the segments for the new context. Note: OA Framework will perform a page refresh rather than PPR if your controller code moves the segment web beans of the descriptive flexfield out of the descriptive flexfield container. • If a PPR action occurs on a page, and any view object attribute for the descriptive flexfield is changed during the processFormRequest method, OA Framework automatically adds the flexfield web bean as a target for PPR and re-renders the descriptive flexfield. Note: If the context attribute for the descriptive flexfield is changed during the processFormRequest method, the flexfield web bean is not added as a target for PPR and you therefore will not see a change in the descriptive flexfield structure. To show the structure change, OA Framework must redirect back to the same page, in which case, you may need to add code to your processRequest method if this is a concern. Setting Up a Descriptive Flexfield in Oracle E-Business Suite Before you can add a descriptive flexfield to an OA Framework page, you must first set up the descriptive flexfield in Oracle E-Business Suite. To start, review Chapter 3 ("Planning and Defining Descriptive Flexfields") in the Oracle E-Business Suite Flexfields Guide Release 12. When you have a clear plan for the descriptive flexfield you wish to set up, refer to the section titled "Implementing Descriptive Flexfields" in Chapter 14 ("Flexfields") of the Oracle E-Business Suite Developer's Guide Release 12 for instructions to the following general steps: Step 1: Define descriptive flexfield columns in your database. Step 2: Register your descriptive flexfield table with Oracle Application Object Library. Step 3: Register your descriptive flexfield using the Descriptive Flexfields Window. Next, refer to the Oracle E-Business Suite Flexfields Guide Release 12 for instructions to these general steps: 480
  • 481. Oracle Application Framework Developer's Guide, Release 12.1.3 Step 4: Define your value sets in the Value Sets Window, as described in Chapter 5 ("Values and Value Sets"). Step 5: Define your descriptive flexfield structure using the Descriptive Flexfield Segments Window, as described in the "Descriptive Flexfield Segments Window" section of Chapter 3 ("Planning and Defining Descriptive Flexfields"). Recall that the value of a descriptive flexfield context field determines the context of the descriptive flexfield and the context-sensitive segments (if any) that are displayed. The section titled "Context Fields and Reference Fields" in Chapter 3 ("Planning and Defining Descriptive Flexfields") discusses context fields in more detail. Step 6: When you are ready to add the descriptive flexfield to an OA Framework page, follow the steps outlined in the Declarative Implementation and Runtime Control sections below. Declarative Implementation The following steps describe how to add a descriptive flexfield item to a OA Framework region: Step 0: Ensure that the view object underlying the region includes all the database columns necessary for this descriptive flexfield. You should not change the database column names for this flexfield because the OADescriptiveFlexBean uses the same naming convention that the view object generation routine uses to find the corresponding attribute names from your view object. Step 1: Define an item of the item style flex in your region. Note: You cannot create a flex item directly under a messageComponentLayout region, but you can create a messageLayout region under the messageComponentLayout region and add the flex item under the messageLayout region. Step 2: Set the Read Only property to True or False, depending on whether you want the descriptive flexfield to be read only. Step 3: Specify a View Instance for your flexfield. The view instance should be the same as the view instance (view object) specified for your region. Note: OA Framework supports multiple descriptive flexfields on the same view object. Note: If a flexfield's view object does not return a row, an OAException will not be thrown so that the controller's processRequest method can still execute and render the flexfield. Step 4: Set the Appl Short Name property to the short name of the application to which the descriptive flexfield is registered. (Step 3 of Setting Up a Descriptive Flexfield in Oracle Applications). 481
  • 482. Oracle Application Framework Developer's Guide Step 5: Set the Name property to the name of the descriptive flexfield as it was registered. Note: This differs from how Key Flexfields are defined by shorthand codes. Step 6: Set the Type property to descriptive. Step 7: Set the Segment List property as appropriate (see Descriptive Flexfield Segment List). Step 8: Finally, you may set the Display Context Field to True or False, depending on whether you want to hide or show the context for the descriptive flexfield. Descriptive Flexfield Segment List If you leave the Segment List property empty, all segments render. The value you specify for this property must use the following format: Global Data Elements|[global segment1]|[global segment2]||...||Context1|[segment1 for context1]|[segment2 for context1]||...||Context2|.... For our example shown in Figure 1, Packaging Type is the context field and Warehouse is the global field for the descriptive flexfield. To always display the Warehouse global field and display the context-sensitive fields Items per Box and Box Size for the Box context and Items per Pallet and Pallet Weight for the Pallet context, you would specify the following value for the Segment List property: Global Data Elements|Warehouse||Box|Items per Box|Box Size||Pallet|Items per Pallet|Pallet Weight As shown, segments within a certain context are separated by a single pipe, "|", while data from a different context is separated by a double pipe, "||". Read-Only Segments You can also add the read-only token ($RO$) after any of the segments in the list. For example, the ($RO$) designator below sets Segment1 to be read-only: Context1|Segment1($RO$)|Segment2... Runtime Control Warning: You should create web beans programmatically only if you cannot create them declaratively. Programmatically-created web beans cannot be personalized, reused, or extended easily. See the OA Framework Controller Coding Standards for additional information about this and other guidelines that you should consider when writing web bean manipulation code. 482
  • 483. Oracle Application Framework Developer's Guide, Release 12.1.3 If you have declaratively created a descriptive flexfield and want to autorender the whole descriptive flexfield structure, you do not have to write any extra code in your controller's processRequest method. If you need to programmatically create your descriptive flexfield, you can include code similar to the example below in your controller's processRequest method. In this example, DescFF is the item name (of the item with the style flex) in your region: OADescriptiveFlexBean dffBean = (OADescriptiveFlexBean) createWebBean(pageContext, DESCRIPTIVE_FLEX_BEAN, null, "DescFF"); webBean.addIndexedChild(dffBean); dffBean.setAttributeValue(OAWebBeanConstants.VIEW_USAGE_NAME,"Flextest VO1"); dffBean.setAttributeValue(OAWebBeanConstants.FLEXFIELD_APPLICATION_SHO RT_NAME, "FND"); dffBean.setAttributeValue(OAWebBeanConstants.REGION_APPLICATION_ID, new Integer(0)); dffBean.setAttributeValue(OAWebBeanConstants.FLEXFIELD_NAME,"SimpleFle x"); In the processFormRequest method, you can also get valid descriptive flexfield data from your view object's corresponding attributes without any extra coding. You should also consider these other descriptive flexfield runtime control topics: • Merging Descriptive Flexfield Segments with the Parent Layout • Altering Flexfield UI Layout • processRequest Method • Overwriting the Descriptive Flexfield Context Value • Descriptive Flexfield in a Master/Detail Page • Descriptive Flexfield in a Search Region • Read Only and Rendered Bound Values • Populating a Descriptive Flexfield with Default Values • Overriding a Descriptive Flexfield Segment LOV Merging Descriptive Flexfield Segments with the Parent Layout By default, flexfield segments are aligned within themselves but they are not aligned within the whole (parent) region. If you want to merge descriptive flexfield segments to the parent layout, you must find the OADescriptiveFlexBean by attribute and call the method 483
  • 484. Oracle Application Framework Developer's Guide mergeSegmentsWithParent on oracle.apps.fnd.framework.webui.beans.OADescriptiveFlexBean in your controller's processRequest method. The following code example merges descriptive flexfield segments to the parent layout: public class RegionCO extends OAControllerImpl { public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); //find the flexfield that is defined in this region as the item "DescFF" and merge each //individual segment to the outside layout OADescriptiveFlexBean dffBean = (OADescriptiveFlexBean)webBean.findIndexedChildRecursive("DescFF"); flexBean.mergeSegmentsWithParent(pageContext); } public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); } } For example, you could add the following line to the end of the "create descriptive flexfield" code example above: 484
  • 485. Oracle Application Framework Developer's Guide, Release 12.1.3 dffBean.mergeSegmentsWithParent(pageContext); Altering the Flexfield UI Layout Note: This is not recommended by the OA Framework team and may cause problems with PPR. If you want to do something unusual with the descriptive flexfield UI layout (like insert a button after every segment or move the segments around), you need to follow these steps: 1. Find the OADescriptiveFlexBean by attribute name and call the processFlex method on OADescriptiveFlexBean. After this, you will be creating the flexfield segment web beans based on metadata and the view object attribute. 2. Call the getIndexedChild(int)method on the flexfield web bean to go through all the child of the flexfield and alter the layout as desired. processRequest Method If you change a descriptive flexfield's context value, the descriptive flexfield code must redirect back to the same page. As a result, the controller processRequest method is called again. If this behavior causes problems on the page, please use the following code in your processRequest method: public void processRequest(OAPageContext pageContext, OAWebBean webBean) {String formEvent = pageContext.getParameter(FLEX_FORM_EVENT); if (formEvent == null ) { //processRequest ... } } Overwriting the Descriptive Flexfield Context Value If you need to overwrite the descriptive flexfield context value with a value other than the context derived from the view object, you can do so programmatically using the setFlexContext method on OADescriptiveFlexBean. Descriptive Flexfield in a Master/Detail Page Suppose you implement a Master/Detail page where, if a user selects the single selection radio button to select a row in the master region, a PPR event is issued. The page's controller then executes the processFormRequest method to detect the radio button selection and invokes a method in the application module to mark that row in the master data set as the current row in the detail region. 485
  • 486. Oracle Application Framework Developer's Guide If you want to add a descriptive flexfield to the detail region, you update your controller code with the following workaround to ensure that the descriptive flexfield gets updated with the correct context structure when a different row in the master table is selected: public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); pageContext.getApplicationModule(webBean).invokeMethod("refreshDetail" ); pageContext.setForwardURLToCurrentPage(null,true,null,(byte)0); } public void refreshDetail() { Row[] rows = getFndApplicationVO().getFilteredRows("selection","Y"); if (rows != null) { getFndApplicationVO().setCurrentRow(rows[0]); } } Descriptive Flexfield in a Search Region Currently if a Search region includes a descriptive flexfield that has a segment of type LOV, any search criteria that you specify in that flexfield LOV will be auto-validated. LOVs, however, should not be validated in a search criteria region. To turn validation off, use the following API in OADescriptiveFlexBean: 486
  • 487. Oracle Application Framework Developer's Guide, Release 12.1.3 public void setUnvalidated(boolean unvalidated); If the unvalidated value for this method is true, OA Framework will disable LOV validation and disable server-side validation for the descriptive flexfield. See Flexfield Validation for more details. Read Only and Rendered Bound Values If you have to implement a flexfield in a table, where the flexfield is read-only or rendered in some rows and not others, you can do so programmatically using bound values. There is currently no declarative support for this. First, create your bound value using OADataBoundValueViewObject or some other boundValue class. Then set the attribute in your controller's processRequest method as shown in the examples below: dffBean.setAttributeValue(READ_ONLY_ATTR,boundValue); or dffBean.setAttributeValue(RENDERED_ATTR,boundValue); Populating a Descriptive Flexfield with Default Values Previously, if you wanted display the default values of segments when a descriptive flexfield rendered, you had to use the populateRowWithDFFDefaultValues API in oracle.apps.fnd.framework.OAFlexUtils. This API would populate a view object row with the descriptive flexfield default values. Now, OA Framework displays the default values automatically in the descriptive flexfield whenever you create a new row. If the current row is loaded from the database, the descriptive flexfield displays the values stored in the database. Overriding a Descriptive Flexfield Segment LOV In OA Framework, the LOV for a descriptive flexfield segment is automatically mapped to the SQL criteria and results for that single segment. However, there may be cases when you want to associate multiple segments in a descriptive flexfield to the LOV results of a single segment. In other words, you may want to override a segment LOV such that when a user selects a value from that segment's LOV, the LOV returns result values for all the other associated flexfield segments as well. You can override a segment LOV programmatically, using the following method on OADescriptiveFlexBean: public void setFlexLovOverrideInfo(Dictionary[] flexLovInfo) The flexLovInfo parameter is an array of dictionaries. The dictionaries contain the information necessary to override the flexfield LOV relations so that the segment LOV also 487
  • 488. Oracle Application Framework Developer's Guide returns results to multiple other segments of that descriptive flexfield in the base page. Each dictionary contains the following properties, which are explained in detail in the Javadoc: • FLEX_LOV_OVERRIDE_SEGMENT - the database column name of the flexfield segment whose LOV is to be overridden. • FLEX_LOV_OVERRIDE_RESULTS - a string array of the database column names of the flexfield segments that you want to associate with the LOV to override, to return results. • FLEX_LOV_OVERRIDE_VIEWUSAGE - view usage name for the view object containing the SQL to override the LOV segment. • FLEX_LOV_OVERRIDE_AM - full path of the application module containing the view object specified by FLEX_LOV_OVERRIDE_VIEWUSAGE. The following code example illustrates how this API is used: //Create a dictionary array and use arrayMap for each dictionary Dictionary[] flexLovOverrideInfo = new Dictionary[1]; for (int i = 0; i< flexLovOverrideInfo.length; i++) { flexLovOverrideInfo[i] = new ArrayMap(4); } //Specify AM and VO name for the overriden LOV flexLovOverrideInfo[0].put(FLEX_LOV_OVERRIDE_VIEWUSAGE, "USCityLovVO"); flexLovOverrideInfo[0].put(FLEX_LOV_OVERRIDE_AM, "oracle.apps.per.selfservice.personalinformation.server.AddressUpdateA M"); //The LOV result will be returned to the following segments, //and in the new LOV VO, there should be a corresponding column //for each segment. If the VO column name is different than the //segment name, the name should be specified as "segmentName:lovColumnName". 488
  • 489. Oracle Application Framework Developer's Guide, Release 12.1.3 //For example: "POSTAL_CODE:ZIP_CODE" String[] flexLovOverrideResults = new String[4]; flexLovOverrideResults[0] = "TOWN_OR_CITY"; flexLovOverrideResults[1] = "REGION_2"; flexLovOverrideResults[2] = "POSTAL_CODE:ZIP_CODE"; flexLovOverrideResults[3] = "REGION_1"; flexLovOverrideInfo[0].put(FLEX_LOV_OVERRIDE_RESULTS, flexLovOverrideResults); //The LOV will be attached on this segment: flexLovOverrideInfo[0].put(FLEX_LOV_OVERRIDE_SEGMENT, "TOWN_OR_CITY"); //Set the override info into flexfield web bean. flexBean.setFlexLovOverrideInfo(flexLovOverrideInfo); Descriptive Flexfield Usage Restrictions 1. A flexfield is supported within a table or advanced table only if the context-sensitive segments of a descriptive flexfield are always of the same structure within the table. A descriptive flexfield is not supported in the table-in-table feature. See the Oracle Browser Look-and-Feel (BLAF) Guidelines: Flexfields [OTN version] and its Open Issues section for more details. If you must display descriptive flexfield information from a table, where the structure may vary depending on the context, you should implement master/detail pages and display the descriptive flexfield structure in the separate detail page. 2. Multiple descriptive flexfields are supported in a single table and hence a single view object, but there should be no overlap between the attributes that the different flexfields use, otherwise they will overwrite each other's values. Since you cannot change the view object attribute mapping that the flexfield web bean uses (for example, it automatically uses the Segment1 view object attribute if a segment uses the SEGMENT1 table column), you need to define a prefix for the other flexfields using the setFlexPrefix method on the OADescriptiveFlexBean. To illustrate, suppose descriptive flexfield DFF1 use ATTRIBUTE1 and ATTRIBUTE2, which map to the view object attributes Attribute1 and Attribute2 and descriptive flexfield DFF2 use ATTRIBUTE2 and ATTRIBUTE3 which map to the view object attributes Attribute2 and Attribute3. Without a prefix, both flexfields update view object Attribute2 so one of the values gets overwritten. If you call DFF2Bean.setFlexPrefix("DFF2"), the DFF2 OADescriptiveFlexBean will map to DFF2Attribute2 and DFF2Attribute3 and as a result, will no longer conflict with the attributes of the DFF1 OADescriptiveFlexBean. 489
  • 490. Oracle Application Framework Developer's Guide 3. Refer to known flexfield issues for other restrictions. Key Flexfields A key flexfield is implemented as an oracle.apps.fnd.framework.webui.beans.OAKeyFlexBean. An OAKeyFlexBean automatically renders the layout for the input of segment values. Because a key flexfield does not have a context field, all the segments for the specified structure code render. Recall that each key flexfield has a corresponding table, known as a combinations table, that the flexfield uses to store a list of the complete codes (one column for each segment of the code) along with the corresponding unique ID number (code combination ID or CCID) for that code. Pages whose underlying entity objects contain a foreign key reference to the combinations table are referred to as "foreign key pages", while the page whose underlying entity object uses the combinations table itself are referred to as "combinations pages" or "maintenance pages". Note: the OAKeyFlexBean currently supports only "foreign key pages". Additional Information: For further discussion of CCIDs, refer to the topics "Combination" and "Dynamic Insertion" in Chapter 2 ("Planning and Defining Key Flexfields") of the Oracle Applications Flexfields Guide Release 12. See also the "Flexfields" chapter of the Oracle E- Business Suite Developer's Guide. When you add an OAKeyFlexBean to your page, it: • Displays flexfield segments for input or update and may populate flexfield segments with database values from corresponding view objects. • Validates input values for flexfield segments and if such a combination already exists, uses that current combination's CCID to update the view object. If no such combination yet exists, it inserts a new (CCID) row to the combinations table. • Automatically uses the CCID to update the CCID attribute of the view object so that the calling page has access to those values if there are no errors. If there are errors, the current page is redrawn by OA Framework with corresponding error messages. Key Flexfield UI in a Table When a key flexfield is displayed in a table, the concatenated segment descriptions are also displayed, as shown in Figure 2. Figure 2: Key Flexfield in a Table 490
  • 491. Oracle Application Framework Developer's Guide, Release 12.1.3 Key Flexfield Combination LOV UI Based on the Oracle Browser Look-and-Feel (BLAF) Guidelines: Flexfields [OTN version], key flexfields are implemented as code combination LOVs rather than as individual segments in the UI. You can type in a combination code directly in the code combination LOV input. Using this new UI, you can also select the code combination LOV icon to the right of the input field, as shown in the Operations Accounting Flexfield in Figure 3. Figure 3: Combination LOV Key Flexfield on a Base Page The resulting advanced Search page can be used to search for an existing key flexfield combination. The Search page is rendered as two regions, the Search region and the Result region. Each segment of the key flexfield is rendered in the Search region. You do not need to enter values for all segments when searching for a key flexfield code combination. Figure 4: Search Page for Key Flexfield Combination LOV 491
  • 492. Oracle Application Framework Developer's Guide Note: OA Framework currently does not support searching across a range of concatenated segments or individual segments and returns a developer mode error if specified. See the "Range form" topic in Chapter 2 ("Planning and Defining Key Flexfields") of the Oracle E- Business Suite Flexfields Guide Release 12 for more information about this feature in Oracle E-Business Suite. Note: Backwards-Compatibility - The new key flexfield combination LOV UI generates one LOV web bean for the key flexfield instead of multiple child web beans for each segment of the flexfield. Some controllers may have dependencies on the old key flexfield UI. To fix this backwards-compatibility issue, you can turn off the new key flexfield UI by setting the FND_FWK_COMPATIBILITY_MODE profile to 11.5.9 or using the following Java API: OAKeyFlexBean.useCodeCombinationLOV (boolean false); Dynamic Insertion When dynamic insertion is turned on for a key flexfield, a Create button is enabled in the key flexfield combination LOV Search page. If dynamic insertion is allowed and you enter all the required segments for a key flexfield and find no matches on the combination LOV search page, you can select the Create button to create the new code combination. 492
  • 493. Oracle Application Framework Developer's Guide, Release 12.1.3 Required Segments If a key flexfield segment is defined as "required" in Oracle Applications, OA Framework displays an asterisk (*) before the segment. When you perform a search in the combination LOV Search page, you do not have to specify a value for a "required" segment. OA Framework only considers the "required" attribute of the segment when you attempt to create a new code combination with dynamic insertion. PPR Support If a PPR action occurs on a page and the view object attribute for the key flexfield is changed during the processFormRequest method, OA Framework automatically adds the flexfield web bean as a target for PPR and rerenders the key flexfield. Setting Up a Key Flexfield in Oracle E-Business Suite Before you can add a key flexfield to an OA Framework page, you must first set up the key flexfield in Oracle E-Business Suite. To start, review Chapter 2 ("Planning and Defining Key Flexfields") in the Oracle E-Business Suite Flexfields Guide Release 12. When you have a clear plan for the key flexfield you wish to set up, refer to the section titled "Implementing Key Flexfields" in Chapter 14 ("Flexfields") of the Oracle E-Business Suite Developer's Guide Release 12 for instructions to the following general steps: Step 1: Define key flexfield columns in your database, including your combinations table. Step 2: Register your key flexfield table with Oracle Application Object Library. Step 3: Register your key flexfield using the Key Flexfields Window. Next, refer to the Oracle E-Business Suite Flexfields Guide Release 12 for instructions to these general steps: Step 4: Define your value sets in the Value Sets Window, as described in Chapter 5 ("Values and Value Sets"). Step 5: Define your key flexfield structure and segments using the Key Flexfield Segments Window, as described in the "Defining Key Flexfield Structures" and "Defining Segments" sections of Chapter 3 ("Planning and Defining Key Flexfields"). Step 6: When you are ready to add the key flexfield to an OA Framework page, follow the steps outlined in the Declarative Implementation and Runtime Control sections below. Declarative Implementation The following steps describe how to add a key flexfield item to an OA Framework region: 493
  • 494. Oracle Application Framework Developer's Guide Step 0: Ensure that the view object underlying the region includes the CCID column (the foreign key reference). Step 1: In your region, choose New > Item from the context menu and set the Item Style of the new item to flex. Note: You cannot create a flex item directly under a messageComponentLayout region, but you can create a messageLayout region under the messageComponentLayout region and add the flex item under the messageLayout region. Step 2: Specify the View Instance for your flexfield. This view object instance should be the same view object instance that you specified for the region. Note that when you create the view object, you need only include the CCID column. Note: OA Framework can support multiple key flexfields in a page, as well as in a table and on the same view object as long as each key flexfield is using a different CCIDAttributeName. See the Runtime Control section for details on how to specify the CCID column for your view object. Note: If a flexfield's view object does not return a row, an OAException will not be thrown so that the controller's processRequest method can still execute and render the flexfield. Note: OA Framework automatically handles dynamic insertion for you. See the Runtime Control section if you want to handle the dynamic insertion yourself. Step 3: Set the key flexfield's Appl Short Name property to the short name of the application to which the key flexfield is registered. Step 4: Set the key flexfield's Name property to the code of the key flexfield as it is registered. Note: This differs from how a descriptive flexfield is defined by a Name. Step 5: Set the key flexfield's Type property to key. Step 6: Finally, set the Segment List property as appropriate (see Key Flexfield Segment List). Key Flexfield Segment List You may fill in the Segment List property if you want to show some, but not all of the segments in your flexfield. If you leave this property empty, all segments are rendered. The syntax is similar to that described for descriptive flexfields, only you should use structure codes to replace context values. The format is: structure code1|segment1's name|segment2's name...||structure code2|segment4's name|segment5' name... 494
  • 495. Oracle Application Framework Developer's Guide, Release 12.1.3 Segments within a certain structure code are separated by a single pipe, "|", while data from a different structure codes is separated by a double pipe, "||". The example below lists segments for just one structure code: FWK Item Flexfield|Manufacturer|Product Family|Product Read-Only Segments You can add the read-only token ($RO$) after any of the segments in the list. For example, the ($RO$) designator below sets Segment1 in structure code 1 to be read-only: Structure code1|Segment1($RO$)|Segment2... Runtime Control Warning: You should create web beans programmatically only if you cannot create them declaratively. Programmatically created web beans cannot be personalized, reused, or extended easily. See the OA Framework Controller Coding Standards for additional information about this and other guidelines that you should consider when writing web bean manipulation code. If you need to programmatically create your key flexfield, the following are very important to include in your code: • Call the setStructureCode method on the OAKeyFlexBean to specify the structure for the key flexfield. • Call the setCCIDAttributeName method on the OAKeyFlexBean to specify the CCID attribute name in your view object if it does not include all the individual flexfield segments in the view object. When you input a value in a key flexfield segment and submit the page, the key flexfield determines the code combination from the combinations table (maintained by OA Framework) and sets the CCID on your view object's CCID column. If dynamic insertion is enabled for a key flexfield and you input a combination that is not in the combinations table, OA Framework will create that combination as a record in the combinations table, and return a valid CCID. If dynamic insertion is not enabled, OA Framework returns "-20" as the CCID, indicating that the input combination is not found in the combinations table and dynamic validation is turned off. The following code is an example of how to programmatically create a key flexfield: public class RegionCO extends OAControllerImpl { public void processRequest(OAPageContext pageContext, OAWebBean webBean) 495
  • 496. Oracle Application Framework Developer's Guide { super.processRequest(pageContext, webBean); OAKeyFlexBean kffBean = (OAKeyFlexBean) createWebBean(pageContext, KEY_FLEX_BEAN); kffBean.setAttributeValue(OAWebBeanConstants.VIEW_USAGE_NAME, "FNDFlexTestVO"); kffBean.setAttributeValue(OAWebBeanConstants.FLEXFIELD_APPLICATION_SHO RT_NAME, applicationShortName); kffBean.setAttributeValue(OAWebBeanConstants.REGION_APPLICATION_ID, new Integer(applicationId)); kffBean.setAttributeValue(OAWebBeanConstants.FLEXFIELD_NAME,idFlexCode ); kffBean.setCCIDAttributeName("UniqueIdColumn2"); kffBean.setStructureCode(idFlexStructureCode); //optional: kffBean.setDynamicInsertion(isdynamicInsertion); //set dynamic insertion kffBean.setAttributeValue(OAWebBeanConstants.FLEXFIELD_SEGMENT_LIST, segmentList); //set segmentlist kffBean.useCodeCombinationLOV(false); //if you need old style key flexfield in 5.10 mode } 496
  • 497. Oracle Application Framework Developer's Guide, Release 12.1.3 public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); } } You should also consider these other key flexfield runtime control topics: • Merging Key Flexfield Segments with the Parent Layout • Handling Dynamic Insertion • Read Only and Rendered Bound Values • Adding a VRule to a Key Flexfield Web Bean Merging Key Flexfield Segments with the Parent Layout By default, flexfield segments are aligned within themselves but they are not aligned within the whole (parent) region. If you want to merge key flexfield segments to the parent layout, you must find the OAKeyFlexBean by attribute name and call the method mergeSegmentsWithParent on OAKeyFlexBean. The following code example merges key flexfield segments to its parent layout. In this example, KeyFF is the item name (of the item with the style flex) in your region: public class RegionCO extends OAControllerImpl { public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); //find the flexfield that is defined in this region as item "KeyFF" and merge each //individual segment to the outside layout 497
  • 498. Oracle Application Framework Developer's Guide OAKeyFlexBean kffBean = (OAKeyFlexBean)webBean.findIndexedChildRecursive("KeyFF"); flexBean.setStructureCode("FWK Item Flexfield"); flexBean.setCCIDAttributeName("FwkitemId"); flexBean.mergeSegmentsWithParent(pageContext); } public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); } } Handling Dynamic Insertion If you wish to handle dynamic insertion yourself, you must first disable dynamic insertion by calling setDynamicInsertion(false)on the OAKeyFlexBean. Additionally, the submitButton for the page that contains the key flexfield must have its validation disabled. Note: For additional information about dynamic insertion, refer to the "Dynamic Insertion" section of Chapter 2 ("Planning and Defining Key Flexfields") in the Oracle E-Business Suite Flexfields Guide Release 12. Read Only and Rendered Bound Values If you have to implement a flexfield in a table, where the flexfield is read-only or rendered in some rows and not others, you can do so programmatically using bound values. There is currently no declarative support for this. First, create your bound value using OADataBoundValueViewObject or some other boundValue class. Then set the attribute in your controller's processRequest method as shown in the examples below: kffBean.setAttributeValue(READ_ONLY_ATTR,boundValue); or 498
  • 499. Oracle Application Framework Developer's Guide, Release 12.1.3 kffBean.setAttributeValue(RENDERED_ATTR,boundValue); Adding a VRule to a Key Flexfield Web Bean A VRule is a validation rule that allows you to put extra restrictions on what values a user can enter in a key flexfield segment based on the values of segment qualifiers (which are attached to individual segment values). Additional Information: Refer to the "Qualifiers" topic in Chapter 2 ("Planning and Defining Key Flexfields") of the Oracle E-Business Suite Flexfields Guide Release 12 for further discussion of flexfield and segment qualifiers. You can add one or more VRules to a key flexfield web bean by using the addVRule method on OAKeyFlexBean. This method allows you to specify the flexfield qualifier and segment qualifier to validate, validation value(s) for the segment qualifier, whether to Include (true) or Exclude (false) the user entered value if its segment qualifier matches the specified validation value, and the Message Dictionary error message to display if the user enters an improper value. See the addVRule Javadoc for complete usage information about this method. This method should be called before the processFlex or mergeSegmentsWithParent methods. As an example, suppose you implement a page where you want to prevent your users from entering segment values into segments of Oracle General Ledger's Accounting Flexfield, for which detail posting is not allowed. DETAIL_POSTING_ALLOWED is the segment qualifier, based on the global flexfield qualifier GL_GLOBAL, that you want to use in your rule. You want to exclude all values whose segment qualifier value of DETAIL_POSTING_ALLOWED is N (No). Your message name is "GL Detail Posting Not Allowed", and it corresponds to a message that says "you cannot use values for which detail posting is not allowed." You would add this VRule as follows: kffbean.addVRule (GL_GLOBAL, DETAIL_POSTING_ALLOWED, "GL Detail Posting Not Allowed", false, N); When a user enters an excluded value in one of the segments affected by this qualifier, the user gets the error message specified. In addition, the excluded values do not appear in the LOV of your segments. All other values, not specifically excluded are displayed. Additional Information: For more information about VRules, refer to Chapter 9 ("Key Flexfield Routines for Special Validation") in the Oracle E-Business Suite Flexfields Guide Release 12. Personalization Considerations • See a summary of Flexfields personalization considerations in the Oracle Application Framework Personalization Guide. 499
  • 500. Oracle Application Framework Developer's Guide Reference Fields A reference field is a web bean that participates in evaluating one or more properties of a flexfield, such as default segment value, value set and context reference field for Descriptive flexfields. Such reference web beans are mapped to :$PROFILES$.*<NAME> references that are used in flexfields' properties. <NAME> can take any alphanumeric value thus providing a potentially infinite namespace of named parameters that can be passed from the OA Framework UI to the flexfield definition. Named parameters are mapped to reference web beans using flexfield maps. Whenever the value in the reference web bean changes, the page is refreshed with changes to the corresponding flexfield properties. The reference web bean display value is used for substituting the references in the properties. Note: OA Framework does not have explicit support for :<BLOCK>.<FIELD> references that map fields in a form to a flexfield in Forms-based applications. If a flexfield used in a Forms- based application is to be re-used in an OA Framework based application, all the :<BLOCK>.<FIELD> references should be replaced with :$PROFILES$.*<NAME> references. Declarative Implementation: By default no flexfield maps metadata exists under a flex item. The following steps describe how to set up reference fields by adding flexfield maps to a flex item: 1. Right click on the flex item and select New > flexMaps 2. Specify a standards-compliant ID, an Attribute Set and other properties as usual for any item. 3. Specify the parameter name in the Name property of the flex maps. For example, if your Flexfield definition uses a named parameter $PROFILE$.*paramName, then set the Name property as *paramName. 4. Specify the value or value binding that needs to be set on the parameter. The value can be one of the following: o A Constant Value o A View attribute, represented by SPEL (Simplest Possible Expression Language) as${oa.<viewUsage>.<viewAttribute>} o The name of the web bean on the current OA Framework page that will act as the reference field, represented by the SPEL - ${oa.page.<referenceId>} 5. (Optional): (Only for Descriptive Flexfields) Set the Refer Context property to true if this flex map acts as a Reference Field. Repeat the above steps for creating as many flex maps as there are references. Runtime Control: You can also access or modify the flex map metadata to remove the existing flex maps programmatically. Doing so, can override the behavior due to flex map metadata. public void processRequest(OAPageContext pageContext, OAWebBean webBean) 500
  • 501. Oracle Application Framework Developer's Guide, Release 12.1.3 { super.processRequest(pageContext, webBean); ... OADescriptiveFlexBean flexBean = (OADescriptiveFlexBean)webBean.findIndexedChildRecursive("FlexItem"); OAFlexMaps flexMaps = new OAFlexMaps(); if (dffBean != null) { flexMaps = flexBean.processFlexMap(pageContext); } flexMaps.remove("flexMap"); OAWebBean referenceField = webBean.findChildRecursive("referenceItem"); OAFlexMap map1 = new OAFlexMap("flexMap1", new OABoundValueFlexReference(referenceField), "*paramName", true); flexMaps.add(map1); flexBean.setFlexMaps(flexMaps); ... } If you need to programmatically create flexfield maps for your flexfield, you can include code similar to the example below in your controller's processRequest method. In the following example, flexBean is the flexfield web bean that contains the new flexfield maps and referenceItem is the Name of the reference web bean. public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); ... OAWebBean rootBean = pageContext.getRootWebBean(); OAWebBean referenceBean = 501
  • 502. Oracle Application Framework Developer's Guide rootBean.findIndexedChildRecursive("referenceItem"); OAFlexMaps flexMaps = flexBean.getFlexMaps(); if (flexMaps == null) flexMaps = new OAFlexMaps(); OAFlexMap map = new OAFlexMap("flexMap", new OABoundValueFlexReference(referenceBean), "*paramName"); flexMaps.add(map); flexBean.setFlexMaps(flexMaps); ... } Note the following important restrictions: • OABoundValueFlexReference is the equivalent of the SPEL binding ${oa.page.<id>}. The OAFlexMap can take an optional fourth parameter of Boolean type. A true value indicates that value change in this field is going to trigger a change in the Context field. Please refer to the Javadoc of OAFlexMaps for more details. • When a flex map is defined for a context reference field (of a descriptive flexfield) and the synchronize context flag is selected in the Flexfield definition, then the context field is disabled in the UI as the context reference web bean will act as the single source for the context. • When a flex item is in update mode and the value derived from the view object row associated with this flexfield is different from the value supplied in the reference web bean, the following message displays: "The value in flexfield context reference web bean does not match with the value in the context of the Descriptive flexfield web bean PermitFlex. If this is not intended, please go back to correct the data or contact your Systems Administrator for assistance." • OA Framework will associate a standard flex event with the name "FlexReferenceUpdate" with any reference web bean. If the reference web bean is already associated with an event, an error would be thrown indicating that this web bean cannot act as a reference web bean. Usage Restrictions 1. If a reference web bean is to have a default value, then this should be set either declaratively or in the processRequest of a controller of any of the container region of the flex web bean. 2. Reference web beans cannot be under a Table, an Advanced Table or an HGrid. 3. Refer to known flexfield issues for other restrictions. Personalization Considerations • See a summary of Flexfields personalization considerations in the Oracle Application Framework Personalization Guide. • System Administrator can create flexMaps using personalization UI. Values and Value Sets 502
  • 503. Oracle Application Framework Developer's Guide, Release 12.1.3 Generally, the value entered in a key or descriptive flexfield segment is validated against a predefined set of valid values (a "value set"). When you define your value set, you can specify the types of values that can fit into the value set by setting up formatting rules. The validation type that you specify for your value set will determine how a user can enter or use the segment in the flexfield. The validation types are: • None - no validation, so a value can be entered as long as it meets the formatting rules. • Independent - provides a predefined list of values for a segment that are stored in an Oracle Application Object Library table. • Table - provides a predefined list of values like an independent value set, but its values are stored in an application table. The values are defined by the table you specify and the WHERE clause that limits the values to use in the set. You can use bind variables such as $FLEX$ and $PROFILES$ in your WHERE clause to base your list of possible values on other values. For example, $PROFILES$ lets you bind the value to a specific profile option and $FLEX$ lets you bind to the value of a prior segment. Additional Information: Refer to the topic "Bind Variables" in Chapter 4 ("Values and Value Sets") of the Oracle E-Business Suite Flexfields Guide Release 12 for details on how to use these bind variables. • Dependent - provides a predefined list of values, but the values depend on the independent value specified in a prior segment of the flexfield structure. • Translatable Independent and Translatable Dependent - similar to Independent and Dependent value sets, respectively, except that a translated value can be used. • Special and Pair Value Sets - these value sets provides a mechanism to pass key flexfield segment values or combinations as report criteria for Standard Request Submission (also referred to as a "flexfield-within-flexfield"). The "Special" and "Pair" validation types are not yet supported in OA Framework and will result in a developer mode error if specified. Additional Information: To learn more about defining a report parameters window (descriptive flexfield) for Standard Request Submission or about "Special" or "Pair" value sets, refer to Chapter 7 ("Standard Request Submission") in the Oracle E-Business Suite Flexfields Guide Release 12. When a value set's list type is 'Poplist' or 'List of Values', OA Framework automatically renders the segment as a poplist or a LOV, respectively. Additional Information: To learn more about value sets, refer to Chapter 4 - "Values and Value Sets", in the Oracle Applications Flexfields Guide Release 12. Flexfield Validation When you implement a page with an Action (Submit) Button, you have the option of setting the page submit, when the button is selected, to be 'validated' or 'unvalidated'. The behavior of a flexfield in such a page will vary depending on whether you set the submitButton properties Disable Server Side Validation and Disable Client Side Validation to true or false. 503
  • 504. Oracle Application Framework Developer's Guide Note: For Flexfields, to address backwards-compatibility, setting either the Disable Server Side Validation or Disable Client Side Validation property to true disables ALL validation, that is, both server and client validation.) The following table describes a flexfield's behavior when both the client and server validation is disabled and enabled. Disable Validation Effect on Flexfield Behavior (Client and/or Server) False 1. On the client side, client Javascript checks for required field(s) and date format(s) and displays a Javascript error if error is found. 2. On the server side, all data entered in the UI is posted to the FlexJ object, and if any segment input data is invalid (such as a wrong format), an error is thrown. 3. The FlexJ object.validate method is called to validate the whole flexfield. If there is any error, an exception is thrown on the UI. 4. If all validation passes, the data is populated to the view object. True 1. Any client Javascript is not triggered. 2. On the server side, when all data is posted to the FlexJ object, if any user input for any segment has an invalid format, the value is discarded, but no error will be thrown. 3. The FlexJ object.validate method is not called. 4. All data is posted to the view object as is. An example of when you may want an unvalidated submit is when you have a descriptive flexfield in a Search region. Flexfields and Standard Request Submission The Report Parameters window for Standard Request Submission (SRS), that allows users to enter criteria for their reports, is a special descriptive flexfield. While many of the setup steps for Report Parameters are similar to that of a descriptive flexfield, the main differences are that you use the Concurrent Programs window to define your segments instead of using the Descriptive Flexfield Segments window and the way you define and use value sets for SRS report parameters is more complex. Additional Information: Refer to Chapters 7 ("Standard Request Submission") and 8 ("Reporting on Flexfields Data") in the Oracle E-Business Suite Flexfields Guide Release 12. If you want to provide a flexfield as a report parameter (also referred to as a flexfield-within-a- flexfield), you can use a flexfield routine to specify the type of flexfield you want as a value set for the report parameter. 504
  • 505. Oracle Application Framework Developer's Guide, Release 12.1.3 Additional Information: Chapter 9 ("Key Flexfield Routines for Special Validation") in the Oracle E-Business Suite Flexfields Guide Release 12 lists the syntax for the key flexfield routines. Developer Mode Errors Oracle E-Business Suite throws a developer mode error if any of the following flexfield implementations are detected: • A reference field is used in flexfield. • A pair value set is used in flexfield. • A special value set is used in flexfield. • A flexfield is in a Table-in-Table layout. • A flexfield is directly put in a Message layout. • A flexfield is in a Query bean layout Troubleshooting Flexfield Problems If your flexfield is not working as expected or there is an error on the flexfield, you can follow these troubleshooting steps to help identify the source of the problem: Step 1: Check your flexfield setup. Login to your Oracle E-Business Suite Forms-based environment as an applications developer, and navigate to the Segments window (Flexfield > Descriptive/Key > Segments). Identify the flexfield you are using, then make sure the Freeze Flexfield Definition checkbox is checked for this flexfield. Compile the flexfield again. If your flexfield is using some feature that is not supported by OA Framework page, a warning message will appear. Step 2: Run the Flexfield Test tool under the guidance of your support representative. Login to your Oracle E-Business Suite Forms-based environment as an applications developer, and navigate to the Flexfield Text window (Flexfield > Flexfield Test). Identify the flexfield you are using and follow the instructions provided by your support representative to use the Flexfield Test window. Step 3: Check if there is any developer mode error for your flexfield on the OA Framework page. At run time, OA Framework checks if the flexfield is properly configured and used. If it finds anything wrong with the flexfield, OA Framework renders a developer mode error on the page as well as lists these errors, if any, in the "About" Page. To enable Developer Test Mode diagnostics, you must set the profile option FND: Developer Mode / FND_DEVELOPER_MODE to Yes. To render the "About this page" link at the bottom of every OA Framework page, you must set the profile option FND: Diagnostics / FND_DIAGNOSTICS to Yes. Step 4: Use the "About" page to get more information about the flexfield. 505
  • 506. Oracle Application Framework Developer's Guide On the bottom of every OA Framework page, there is an "About this page" link (if the profile option FND: Diagnostics / FND_DIAGNOSTICS is set to Yes). When you open the "About" page, you can see the page structure as well as the flexfield detail information in the Page tab. All flexfield information is listed in the Flexfield References section, including: • The flexfield name and Applications ID. • Detail information about each segment, such as segment name and segment value set. • Whether there is any developer mode error for the flexfield. Known Issues • See a summary of known flexfield issues with suggested workarounds if available. • The specified reference field should exist in the current OA Framework page. • A standard flex event with the name "FlexReferenceUpdate" event would be associated with the reference bean specified. If the reference bean already is associated with an action, an error would be thrown indicating the bean specified cannot act as a reference field. • When a flex item is in update mode and the value derived from the view object row associated with this flexfield is different from the value supplied in the reference web bean, the following message displays: "The value in flexfield context reference web bean does not match with the value in the context of the Descriptive flexfield web bean PermitFlex. If this is not intended, please go back to correct the data or contact your Systems Administrator for assistance." • If there are multiple reference fields for the same property of a field, the order in which the field is taken into consideration is uncertain. • A reference field cannot be under a Table or Advanced Table or H-Grid. Related Information o BLAF UI Guideline(s)  Flexfields [OTN version] o Javadoc File(s)  oracle.apps.fnd.framework.webui.beans.OADescriptiveFle xBean  oracle.apps.fnd.framework.webui.beans.OAKeyFlexBean  oracle.apps.fnd.framework.webui.beans.OAWebBean  oracle.apps.fnd.framework.OAFlexUtils  oracle.apps.fnd.framework.webui.OAFlexMap  oracle.apps.fnd.framework.webui.OAFlexMaps  oracle.apps.fnd.framework.webui.OABoundValueFlexRefere nce o Lesson(s)  Framework Toolbox Tutorial Supplemental Lesson: Creating Descriptive and Key Flexfields o ToolBox Tutorial / Sample Library o FAQs 506
  • 507. Oracle Application Framework Developer's Guide, Release 12.1.3  Flexfields 507
  • 508. Oracle Application Framework Developer's Guide Forms / OA Framework Page Integration Overview Both OA Framework and Oracle E-Business Suite provide support for the integration of Oracle Forms-based Oracle E-Business Suite forms with OA Framework-based pages. You can launch an Oracle E-Business Suite form from an OA Framework page as well as call an OA Framework HTML page from an Oracle E-Business Suite form. Contents • Launching Oracle E-Business Suite Forms from OA Framework Pages • Launching OA Framework Pages from Oracle E-Business Suite Forms Launching Oracle E-Business Suite Forms from OA Framework Pages To launch an Oracle E-Business Suite form from OA Framework, you must first define a button, link or image web bean. The web bean then relies on the FormsLauncher applet provided by Oracle E-Business Suite (AOL/J) to launch the specified form. Declarative Implementation Step 1: In the OA Extension Structure pane, select the region in which you want to create the web bean to launch an Oracle E-Business Suite form. Choose New > Item from the context menu. Step 2: Set the ID property for the item, in accordance with the OA Framework File Standards, and set the Item Style property to button, image, or link. You may also launch an Oracle Applications form from a submit button. See the Runtime Control section below for more details. Step 3: Set the Destination URI property of the item with a value following this format (replacing the italicized text as appropriate): form:responsibilityApplicationShortName:responsibilityKey:securityGroupKey:functionN ame For example, if you want to launch the FND Menus form, the Destination URI property should be set to: form:SYSADMIN:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDMNMNU Step 4: If you wish to pass parameters to the form, set the Destination URI property with a value using the following format (Note that the parameter list is delimited by a space between each "parameter=value" pair): 508
  • 509. Oracle Application Framework Developer's Guide, Release 12.1.3 form:responsibilityApplicationShortName:responsibilityKey:securityGroupKey:functionN ame:param1=value1 param2=value2 param3=value3 Note: If you wish to send varchar2 parameter values that contain spaces, use " to enclose the string value. For example, to pass in something of the form: TXN_NUMBER=LT INVOICE 1 Use: TXN_NUMBER="LT INVOICE 1" Step 5: Refer to the following Chapter 4 topics for information about additional properties you may need to set for the specific item: Buttons(Action/Navigation), Buttons (Links), or Images in Your Pages. Runtime Control There are no special programmatic steps necessary to launch an Oracle E-Business Suite form from a button, image, or link in an OA Framework page. The OAButtonBean, OALinkBean and OAImageBean support the special form function URL format described above for the Destination URI property. When OA Framework encounters this special value, it generates the appropriate URL and also adds a hidden IFrame (inline frame) to the OA Framework page. The hidden IFrame is the target of the FormsLauncher applet provided by Oracle E-Business Suite. Launching an Oracle E-Business Suite Form From a Submit Button If you wish to launch an Oracle E-Business Suite form from a submit button in an OA Framework page, you must use the OAPageContext.forwardImmediatelyToForm(String url) method from oracle.apps.fnd.framework.webui.OAPageContext. An example of how to use this API is shown in the code sample below: public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); if (pageContext.getParameter("Apply")!=null) { String destination = "form:SYSADMIN:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDMNMNU"; 509
  • 510. Oracle Application Framework Developer's Guide pageContext.forwardImmediatelyToForm(destination); } } Usage Notes Microsoft Internet Explorer supports the IFrame element, so when you launch an Oracle E- Business Suite form from OA Framework, only a splash window appears. Any other windows required by the FormsLauncher applet use(s) the hidden IFrame as the target and therefore remain(s) hidden from the user. Netscape Navigator, on the other hand, does not support the IFrame element, so in addition to a splash window, the user also sees another window used by the FormsLauncher applet. Launching OA Framework Pages from Oracle E-Business Suite Forms Declarative Implementation To launch an OA Framework page from Oracle Forms-based Oracle E-Business Suite forms, you must define a function to represent the OA Framework page. A function based on an OA Framework page is defined in exactly the same way as any other function in Oracle E-Business Suite. You define the function in the Oracle E-Business Suite Form Functions form and specify the function's Type, as JSP. Refer to the Oracle E-Business Suite Developer's Guide for more information. The function you define is automatically identified by the Oracle E-Business Suite menu and no further action is needed. Runtime Control If you wish to call the OA Framework page function directly from an Oracle Applications form, you must use the following Oracle E-Business Suite API: PACKAGE FND_FUNCTION IS procedure EXECUTE(function_name in varchar2, open_flag in varchar2 default 'Y', session_flag in varchar2 default 'SESSION', other_params in varchar2 default NULL, activate_flag in varchar2 default 'ACTIVATE', browser_target in varchar2 default NULL); You can also pass additional parameters via other_params using a URL format, such as name1=value1&name2=value2... For example: 510
  • 511. Oracle Application Framework Developer's Guide, Release 12.1.3 fnd_function.execute( function_name => 'OKE_OKEKVCOM' other_params => 'headerid='||:parameter.k_header_id|| '&Ver1='||:compare_version.version1|| '&Ver2='||:compare_version.version2); Note: There is no ampersand (&) in front of the first parameter name/value pair, but there is an ampersand in front of subsequent parameter name/value pairs. Note: The open_flag and session_flag parameters are not shown in the above example because they are redundant for an HTML function. Personalization Considerations • See a summary of Forms / OA Framework Page Integration personalization considerations in the Oracle Application Framework Personalization Guide. Known Issues • None Related Information • BLAF UI Guideline(s) • Javadoc File(s) • Lesson(s) • Sample Code 511
  • 512. Oracle Application Framework Developer's Guide Headers and Subheaders Overview Per the BLAF UI Guide: Headers and Subheaders [ OTN Version ]specification, the header component is used to title and separate page contents as illustrated below. Figure 1: Example of headers, subheaders and subsubheaders in a page. Primary Header (Page Title) All pages, except for the "Home" page, should have a page title that describes the page's contents. Not only does this text provide useful information to the user, but the OA Framework also uses this value to: • Determine whether page-level action/navigation buttons render both below the page contents bottom line (the "ski") and the page title as shown in Figure 2 below. If you don't specify a page title, these buttons render below the "ski" and not at the top of the page • Set breadcrumb text when you drill down from the page (if the page title property isn't set, the framework will use the browser window title instead -- and if you've followed the UI guidelines in setting the window title, your breadcrumbs will be incorrect) Figure 2: Example of page-level action/navigation buttons rendering below the page title (displayed with the text "Header 1"), and below the "ski" 512
  • 513. Oracle Application Framework Developer's Guide, Release 12.1.3 Declarative Implementation To add a page title, simply specify the Title property for your pageLayout region. Note: The pageLayout region also has a Window Title property which is used to specify the browser's window title. This has nothing to do with specifying the page title. Warning: Although your page may appear to have a page title if you add a header or one of the "default" regions to your pageLayout, the OA Framework does not interpret this as a page title. You must explicitly specify the region property as described. Runtime Control Warning: See the OA Framework Controller Coding Standards for guidelines that you should consider when writing web bean manipulation code. Instantiate Since the page title is a property of the page layout itself, you can't instantiate a page title directly. Instead, you set it on the oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean as shown below. Control Visual Properties To set the page title programmatically (which is a common practice if you need to specify context for the header like you would with "Update Employee: Fred Flintstone"), do the following: import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean; ... 513
  • 514. Oracle Application Framework Developer's Guide processRequest(OAPageContext pageContext, OAWebBean webBean) { ... // Assuming the controller is associated with the pageLayout region OAPageLayoutBean page = (OAPageLayoutBean)webBean; // Assuming the controller is associated with a child/grandchild region of the // pagelayout region OAPageLayoutBean page = (OAPageLayoutBean)pageContext.getPageLayoutBean(); // Always set translated text Strings obtained from Message Dictionary page.setTitle(<title text>); ... See Example: Implementing Search & Drilldown to Details for a more detailed example of setting a contextual page title. Subheaders The UI guidelines allow for two levels of subheaders below the page title: a "subheader" and a "subsubheader" as shown in Figure 1 above. Declarative Implementation • To add a subheader to your page add a region with one of the styles listed in Figure 3 to a pageLayout. • To add a subsubheader, add a region with one of the styles listed in Figure 3 to any subheader. Remember to specify its ID property in accordance the OA Framework Package / File / Directory naming standards. In both cases, the framework automatically indents the header in relation to its parent region, and sizes the header text in accordance with the UI guidelines. 514
  • 515. Oracle Application Framework Developer's Guide, Release 12.1.3 Tip: The classes corresponding to each of the "default" region styles subclass oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean, so they all behave as headers in your page. If you want to use these regions as layout templates, and you don't want the header line to show, set the Hide Header property to True. Figure 3: Relationship between header region styles and OA Framework classes Region Style OA Framework Class header oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean defaultSingleColu oracle.apps.fnd.framework.webui.beans.layout.OADefaultSin mn gleColumnBean defaultDoubleCol oracle.apps.fnd.framework.webui.beans.layout.OADefaultDou umn bleColumnBean hideShowHeader oracle.apps.fnd.framework.webui.beans.layout.OAHideShowHe aderBean The OADefaultSingleColumnBean and OADefaultDoubleColumnBean classes have been deprecated. In their place, you should use a combination of an OAHeaderBean followed by an oracle.apps.fnd.framework.webui.beans.layout.OAMessageComponentLayoutB ean. See Page Layout (How to Place Content) for additional information. Runtime Control Warning: You should create web beans programmatically only if you cannot create them declaratively. Programmatically created web beans cannot be personalized, reused, or extended easily. See the OA Framework Controller Coding Standards for additional information about this and other guidelines that you should consider when writing web bean manipulation code. Instantiate You can instantiate any of the classes described above by calling the appropriate createWebBean() method in the oracle.apps.fnd.framework.webui.OAControllerImpl class. If you select a signature that requires a constant to determine what kind of bean to create, use the following for each class: Figure 4: OAWebBeanConstants for creating corresponding OA Framework classes Constant OA Framework Class OAWebBeanConstants.HEADER_BEAN OAHeaderBean OAWebBeanConstants.DEFAULT_SINGLE_COLUMN_BEA OADefaultSingleColumnBea N n OAWebBeanConstants.DEFAULT_DOUBLE_COLUMN_BEA OADefaultDoubleColumnBea 515
  • 516. Oracle Application Framework Developer's Guide N n OAWebBeanConstants.HIDE_SHOW_HEADER_BEAN OAHideShowHeaderBean Note: You should not instantiate and programmatically add contents to any of the "default" regions. You may, however, instantiate regions that you define declaratively in JDeveloper. Control Visual Properties To change the header's text value, get a handle to the right class (based on what you instantiated, or specified declaratively) and call setText(OAPageContext pageContext, String text). To achieve the correct text size as specified in the UI Guidelines when headers are used in side navigation components, or displayed in the "Home" page main content area (in an "At a Glance" region, for example), call setSize(int size) on the header bean with one of the following values. • 0 - the "large" size • 1 - the "medium" size (used for headers displayed in the "Home" content page area). • 2 - the "small" size (used for headers added to side navigation components) See the ToolBox Sample Library for an example of a "Home" page including headers in the main content area and in a side navigation component. To set the associated icon in your processRequest method, call setIcon(String icon) as shown: header.setIcon(OAWebBeanConstants.APPS_MEDIA_DIRECTORY + "<icon_name>.gif"); Note: In R12, the header region without a title appears as a long blue line. Adjacent Subheaders The UI Guidelines allow multiple subheaders to be used side-by-side in a page a shown in Figure 4. Figure 4: Example of adjacent subheaders. 516
  • 517. Oracle Application Framework Developer's Guide, Release 12.1.3 Declarative Implementation You create the headers themselves as described in the Subheaders section above. Creating the layout to hold you adjacent subheaders is a different matter. For help with creating complex layouts declaratively, see Page Layout (How to Place Content). Runtime Control For any programmatic changes to the headers, also see the Subheaders section. Headers in Side Navigation You can also add headers to side navigation controls as shown in Figure 5. Figure 5: example of headers in side navigation Declarative Implementation 517
  • 518. Oracle Application Framework Developer's Guide Currently, you can't add a Side Navigation (including a header) to your page declaratively. See the Tabs / Navigation document for instructions on creating a Side Navigation component. Once you've created your Side Navigation, you simply add your header to it as you would to any other component. Runtime Control Control Visual Properties When you add a header to a container, the OA Framework automatically sets the text and line colors based on the corresponding background color. You do not need to set any color properties. The only change that you're likely to make to a header when you add it to a side navigation is to change the size of the header text since this is not configured automatically. Note: You cannot configure header text size by setting a CSS style; this is not supported. See the instructions for changing the header size in the Subheaders section above. Hide/Show Subheaders • See the Hide/Show documentation for a description of this feature and implementation instructions Known Issues • None Related Information • BLAF UI Guidelines: o Headers and Subheaders [ OTN Version ] o Locator Element (Breadcrumbs) [ OTN Version ] • Developer's Guide: o Hide/Show o Content Containers o Page Layout (How to Place Content) • Javadoc o oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBe an o oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean o oracle.apps.fnd.framework.webui.beans.layout.OAHideShowHead erBean o oracle.apps.fnd.framework.webui.beans.layout.OADefaultSingl eColumnBean o oracle.apps.fnd.framework.webui.beans.layout.OADefaultDoubl eColumnBean 518
  • 519. Oracle Application Framework Developer's Guide, Release 12.1.3 o oracle.apps.fnd.framework.webui.beans.layout.OAMessageCompo nentLayoutBean • ToolBox Tutorial / Sample Library 519
  • 520. Oracle Application Framework Developer's Guide HGrid Overview A HGrid, otherwise known as a hierarchy grid, allows users to browse through complex sets of hierarchical data. Certain types of data, such as the organizational structure of employees within a company, are naturally hierarchical and best displayed as a tree structure. There are two UI components that display hierarchical information on a page: the HGrid web bean and the Tree web bean. A Tree is generally used when you want to put emphasis on the hierarchy and the relationship between different sets of objects in a hierarchy. A HGrid is more appropriate when you want to display the hierarchy, but also give more detailed information at each node of the hierarchy. Consider using a HGrid instead of a Tree when you want your users to either: • Manipulate the objects in the hierarchy (add, delete, move, reorder, etc.). Note that in certain cases, you may want your users to navigate from a Tree to a HGrid to perform these actions. This is done by providing a button that switches to an "update" or "edit" mode, which displays a HGrid instead of a Tree. • See more object details than can be displayed in a Tree, plus the amount of required detail per object does not warrant use of a Tree with a Master/Detail view. Following is an example of a HGrid. 520
  • 521. Oracle Application Framework Developer's Guide, Release 12.1.3 A HGrid consists of the following components/features, as pointed out in the figure above: 1. Breadcrumbs 2. Focus icon 3. Expand node arrow 4. Collapse node arrow 5. Focus column 6. Object hierarchy column 7. Multiple selection 8. Control bar 9. Selection/Expansion control 10. Root node 11. Record navigator Each row in a HGrid corresponds to a tree node. A HGrid also has two special columns: a focus column and an object hierarchy column. The object hierarchy column identifies the current tree 521
  • 522. Oracle Application Framework Developer's Guide node and allows you to expand or collapse this node. When you expand on a node that contains more records than the defined record set size, "Next" and "Previous" record navigation links appear. If the total number of records is known, the record navigation links also display the record set range and the total number of records. The focus column allows you to select a new root for the tree. You can zoom into a sub-tree of a massive tree by selecting the focus icon for that sub-tree row. The HGrid also renders bread crumbs, allowing you to focus out (or zoom out) of the current sub-tree, and renders links to allow you to quickly expand or collapse all the nodes under the current focus root. This document describes the declarative definition and APIs provided by the HGrid (oracle.apps.fnd.framework.webui.beans.table.OAHGridBean) component within OA Framework. As described in the Oracle Browser Look-and-Feel (BLAF) UI Guideline: HGrid [OTN version] specification, the HGrid feature shares many properties with tables, most notably that it is a display of information in tabular format. The main difference between the two is that a table displays a flat list of objects, whereas a HGrid displays objects in a hierarchy. You should be familiar with the construction of a table (setting up the metadata as well as the business components). If you are not familiar with tables, please take a quick look at the Tables documentation before proceeding. Contents • Defining Business Components • Declarative Implementation o Defining a HGrid o Enabling Search on a HGrid • Runtime Control o processRequest method o processFormRequest method o Getting and Setting the Initial Focus Path o Deleting Rows in a HGrid o Using FireAction on the Hierarchy Column o Using Save Model on the Hierarchy Column o Per Row Dynamic Poplist o Getting a Hold of the viewInHierarchy Named Child's Link Web Bean o Preserving HGrid State  HGrid Data Proxy in UIX  Proxy Use in the OA Framework  Support for Dynamic HGrids o Optimizing Child Row Retrieval • Personalization Considerations • Known Issues • Related Information Defining Business Components As with all other beans supported by OA Framework, the data for the HGrid component is derived from BC4J objects. Just as the HGrid displays data in hierarchical format, the structure of the source data is also hierarchical, based on multiple view objects connected via view links. 522
  • 523. Oracle Application Framework Developer's Guide, Release 12.1.3 Each instance of a view object is connected to the HGrid at a particular level, allowing the HGrid to display all the rows in range at that level. The view links that define the parent-child relationship between a row in the master view object and the detail view object allow you to drill down in the HGrid and show details at the next level. When a user selects the hide/show (expand/collapse node arrow) to show more details, OA Framework traverses the view link and fetches/displays all the detail records for the master row that is selected. Note: It is possible to use a different view object for the children rows as long as the parent view object and the child view object share the same attribute names. The reason for this becomes clear when setting up OA Extension metadata. An unlimited number of view links can be used to define the necessary parent-child relationships at each level of the hierarchy. When defining a HGrid in OA Extension, specify the name of the view link instance for each node that is used to drill down to the correct detail view object instance. To ensure that the HGrid performs well, the view objects and view links defined must be efficient. In general, the view links get fired at each level to determine whether or not there are children. As a result, multiple queries are performed if there are multiple nodes displayed at a level, therefore, record navigation is recommended for better performance. Note: If your data model supports it, designate an alternate master view object attribute as the one to use to determine whether there are children. This avoids the need to fire multiple view link queries. Each row in a view object provides data for a corresponding row in the HGrid at each level. An initial instance (top most) of the view object should return the root node of the HGrid. This top level view object should return exactly one row. The HGrid component relies heavily on the notion of hierarchical data with a unique root. If the top level view object returns multiple rows of data, those rows are automatically made children of a dummy root node. The automatically generated parent dummy node renders as non-selectable and expanded. Note: You cannot get a handle to this dummy node as it is generated internally and does not map to any row or view object attached to the HGrid. The first step in defining a HGrid is to define the business object hierarchy that maps to your business requirements. To illustrate the above, build a simple HGrid example to display supervisor-employee hierarchy information. Note: Some of the data model is greatly simplified for this example.) The data for each employee comes from the PER_ALL_PEOPLE_F view. Each employee is uniquely identified by the PERSON_ID column in this view. The PER_ALL_ASSIGNMENTS_F view describes the supervisor-employee relationship through the SUPERVISOR_ID and PERSON_ID columns in this view. Step 1: Set up a view object definition for the PER_ALL_PEOPLE_F view, selecting the data that you want to display in the HGrid. Download 523
  • 524. Oracle Application Framework Developer's Guide oracle.apps.fnd.framework.persontree.server.PerAllPeopleFVO as an example. You can also download the corresponding VOImpl class. Note: The initQuery method in the VOImpl adds an additional where clause to the view object to fetch the root node. Step 2: Define the view link used to retrieve subsequent levels of the HGrid. In this example, define a view link that links the PerAllPeopleFVO to itself. a. In JDeveloper, select the package where you want to add the view link. From the context menu, choose Create View Link ... to display the "View Link Wizard". b. In the View Link Wizard, Step 1 of 6: Name, enter a name for the view link. (In this example use PerAllPeopleFVL). c. In Step 2 of 6: View Objects, choose the source and destination view objects. (In this example use PerAllPeopleFVO as both the source and destination). d. In Step 3 of 6: Source Attributes, select the source attributes. These are typically the primary key attributes (or a subset thereof) of the source view object. Select any other columns that are needed to build the where clause used to fetch the detail row set. The values of these attributes from the master view object are used to determine the detail row set. (In this example, use the PERSON_ID column as discussed earlier). e. In Step 4 of 6: Destination Attributes, select the destination attributes (as in the previous step). f. In Step 5 of 6: View Link SQL, build the where condition used to get the detail row set. The default where clause simply contains a one-to-one mapping of the source and destination attributes. The bind variables are bound with values of the source attributes in the master row. (In this example, use the PER_ALL_ASSIGNMENTS_F view to determine all the persons supervised by the person in the master row). In other words, construct a where clause as follows: person_id in (select person_id from per_all_assignments_f where supervisor_id = :1) g. In Step 6 of 6: View Link Properties, ensure that the Generate Accessor in View Object checkbox is checked for both the Source and Destination view objects. The accessor name is generated automatically but you can change it if desired. h. Download the complete definition for PerAllPeopleFVL. Setup additional view links if the master-detail relationships at each level of the HGrid are different. Step 3: Add the view objects and view links that you created to the application module used for the page. Warning: Using the Application Module Wizard to add the view link to the application module can be difficult. First add the view objects to the application module. Then to add a view link, select the view link in the left column and select the source view object in the right column. This enables the ">" shuttle control, which you can use to move the view link over to the right. HGrid Navigation 524
  • 525. Oracle Application Framework Developer's Guide, Release 12.1.3 To implement a HGrid for the purpose of navigating to additional detail information about the selected node in subtabs below the HGrid, consider the following when creating your BC4J components: • If the detail information consists of other attributes of a UI row selected in the HGrid, then the BC4J row used by the HGrid should ideally be used by the detail section. However, this row exists in a non-default RowSet of an internal view object. Currently our UI components (outside of HGrid and Table-in-Table) can only be bound to the default RowSet of a view object. Therefore, in this situation, you must use a separate view object for the detail section to query for the detail information. While this extra query is not ideal, on the positive side: o The rows used by the HGrid UI will have fewer attributes to query . o The detail section may require joins to other tables to get information and that complexity can be kept out of the view objects used for the HGrid itself. • As long as the application module is kept around, all the data for the HGrid will be kept as well. However, if a separate view object is used for the detail section as described above, the detail view object will get refreshed constantly. (This would preclude the possibility of updates in the detail section.) If updates are required, you must create distinct view objects for the detail section corresponding to each row in the HGrid, resulting in more data being held around. This also means you will have to manage view instances for the detail and change the view usage on the detail UI components each time. Declarative Implementation Defining a HGrid Having defined the data sources for the HGrid bean, the next step is to define the HGrid component in OA Extension. Refer to the OA Component Reference for additional information about the properties you can set on the hGrid region. In OA Framework, in addition to containing all the region items that a Table region can contain, a HGrid style region also contains a nested region item of style HGrid Hierarchy. The HGrid Hierarchy region item simply points to a nested region of style Tree Level. A Tree Level region corresponds to a node in a HGridBean. A Tree Level region contains two region items: a Tree Definition and a Tree Child. The Tree Definition region item describes the node and the Tree Child region item points to a nested region of style Tree Level. This allows OA Framework to build complex hierarchies in a declarative way. The definition of a HGrid is similar to that of a table. Specify the following metadata in OA Extension: Step 1: Define a top level region and set the Region Style property to hGrid. A HGrid region may also have an optional controller and application module. You can nest this region within a container region such as PageLayout, Header, Stack Layout, or messageComponentLayout. Note: OA Extension assumes that for all regions, the Add Indexed Children property is set to True. As a result, the Add Indexed Children property generally does not appear in the Property Inspector. However, for backwards compatibility, the Add Indexed 525
  • 526. Oracle Application Framework Developer's Guide Children property will appear for a region if you previously set this property to False using an earlier version of OA Extension. Step 2: Select the hGrid region in the Structure pane. In the Property Inspector, set the Record Set Size property to control the maximum number of records that can be displayed at a time under each tree node. The syntax used to display the record navigation links is: {ParentName[/ObjectType];} {Next | Previous} [SetRange] [of TotalRecords] For example: Car Division/Brands: Next 11-20 of 26 Note When you set the Record Set Size property on the hGrid region, the value applies to all tree nodes in the HGrid. To achieve finer control, where each tree node has a different maximum record set size, you can set the Record Set Size property on the specific nodeDefinition. Step 3: OAHGridBean supports both single and multiple selection of rows. Refer to the instructions for rendering table selection and selection buttons on the control bar for additional information. Note HGrid currently does not yet support the Advanced Table selection and control bar implementation. Step 4: In the OA Extension Structure pane, select the hGrid region and display the context menu. In the context menu, under New, select tree, to create a HGrid hierarchy column (which distinguishes a HGrid from a table). In the figure below of the HGrid structure, the tree region is labeled as HGridHierarchyRN. This nested tree region defines a particular level in the hierarchy of the HGrid. The tree region can have two types of named children (members): • nodeDefinition - The nodeDefinition item automatically appears when you create the tree region. It defines the appearance of the node in the hierarchy. For the nodeDefinition item, specify: o a value for the View Instance property to associate the node with a view instance. o a value for the View Attribute property, to render the view attribute name as the text of the node in the object hierarchy column. o a value for the Icon URI property to render an image next to the text in the node in the object hierarchy column. o a value for the Destination URI property to render the node as a hyperlink in the object hierarchy column. o a value for the Record Set Size property, if you wish to display a maximum record set size for this node that is different from the value of the Record Set Size property set on the hGrid region. 526
  • 527. Oracle Application Framework Developer's Guide, Release 12.1.3 • childNode - In the Structure pane, select members under the Tree region and display the context menu. Under New, select childNode.The childNode item defines the parent- child relationship between tree levels. o Set the Ancestor Node property on this item to indicate the region where you are looping back. The Ancestor Node property can be set to another tree region, to the same tree region (for a recursive relationship), or to no tree region (null, indicating that the node is a leaf level in the hierarchy tree). The ancestor node should be set as a fully-qualified path name such as /oracle/apps/<applshortname>/<module>/<pagename>.<childNode ID > where the ancestor childNode ID is whatever childNode (node) you are looping back to. Attention: For a recursive relationship, as indicated above, you set the ancestor node to the same tree region. However, the "same tree region" refers to the parent of the base recursing node and not the recursing node itself. o Set the View Link Accessor property to the view link accessor name that should be used to retrieve the child nodes at this level. Note: Previously, the view link instance used to retrieve the child nodes at a particular level was set via the child node's View Link Instance property. This property is now deprecated and is present only for backwards compatibility. You should only use the View Link Accessor property on the child node to specify the view link instance. Note: A childNode item can also have other nested members. Attention: If you intend to support the Export feature on a HGrid, then different viewAttributeNames cannot be used at different levels in the hierarchy column. All levels of the hierarchy column (that is, all nodeDefs) should have the same viewAttributeName. This is analogous to the definition of all other columns of a HGrid. This restriction does not apply if the Export feature is not being used. 527
  • 528. Oracle Application Framework Developer's Guide Remember that each tree region can contain two members, as called out in the figure above: 1. nodeDefinition - holds the definition for this level, such as icon name, URL, etc. 2. childNode - holds the definition of the view link, pointing to the detail view object. Step 5: You can define other columns in the HGrid by adding corresponding region items to the HGrid region. The HGrid bean supports all the column types that the table bean supports, including form fields like text inputs and poplists. Note: HGrid does not yet support the Advanced Table column and column group containers. Step 6: Set the View Instance and View Attribute properties on each of the region items representing your columns. Step 7: To define table actions, select your hGrid region in the Structure pane of OA Extension. Display the context menu and under New, choose the tableActions. This automatically creates a tableActions named child consisting of a flowLayout region. Step 8: Specify a standards-compliant ID for the region and leave the Region Style as flowLayout or set it to rowLayout. Suggestion: If you have only buttons to add to the table actions area, then you can use either layout styles, flowLayout being preferable. However, if you are adding message web beans such as messageChoice or messageTextInput along with buttons to the table action area, then you should use the rowLayout style. Using a flowLayout instead of a rowLayout in this case may cause alignment problems. 528
  • 529. Oracle Application Framework Developer's Guide, Release 12.1.3 Step 9: Under the Layout region, layout the children you want to render as table actions, such submitButton or messageChoice. Select the Layout region, and choose New > Item from the context menu. Select the new Item that is created and set the item style as appropriate. Enabling Search on a HGrid You can enable the ability to search on an HGrid. According to the Oracle Browser Look-and- Feel (BLAF) UI Guideline: HGrid Flows [OTN version] specifications, the HGrid search results are displayed in a flat table list. The results table contains a special icon called "View in Hierarchy" in each result row that takes the user to the original HGrid with the focus on the result item. However, the rendering of the Query region varies, depending on the setting of certain Query region properties and the (user personalized) views, if any, defined by the user: • If you set the Initial Panel property of your Query region to simple or advanced, an empty flat table displays when the page first renders. • If you set the Initial Panel property of your Query region to customized and the user does not have any default view specified, a HGrid displays when the page first renders. However, in this case, once the user selects a view, the following displays, based on the view selected: o HGrid - if the selected view does not have any search criteria associated with it. o Table - if the selected view does have search criteria associated with it. • If you set the Initial Panel property of your Query region to customized and the user has no views defined, the Simple/Advanced Search panels display as expected. However, if you construct your Query region in resultsBasedSearch mode, and also specify only the Views panel to display based on the following property settings: o Include Simple Panel = false o Include Advanced Panel = false o Include Views Panel = true OA Framework displays the Views panel with an empty Views poplist and HGrid if the user has no views defined. Step 1: Follow the instructions to set up a search region as described in the Search document. Step 2: Select your hGrid region in the Structure pane. In the Property Inspector, set the following properties on the hGrid region: • Search View Usage - specify the view usage to use for the search results. The view usage must have the same attributes as the other view objects that are associated with the nodes of the HGrid. • Search Controller Class - specify a controller class associated with the search results table. OA Framework automatically converts the metadata for the hGrid region to the metadata for the results table by removing the hierarchy column from the hGrid region and rendering the rest of the columns as a flat list. The search controller class allows you to provide additional control over the results table. This controller class can contain processRequest, processFormData, and processFormRequest methods 529
  • 530. Oracle Application Framework Developer's Guide that are invoked during the rendering of the results table as well as for POST requests to the server. Step 3: Select the hGrid region and from the context menu, choose New > viewInHierarchy to add a viewInHierarchy named child to the hGrid. The named child creates a link item by default. On the link item, specify a value for the Destination URI property. The Destination URI indicates the URI to navigate to when a user selects a result item link from the search results table that directs the user back to the hGrid with the focus on the result item. Use a form submission on this link by setting up a fire action. Manage this POST request in the Search Controller Class by clearing the state of the hGrid using OAHGridBean.clearCache and forwarding back to the same page to redisplay the hGrid region with the focus on the appropriate result. Refer to the Runtime Control section for information on methods that get/set the initial focus path. According to BLAF guidelines, the View in Hierarchy column typically displays an image icon. You can add the image as a child of the link (just as with a normal link web bean). Although you should always create the View in Hierarchy column declaratively, you can also get programmatic control of the link web bean as described in the Runtime Control section. Note: The old mechanism for specifying a URI for the View in Hierarchy link has been deprecated, as described in the OA Framework Coding Standards. Previously, you had to specify the URI in the View in Hierarchy URI property of the hGrid region. The new viewInHierarchy named child of the hGrid region takes precedence over this now deprecated property. Runtime Control The last step in defining a HGrid is to setup a controller. Refer to the sample controller class PersonTreePageCO to continue with the person tree example discussed in the Defining Business Components section. processRequest method As is the case with other components in OA Framework, use the processRequest method for any custom layout code. Initialize the view object for the root node in this method. Note: You must execute the query on the root view object. In the earlier original implementation of the HGrid, the HGrid used to automatically execute the query for the root view object. To ensure backward compatibility, this behavior is still present in an earlier release of OA Framework, however, consider this behavior deprecated. processFormRequest method Use the processFormRequest method to process form events from the page containing the HGrid. From a HGrid, access data only via the business components. See the PersonTreePageCO for code that walks the business component tree. Refer to the 530
  • 531. Oracle Application Framework Developer's Guide, Release 12.1.3 oracle.apps.fnd.framework.webui.OAHGridQueriedRowEnumerator Javadoc for additional information. Getting and Setting the Initial Focus Path The following methods on OAHGridBean are available to get and set the initial focus path for a HGrid: • getInitialFocusPath • setInitialFocusPath The setInitialFocusPath API is used to set the initial focus on a particular node of the HGrid. This API applies to both static and dynamic HGrids: setInitialFocusPath(int[] focusRootPath) This signature is used for static HGrids. For example, HGrids on which setFetchOnDemand(true) has not been called. The focusRootPath parameter describes the path from the root of the HGrid to the subnode that must be the initial focus root. Each element in this array indicates the child index of the next node on the path. To focus in on the 2nd child of the 5th child of the root use: int[] focusRootPath = {4, 1}; This follows the child at index 4 (which is the 5th child), and then follows that node's child at index 1 (which is its 2nd child). setInitialFocusPath(String[] focusRootPath) This signature is used for dynamic HGrids. For example, HGrids on which setFetchOnDemand(true) has been called. The focusRootPath parameter describes the path from the root of the HGrid to the subnode that must be the initial focus root. Each element in this array indicates the ID of the next node on the path. Warning: The setInitialFocusPath only sets the initial focus on the HGrid. For example, when the HGrid is in a pure form with no previously saved state. Future visits to the same HGrid will not use the initial focus path. If a HGrid's UI needs to be set back to its initial pure form, then you must call OAHGridBean.clearClientCache. This applies to both static as well as dynamic HGrids. Deleting Rows in a HGrid Although you generally use the processFormRequest method to process events on the HGrid, in the case where a user wants to delete rows from a HGrid, you must redirect back to the processRequest method. 531
  • 532. Oracle Application Framework Developer's Guide The reason is because of passivation and the fact that OA Framework stores an internal cache to hold on to rows. In general, if you delete a row and then call the OAHGridBean clearCache method, it results in a DeadViewRowAccessException because the cache is still holding a reference to the deleted row. To avoid this problem, you must always clear the cache first, then delete the row. Suppose you want to delete some row(s) in a HGrid, where multiple selection is enabled and the Delete button deletes all selected rows. To identify the rows to delete, you need to use OAHgridQueriedRowEnumerator to go through the tree of rows. In the processFormRequest method, redirect to the processRequest method and use the enumerator to get a handle to the rows selected for deletion, clear the HGrid cache, then delete the rows, as shown in this example: public void processRequest(...) { OAHGridQueriedRowEnumerator enum = new OAHGridQueriedRowEnumerator(pageContext, hGridBean); Vector listOfRowsToDelete = new Vector(5); while (enum.hasMoreElements()) { Row rowToDelete = (Row) enum.nextElement(); if (rowToDelete != null) { if ("Y".equals(rowToDelete.getAttribute("DeleteFlag")) { // Add list Row to be deleted later listOfRowsToDelete.add(rowToDelete); } } } 532
  • 533. Oracle Application Framework Developer's Guide, Release 12.1.3 //Now you have a handle to all the rows to delete //Call ClearCache to remove internal cache hGridBean.clearCache(pageContext); //Delete all the rows in the list for (int i = 0; i < listOfRowsToDelete.size(); i++) { Row rowToDelete = (Row) listOfRowstoDelete.elementAt(i); //delete the row rowToDelete.remove(); } } Note: Previously, if you try to call clearCache from the processFormRequest method, a developer mode error occurs, due to an incorrect developer mode check. This has been resolved. You can avoid the error by temporarily turning off developer mode in OA Extension. (In OA Extension, select Project Settings from the Project menu, then navigate to Common > Oracle Applications > Run Options. Remove OADeveloperMode from the Selected Options list.) Using FireAction on the Hierarchy Column You can associate a FireAction element with the hierarchy column of a HGrid to perform a form submit. See Chapter 4: Submitting the Form for more information on submitting a form. Using Save Model on the Hierarchy Column To implement a Save Model ("Warn About Changes" dialog with links), on the hierarchy column of the HGrid, you must code it manually, by including the following code example: OATreeDefinitionBean webBean = ... webBean.setAttributeValue(WARN_ABOUT_CHANGES, Boolean.TRUE); 533
  • 534. Oracle Application Framework Developer's Guide Table Row Dynamic Poplist OA Framework provides programmatic support for the implementation of a choice list (poplist or pulldown) in an updatable multi-row table, such that its poplist values can vary on a row-by-row basis. Refer to Dynamic Poplists in Standard Web Widgets for programmatic instructions. Getting a Hold of the viewInHierarchy Named Child's Link Web Bean Although you should only use declarative steps to enable search on an HGrid, if you must get hold of the link web bean that is in the viewInHierarchy named child of the hGrid region programmatically, use the findChildRecursive method: OAHGridBean hGridBean = ... OALinkBean vihLinkBean = hGridBean.findChildRecursive("vihlink"); // "vihlink" is the ID of the viewInHierarchy link Preserving HGrid State When a user performs a transaction on your page, you need to ensure that your page preserves its HGrid state. How you support state management for an HGrid depends on the following: • Case 1: If a HGrid cannot have its hierarchy structure change, but its node properties can be altered, it is considered a non-dynamic HGrid. You do not have to do anything extra to support state management for a non-dynamic HGrid. • Case 2: If a HGrid is read-only, it is also a non-dynamic HGrid and you do not have to do anything extra to support state management in this case. • Case 3: If a HGrid's hierarchy structure changes as a result of nodes being added, moved around or deleted, it is considered a dynamic HGrid. To support state management for a dynamic HGrid: Step 1: Add the following line of code to your controllers' processRequest method: hGridBean.setFetchOnDemand(true); hGridBean.setUsePkValuesNodeId(true); Step 2: Remove all calls to clearClientCache or clearCache. Step 3: Change all initialFocusPath(int[]) calls to initialFocusPath(String[]). 534
  • 535. Oracle Application Framework Developer's Guide, Release 12.1.3 The following sections describe in detail how OA Framework supports state management of dynamic HGrids. HGrid Data Proxy in UIX Before addressing the details of state management in HGrids, it is necessary to understand what a HGrid proxy object is and how it works in UIX. In UIX, the state of the HGrid (such as nodes expanded or collapsed, nodes focused into, record navigation, and so on) and all interaction with the data sources is maintained by an object known as the HGrid data proxy. This object needs to be specified on the proxy attribute of the UIX oracle.cabo.ui.beans.table.HGridBean. The proxy is actually a fairly complex Java interface (oracle.cabo.ui.data.tree.HGridDataProxy) and the UIX team has provided an initial implementation of this interface called oracle.cabo.ui.data.tree.ClientStateHGridDataProxy. This particular proxy is a black box to application developers. Application developers are only allowed to create the proxy object and initialize it with the event, state, root and node request parameters as submitted by the client (the browser). Application developers can save the parameters in an appropriate store, such as a session, and use these values to reinitialize the proxy when the HGrid is rerendered. For example, when revisiting a previously rendered HGrid. However, application developers are not allowed to peek into the values of these parameters. The values are internal to the implementation of the ClientStateHGridDataProxy. Proxy Use in the OA Framework OA Framework manages the ClientStateHGridDataProxy transparently for all Oracle E- Business Suite developers. Since most Oracle E-Business Suite require the state of the HGrid to be persisted across visits to the same HGrid, OA Framework caches the event, state, root and node request parameters on the servlet session. These values are then used to reinitialize the HGrid when it is revisited. While this satisfies requirements for state persistence, the UIX ClientStateHGridDataProxy has a significant drawback in that it uses index based tracking for the state. For example, the state might read "expand the 5th child of the 1st child of the root node". If the structure of the HGrid changes through addition or deletion of nodes, any saved state may no longer apply correctly to the HGrid. The most common side effect of this is an IndexOutOfBoundsException from the UIX renderers. The other problem is that the state might be applied to the wrong node due to the rearrangement of nodes. To circumvent these problems, OA Framework provides the clearClientCache API on OAHGridBean which clears any saved state. This allows changes to the HGrid hierarchy but loses any previous state completely, resulting in the HGrid being redrawn fully collapsed. Support for Dynamic HGrids The included UIX release provides a new proxy known as oracle.cabo.ui.data.tree.DynamicHGridDataProxy. This proxy was initially designed to support unbounded record navigation in HGrids, such as record navigation, without fetching all rows to the middle-tier. This feature is exposed in OA Framework via the 535
  • 536. Oracle Application Framework Developer's Guide setFetchOnDemand API on OAHGridBean. The interesting feature of this proxy is that it uses name-based state tracking instead of indices. As a result, it solves the major problems of the ClientStateHGridDataProxy. The IndexOutOfBoundsExceptions are no longer possible (because there are no indexes) and since the state tracking is by name, there is no possibility of the state being applied to the wrong node. Optimizing Child Row Retrieval When any given level of a HGrid is rendered, the rendering engine must first determine whether the node is expandable so that it can render the Expand icon if necessary. To do this, the rendering engine checks whether the node has children by using the HGrid's BC4J view links. This translates to firing the detail view object query just to check for the presence of children, which for large HGrids, can be a serious performance drain. Using treeChildPresentVOAttr Since data models in Oracle E-Business Suite often have a master row level attribute that keeps track of the presence or absence of children, you can optimize performance in this case. You can instruct the HGrid to use this attribute instead of firing a detail view object query to determine whether the expansion icon needs to be rendered. In order to do this, set the treeChildPresentVOAttr attribute on the <oa:childNode> in the metadata. Unfortunately, since this attribute is currently not supported in metadata, you must set this attribute programatically on the oracle.apps.fnd.framework.webui.beans.nav.OATreeChildBean, which is the runtime web bean corresponding to <oa:childNode>. For example: OATreeChildBean.setChildPresentVOAttr(String childPresentVOAttr) The String parameter in this case is the name of a master view object row attribute that returns "Y" or "N" to indicate whether there are any children. Important: All Applications should use this feature to avoid unnecessary queries against the database. Using treeLevelChildCountAttr Some Oracle E-Business Suite data models also maintain information about the number of children of a master row, at the master row itself. If you have such an attribute available, you may use it instead of treeChildPresentVOAttr. The treeLevelChildCountAttr has two advantages: • You can use this attribute to determine whether a node has children and hence, whether an expansion icon needs to be rendered for a node. • For a HGrid that uses record navigation, when a node is expanded, you can use this attribute to properly adjust the record navigation links ("Previous" and "Next") without triggering the fetch of all rows being displayed. 536
  • 537. Oracle Application Framework Developer's Guide, Release 12.1.3 In order to do use this attribute, set the treeLevelChildCountAttr attribute on the <oa:nodeDef> in the metadata. Unfortunately, since this attribute is currently not supported in metadata, you must set this attribute programatically on the OATreeDefinitionBean, which is the runtime web bean corresponding to <oa:nodeDef>. For example: OATreeDefinitionBean.setChildCountVOAttr(String childCountVOAttr) The String parameter in this case is the name of a master view object row attribute that returns an oracle.jbo.domain.Number indicating the number of children. Note that this number must match the number of rows actually returned by the detail view object query. Personalization Considerations • See a summary of HGrid personalization considerations in the Oracle Application Framework Personalization Guide. Also see a summary of Standard Web Widgets personalization considerations if you plan to implement a dynamic poplist in a HGrid. Known Issues • See a summary of key HGRID issues with suggested workarounds if available Related Information • BLAF UI Guideline(s) o HGrid [OTN version] o HGrid Flows [OTN version] • Javadoc File(s) o oracle.cabo.ui.beans.table.HGridBean o oracle.apps.fnd.framework.webui.beans.table.OAHGridBean o oracle.apps.fnd.framework.webui.beans.nav.OAHGridHierarchyB ean o oracle.apps.fnd.framework.webui.OAHGridQueriedRowEnumerator o oracle.cabo.ui.action.FireAction o oracle.cabo.ui.collection.Parameter o oracle.apps.fnd.framework.webui.beans.nav.OATreeDefinitionB ean o oracle.apps.fnd.framework.webui.beans.nav.OATreeChildBean o oracle.cabo.ui.data.tree.HGridDataProxy o oracle.cabo.ui.data.tree.ClientStateHGridDataProxy o oracle.cabo.ui.data.tree.DynamicHGridDataProxy • Lesson(s) • Frequently Asked Questions o HGrid FAQ's • Sample Code o PerAllPeopleFVOImpl o PersonTreePageCO 537
  • 538. Oracle Application Framework Developer's Guide o PerAllPeopleFVL o PerAllPeopleFVO 538
  • 539. Oracle Application Framework Developer's Guide, Release 12.1.3 Hide/Show Overview As described in the BLAF UI Guideline: Hide/Show [ OTN Version ] specification, the Hide/Show feature lets the user control whether parts of a page are hidden or displayed by selecting a special link (or icon) that toggles between content "disclosed" and "hidden" states. Figure 1: Example of a Hide/Show control in the hidden (undisclosed) state. Figure 2: Example of a Hide/Show control in the disclosed state. Hide/Show can be incorporated into a page design in the following ways. Each implementation is described below. • Hide/Show in Page Content • Hide/Show in a Table Row • Hide/Show in a Table Cell • Hide/Show in Side Navigation • Hide/Show Headers For efficiency, this feature uses Partial Page Rendering (PPR) to redraw only the part of the page that is affected by the Hide/Show component's selection. If PPR is not available (the user is running an unsupported browser or the developer disables the feature), the full page is redrawn for each Hide/Show event. Hide/Show in Page Content In this context the Hide/Show control determines whether part of a simple region's contents are hidden or shown. Per the BLAF UI Guidelines, this is typically used in the context of a Search region or within a subheader to control some of its contents. Tip: If you want to control all the contents beneath a subheader, the Hide/Show Header might be a better choice. Figure 3: example of a Hide/Show control in a "Search" region 539
  • 540. Oracle Application Framework Developer's Guide The OA Framework supports multiple Hide/Show components on a single page. You may even nest them as permitted by the UI Guidelines. Declarative Implementation Step 1: to add a Hide/Show component to your page, create region and set its style to hideShow. At runtime, the OA Framework will instantiate an oracle.apps.fnd.framework.webui.beans.layout.OADefaultHideShowBean. Note: To ensure that the Hide/Show component is not indented when displayed, add it to a region that does not automatically indent its content (a stack or a header, for example). If you add it to a region that automatically indents its components (like a messageLayout region), the Hide/Show component will not render as specified in the UI Guidelines. Step 2: Set the following properties for the hideShow region: • Disclosed Text - the text to display when the content is disclosed. Per the UI Guidelines, this text should be written in the form of "Hide <content description>". If you fail to specify this property, the OA Framework displays "Hide" as the default value. • Undisclosed Text - the text to display when the content is hidden. Per the UI Guidelines, this text should be written in the form of "Show <content description>". If you fail to specify this property, the OA Framework displays "Show" as the default value. • Initially Disclosed - controls whether the supplemental content is shown when the page first renders in the session (note that the OA Framework tracks the state of each hide/show component on the servlet session so it will always remember the user's last action when the page is rendered). The default value is "False." Step 3: Add the content that you want to control (regions and/or items) directly to the hideShow region. These regions and/or items will be added as indexed children of the hide/show component. Step 4 (optional): If you want to control the hideShow bean's disclosure state using a view object attribute, follow these substeps: • Step 4.1: Define an attribute in the view object you want to reference. This attribute must be a Boolean type (in the SQL statement that maps to this attribute, use a DECODE to return 0 for false and 1 for true), and it must be updateable so the correct state can be set when the user toggles the control. 540
  • 541. Oracle Application Framework Developer's Guide, Release 12.1.3 • Step 4.2: Set the View Instance Name property for the hideShow region to point to the view object you want to use. • Step 4.3: Set the View Attribute Name property for the attribute you defined in Step 4.1. • Step 4.4 Add logic to a controller for the hideShow (or higher in the hierarchy) to execute the view object's query. If the query has not been executed when the component is rendered, the Initially Disclosed state will be used. If the query has still not been executed when the user selects the link or icon, the OA Framework will throw a developer mode exception if your project has its OADeveloperMode property enabled (see Testing for additional information about OADeveloperMode). Repeating Hide/Show Controls (using Child View Instance) The Child View Instance property is exposed on container beans for the purpose of rendering the containers children multiple times (once for each row in the associated view object). To use this mechanism for displaying a Hide/Show control for each row, follow these steps: Step 1: Define a layout region (a stack layout, for example) in your page and add a Hide/Show control beneath it. Step 2: Set the Child View Instance property on the layout region to the view object you want to use to control the rendering. Step 3: Set the Child View Attribute property on the layout region to the view object's primary key (note that this does not support composite keys at this time). This step enables the OA Framework to correctly identify the Hide/Show control it creates for each view object row. Step 4: Set the View Instance Name property on the Hide/Show control to the same view object you referenced in Step 2. Also set its View Attribute Name property to a Boolean attribute that determines whether the content is hidden or shown (in the SQL statement that maps to this attribute, use a DECODE to return 0 for false and 1 for true, and it must be updateable so the correct state can be set when the user toggles the control.). Step 5: Add the components to the Hide/Show control that you want to display when its state is disclosed. Note that you can add any component you wish, except for a List of Values. Each of these components must bind to a view attribute in the view object you specified in Steps 2 and 3. Also see the Auto-Repeating Layout topic for additional information about using the Child View Instance property. Hide/Show and the Search "Go" Button The BLAF UI Guidelines for Hide/Show suggest that the Search "Go" button should change locations based on whether the supplemental content is hidden or shown. For Oracle E- Business Suite products, you may simply add the Go button to your Search region after the Hide/Show component so its location remains the same while the user works in the page. This exception (which was approved by the BLAF UI team although it is not documented in the 541
  • 542. Oracle Application Framework Developer's Guide guidelines) avoids the need to implement a complex workaround in the OA Framework to support the conditional positioning. Runtime Control Warning: You should create web beans programmatically only if you cannot create them declaratively. Programmatically created web beans cannot be personalized, reused, or extended easily. See the OA Framework Controller Coding Standards for additional information about this and other guidelines that you should consider when writing web bean manipulation code. Instantiate OADefaultHideShowBean Generally, there is little reason to instantiate a Hide/Show control yourself. That said, if absolutely necessary, you should instantiate an OADefaultHideShowBean if you want the OA Framework to automatically configure the bean to perform a form submit and handle the hide/show events. See the oracle.apps.fnd.framework.webui.OAControllerImpl Javadoc for other createWebBean() signatures. import oracle.apps.fnd.framework.webui.OAWebBeanConstants; import oracle.apps.fnd.framework.webui.beans.layout.OADefaultHideShowBean; ... OADefaultHideShowBean hideShow = (OADefaultHideShowBean)createWebBean(pageContext, OAWebBeanConstants.DEFAULT_HIDE_SHOW_BEAN, null, "aName"); Once you instantiate the bean, you need to set it's disclosed and undisclosed text values as illustrated in the Control Visual Properties section below. Instantiate OAHideShowBean You should instantiate an OAHideShowBean only if you can't use the declarative implementation, and you need to fully configure the bean (for example, you want the icon/link selection to issue a GET instead of a POST as the "default" bean does), and you want to implement the event handling yourself (so you will be responsible for manually hiding and showing the supplemental content). 542
  • 543. Oracle Application Framework Developer's Guide, Release 12.1.3 See the OAControllerImpl Javadoc for other createWebBean signatures. import oracle.apps.fnd.framework.webui.OAWebBeanConstants; import oracle.apps.fnd.framework.webui.beans.layout.OAHideShowBean; ... OAHideShowBean hideShow = (OAHideShowBean)createWebBean(pageContext, OAWebBeanConstants.HIDE_SHOW_BEAN, null, "aName"); Control Visual Properties You can set the disclosed and undisclosed text values at runtime as shown below. You cannot change the standard hide/show icon. import oracle.apps.fnd.framework.webui.beans.layout.OADefaultHideShowBean; ... processRequest(OAPageContext pageContext, OAWebBean webBean) { // Get a handle to the hideShow bean if this code is in a controller associated with // a parent or grandparent of the bean. OADefaultHideShowBean hideShow = (OADefaultHideShowBean)findIndexedChildRecursive("<component ID>"); // Alternatively, if this code is in a controller associated with the hide/show 543
  • 544. Oracle Application Framework Developer's Guide // region, simply cast the OAWebBean parameter passed to the processRequest() // method. OADefaultHideShowBean hideShow = (OADefaultHideShowBean)webBean; // Set the undisclosed Text. Always remember to obtain a translated text value // from Message Dictionary. NEVER set a hard-coded text value. hideShow.setUndisclosedText("<Show...>"); // Set the undisclosed Text. Always remember to obtain a translated text value // from Message Dictionary. NEVER set a hard-coded text value. hideShow.setDisclosedText("<Hide...>"); // Set the default (initial) disclosure state. hideShow.setDefaultDisclosed(pageContext, Boolean.TRUE; } Control Behavior and Data The OA Framework automatically configures the OADefaultHideShowBean to perform a form submit when the user selects the link or icon. If you need to turn off client side Javascript validation when the form is submitted (you're using the hideShowBean in a data entry page), get a handle to your Hide/Show component and call the following in your processRequest method: hideShow.setUnvalidated(true); If you need to disable Partial Page Rendering for any reason, call the following in your processRequest method: 544
  • 545. Oracle Application Framework Developer's Guide, Release 12.1.3 hideShow.setPartialRenderMode(OAWebBeanConstants.PARTIAL_RENDER_MODE_N ONE); You can also change the bound value if you're using a view object attribute to determine the disclosure state. hideShow.setViewUsageName(<"viewObjectInstanceName">); hideShow.setViewAttributeName(<"viewObjectAttributeName">; Handle Hide/Show Events When using the OADefaultHideShowBean, the OA Framework automatically handles the user selection events to hide and show supplemental content. If you need to write code to handle these events yourself for any reason, add the following code to your controller's processFormRequest method: Warning: You should not interfere with the OA Framework's handling of these events (in particular, do not make any changes involving the hide/show state management or the associated view instance if one is attached to the hide/show bean). // Get the name of the event currently being raised. String hideShowEvent = pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM); if ((OAWebBeanConstants.SHOW_EVENT.equals(hideShowEvent)) || (OAWebBeanConstants.HIDE_EVENT.equals(hideShowEvent))) { ... If you have multiple Hide/Show components on the page, you can also get the name of the bean that raised the event by getting the value of the source parameter: // Get the component ID for the bean that raised this event 545
  • 546. Oracle Application Framework Developer's Guide String hideShowId = pageContext.getParameter(OAWebBeanConstants.SOURCE_PARAM); Note that if you associate a controller with your Hide/Show control (so the webBean parameter in the processFormRequest method is referencing this component), then the source parameter value will equal the webBean's component ID. public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { String hideShowEvent = pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM); // Get the component ID for the bean that raised this event String hideShowId = pageContext.getParameter(OAWebBeanConstants.SOURCE_PARAM); // Get the component ID of the current webBean String beanId = webBean.getUINodeName(); if (beanId.equals(hideShowId))... Back Button / Refresh Considerations The OA Framework automatically handles user selection of the browser Back and Refresh buttons for this component. That said, however, if you're using a view object to manage the disclosure state, you should consider review Supporting the Browser Back Button before proceeding. Personalization Considerations • See a summary of Hide/Show personalization considerations in the Oracle Application Framework Personalization Guide. Hide/Show in a Table Row 546
  • 547. Oracle Application Framework Developer's Guide, Release 12.1.3 You can also use a Hide/Show bean to control whether additional information is displayed for a table row. See the table [ classic | advanced ] documentation for information about this. Hide/Show in a Table Cell In this context, control whether supplemental information is shown in a single table cell. Figure 5: example of a Hide/Show control for a table cell Declarative Implementation To implement this as shown in a table column (without prompts for the data), follow the same steps that are listed in the Hide/Show in Page Content section with the following difference: • You must specify the View Instance and View Attribute names. The View Instance should reference the same view object that the table is using, and the View Attribute must be a Boolean type (in the SQL statement that maps to this attribute, use a DECODE to return 0 for false and 1 for true), and it must be updateable so the correct state can be set when the user toggles the control. If you want the data in the Hide/Show column to include prompts, you must add a tableLayout to the column first, and then add your hideShow region as described above. Runtime Control See the Hide/Show in Page Content section for runtime control instructions. Personalization Considerations • See a summary of Hide/Show personalization considerations in the Oracle Application Framework Personalization Guide. Hide/Show in Side Navigation The OA Framework currently does not support Hide/Show in a side navigation as shown in Figure 6, and this is not planned for Release 12. 547
  • 548. Oracle Application Framework Developer's Guide Figure 6: example of a Hide/Show control in a Side Navigation Hide/Show Headers If you want to hide or show all the contents beneath a subheader as shown in Figures 6 and 7, use the Hide/Show Header bean. Note: This bean does not have associated disclosed and hidden text properties since only the Hide/Show icon toggles when the user selects it. The header text remains the same in both states. Figure 7: example of a Hide/Show Header in the disclosed state Figure 8: example of a Hide/Show Header in the hidden (undisclosed) state Declarative Implementation To add a Hide/Show Header to your page, create a region and set it's style to hideShowHeader. At runtime, the OA Framework will instantiate an OAHideShowHeaderBean. The only other region property that you must set is the Text to display. You can also change the default Initially Disclosed value from False to True. Finally, add contents to the hideShowHeader as you would for any other header region. Runtime Control 548
  • 549. Oracle Application Framework Developer's Guide, Release 12.1.3 Warning: You should create web beans programmatically only if you cannot create them declaratively. Programmatically created web beans cannot be personalized, reused, or easily extended. See the OA Framework Controller Coding Standards for additional information about this and other guidelines that you should consider when writing web bean manipulation code. Instantiate See the OAControllerImpl Javadoc for other createWebBean signatures. Import oracle.apps.fnd.framework.webui.OAWebBeanConstants; import oracle.apps.fnd.framework.webui.beans.layout.OAHideShowHeaderBean; ... OAHideShowHeaderBean header = (OAHideShowHeaderBean)createWebBean(pageContext, OAWebBeanConstants.HIDE_SHOW_HEADER_BEAN, null, "aName"); Control Visual Properties The only visual property that you can set for this bean is the header's text as shown: // Always remember to obtain a translated text value from Message Dictionary // NEVER set a hard-coded text value. header.setText(pageContext, "<some value>"); Control Behavior and Data As described in the Hide/Show in Page Content section above, you can change the bound value if you're using a view object attribute to determine the disclosure state. You can also turn off client-side Javascript validation if needed. Handle Hide/Show Events The OA Framework automatically handles hiding and showing the header's content. There is no reason to write code to handle this yourself. Back Button / Refresh Considerations 549
  • 550. Oracle Application Framework Developer's Guide The OA Framework automatically handles user selection of the browser Back and Refresh buttons for this component. That said, however, if you're using a view object to manage the disclosure state, you should review Supporting the Browser Back Button before proceeding. Personalization Considerations • See a summary of Hide/Show personalization considerations in the Oracle Application Framework Personalization Guide. Known Issues • None Related Information • BLAF UI Guidelines o Hide/Show [ OTN Version ] • OA Framework Developer's Guide o Tables [ Classic | Advanced ] o Testing OA Framework Applications o OA Framework Controller Coding Standards o Partial Page Rendering o Supporting the Browser Back Button • Javadoc o oracle.apps.fnd.framework.webui.beans.layout.OAHideShowBean o oracle.apps.fnd.framework.webui.beans.layout.OADefaultHideS howBean o oracle.apps.fnd.framework.webui.beans.layout.OAHideShowHead erBean o oracle.apps.fnd.framework.webui.OAControllerImpl • OA Framework ToolBox Tutorial / Sample Library o oracle.apps.fnd.framework.toolbox.tutorial.webui.SupplierSe archPG o oracle.apps.fnd.framework.toolbox.samplelib.webui.BasicStru ctPG 550
  • 551. Oracle Application Framework Developer's Guide, Release 12.1.3 Images in Your Pages Overview For the purposes of discussing how to incorporate images into your pages, we classify OA Framework application images into the following categories: Category Description Images Added By 1 Core component images (for example: buttons, tabs, the UIX List of Values (LOV) icon, train steps, table column sorting icons, the Hide/Show icons, message icons, the 1-pixel spacer image and so on) 2 Corporate and product branding images. Page Developers 3 Images added to support a page's functionality as Page Developers illustrated in Figure 1 (see the Status, Delete and Update icons in the search results table). This document describes how to add images in the third category. See the Branding document for additional information about the second category. UIX renders images in the first category automatically. Figure 1: Typical OA Framework page showing all 3 categories of images 551
  • 552. Oracle Application Framework Developer's Guide Contents • Declarative Implementation • Runtime Control • Personalization Considerations • Known Issues • Related Information Declarative Implementation Step 1: Locate the image that you want to add to your page in either the Ancillary Graphic Repository (internal link | external link) or the Icon Repository (internal link | external link). You'll need the image's name and its size for Step 2. Note for Oracle E-Business Suite Developers: If you need new images for your product, contact the Oracle User Interface team to request assistance. Once the UI team creates a new icon for you and adds it to the Icon Repository or the Ancillary Graphic Repository, the OA 552
  • 553. Oracle Application Framework Developer's Guide, Release 12.1.3 Framework team automatically includes this new file in the next regularly scheduled "images" ARU. Step 2: Create a new item with a standards-compliant ID and set the following properties for the item: • Set the Style property to image. • Set the Image URI to the image's name. For example, to add the Update (enabled) icon shown in Figure 1 above, you would set this value to updateicon_enabled.gif. • Set the Additional Text property to the value listed in the image's source repository. This value is displayed as tooltip text, and used for accessible component access (and as such is required by the Accessibility coding standards). If an image is purely decorative, then set this to DECORATION to generate an empty string for its value (which appears in the HTML source as alt="" for the image tag). • Set the Height to the image's published height. • Set the Width to the image's published width. Note: The Height and Width properties must be set for any images that you add to a page. See the View Coding Standard V30 for additional information. • If selecting the image should perform an HTTP GET, set the Destination URI to a target page (for example: OA.jsp?page=/oracle/apps/fnd/framework/toolbox/samplelib/webui/Sa mpleBrowserPG&retainAM=Y). If selecting the image should perform an HTTP POST, see Submitting the Form for special configuration instructions. At runtime, OA Framework instantiates an oracle.apps.fnd.framework.webui.beans.OAImageBean. Tip: If you need to conditionally display different images in a table (for example, a Delete image is enabled or disabled on a row-level basis), use a Table Switcher. You can also use a bound value as shown in the Runtime Control example below. Storing and Deleting Product Specific Dynamic Images OA Framework provides the following APIs for storing and deleting product specific temporary and permanent dynamic images under /OA_HTML/fwk/t and /OA_HTML/fwk/p. Note: These directories are not striped by product, therefore we recommend that all image names be prefixed with the product code. Use these APIs to return the physical path to where the images can be stored: public String getTemporaryImageLocation(); public String getPermanentImageLocation(); Use these APIs to return the virtual path to where the images can be stored: public String getTemporaryImageSource(); public String getPermanentImageSource(); 553
  • 554. Oracle Application Framework Developer's Guide Note: This path can be used to build URLs for your images. Use this API to delete a permanent or temporary image: Public void deleteImage(String imageName, String imageType); Use this API to ensure that your image name is unique: Public String generateUniqueImageName(String imageName, String imageType); Note: Image type can be OAWebBeanConstants.OA_TEMPORARY_IMAGE or OAWebBeanConstants.OA_PERMANENT_IMAGE. In a typical customer environment, multiple users and JVMs access the same physical directory. In order to guarantee a unique image name, an empty file corresponding to the image name is created. File extensions provided in the image name will be respected. If you are attempting to create a gif file, make sure your image name is someImageName.gif. It is the responsibility of the application using the temporary images, to delete such images at the end of the transaction. See the javadoc for more information. How to use these APIs is shown in the Runtime Control example below. Runtime Control To add an image to your page programmatically, you must specify the relative image path in addition to setting the height, width, and alternative text. However, (when adding an image declaratively, it is sufficient to specify just the image's name and the alternative text. For example: import oracle.apps.fnd.framework.webui.OAWebBeanConstants; import oracle.apps.fnd.framework.webui.beans.OAImageBean; ... public void processRequest(OAPageContext pageContext, OAWebBean webBean); { super.processRequest(pageContext, webBean); ... 554
  • 555. Oracle Application Framework Developer's Guide, Release 12.1.3 OAImageBean dots = (OAImageBean)createWebBean(pageContext, OAWebBeanConstants.IMAGE_BEAN, null, "dotsImage"); dots.setSource(OAWebBeanConstants.APPS_MEDIA_DIRECTORY + "cc_dotsprocess.gif"); dots.setShortDesc(pageContext.getMessage("FND","FND_DOTS_SHORT_DESC")) ; dots.setHeight("35"); dots.setWidth("8"); webBean.addIndexedChild(dots); } You can also add an image to your page using bound values, as shown below. (See the Bound Values topic for additional information). This particular example (from the PoSummaryCO class in the ToolBox Tutorial application) uses a view object attribute value to set the correct status image on a row-level basis). import oracle.cabo.ui.data.BoundValue; import oracle.cabo.ui.data.bind.ConcatBoundValue; import oracle.cabo.ui.data.bind.FixedBoundValue; import oracle.apps.fnd.framework.webui.OADataBoundValueViewObject; import oracle.apps.fnd.framework.webui.beans.OAImageBean; ... public void processRequest(OAPageContext pageContext, OAWebBean webBean) 555
  • 556. Oracle Application Framework Developer's Guide { super.processRequest(pageContext, webBean); OAImageBean statusImageBean = (OAImageBean)table.findIndexedChildRecursive("StatusImage"); /* ** Note that you may define an image bound value without specifying the APPS_MEDIA_DIRECTORY, ** however, we include this example to show you how to concatenate a fixed bound value ** with a data bound value. */ // Define the OA Framework image directory FixedBoundValue imageDirectory = new FixedBoundValue(APPS_MEDIA_DIRECTORY); // Define a binding between the image bean and the view object attribute that it // will reference to get the appropriate .gif image value name. // Note that the corresponding attribute values are obtained using a decode() in the // POSimpleSummaryVO view object. Another attribute must be defined // to return the text to be displayed for the shortDesc. 556
  • 557. Oracle Application Framework Developer's Guide, Release 12.1.3 OADataBoundValueViewObject statusBinding = new OADataBoundValueViewObject(statusImageBean, "StatusImage"); OADataBoundValueViewObject statusTextBinding = new OADataBoundValueViewObject(statusImageBean, "StatusText"); statusImageBean.setAttributeValue(SHORT_DESC_ATTR, statusTextBinding); // Concatenate the image directory with the actual image name (as retrieved // from the view object attribute decode() statement) ConcatBoundValue statusCBV = new ConcatBoundValue(new BoundValue[] {imageDirectory, statusBinding}); // Finally tell the image bean where to get the image source attribute statusImageBean.setAttributeValue(SOURCE_ATTR, statusCBV); } The following is an example of how the APIs for storing and deleting product specific dynamic images may be used: ... 557
  • 558. Oracle Application Framework Developer's Guide //At the beginning of a transaction //Image returned would look like HRCar2.gif, if say another image //with the prefix HRCar.gif already exists in that directory. String imageName = pageContext.generateUniqueImageName("HRCar.gif", OAWebBeanConstants.OA_TEMPORARY_IMAGE); //assuming your image generation program takes full path to the image being created someAPIForCreatingTheGif(getTemporaryImageLocation() + imageName); //create the image bean OAWebBeanFactory factory = pageContext.getWebBeanFactory(); OAImageBean image = (OAImageBean)factory.createWebBean(pageContext, IMAGE_BEAN); image.setSource(getTemporaryImageSource() + "infoicon_active.gif"); ... //At the end of the transaction pageContext.deleteImage(imageName, OAWebBeanConstants.OA_TEMPORARY_IMAGE); Personalization Considerations • See a summary of Images in Your Pages personalization considerations in the Oracle Application Framework Personalization Guide. 558
  • 559. Oracle Application Framework Developer's Guide, Release 12.1.3 Known Issues • None Related Information • BLAF UI Guideline(s) o Ancillary Graphic List (Repository) [OTN Version ] o Icon Repository [OTN Version] • Javadoc o oracle.apps.fnd.framework.webui.beans.OAImageBean 559
  • 560. Oracle Application Framework Developer's Guide Include Content (URL and Servlet) Overview You can use the URL Include or Servlet Include web beans to include HTML content loaded from an external source under a parent region. This allows you to easily modify the HTML content without disturbing your E-Business Suite application page. • URL Include - use this item style to display a block of very simple HTML content on an existing page. For example, you may use this item style to display recent announcements on a home page. • Servlet Include - use this item style to display a block of HTML content loaded from a local Servlet or JSP. URL Include Figure 1: Example of a "Home" page including a simple HTML announcement. Declarative Implementation Step 1: Create a new Item in the region where you want to include content. Step 2: In the Property Inspector, set the Item Style property to urlInclude. Step 3: Enter a value for the Source URI property to indicate the source of the HTML content. Note the following: • The value should be an absolute URL such as, http://www.oracle.com/products/product_list.html, and not a relative URL, such as /products/product_list.html. Relative links behave as relative to the surrounding page and not relative to the source of the HTML content. 560
  • 561. Oracle Application Framework Developer's Guide, Release 12.1.3 • No post-processing on the HTML is performed, so the included HTML should not include HTML tags like <html> or <body>. • Do not use forms or input fields in your HTML content, because anything submitted in the form (POST) is sent in the context of the surrounding page, not the source of the HTML content. Note: If the included HTML content contains a link that navigates out of that content, you should include a target="_blank" designation so that the link opens in a new browser window instead of in the current browser window, unless that is what you desire. For example, the HTML link would look something like this: <a href="http://www.oracle.com/products/product_list.html" target="_blank">Oracle Products</a> Runtime Control No programmatic steps are required to implement the URL Include web bean. Servlet Include Figure 2: Example of a dynamic page displaying the number of times accessed Declarative Implementation Step 1: Create a new Item in the region that you want to include content. Step 2: In the Property Inspector and set the Item Style property to servletInclude. Step 3: Enter a value for the Source URI property to indicate the source of the local Servlet or JSP. Note the following restrictions: • The value should be an relative URL to the JSP or Servlet. • Query parameters may be appended to the relative URL. These parameters are visible to the included servlet or JSP in its ServletRequest. Runtime Control 561
  • 562. Oracle Application Framework Developer's Guide No programmatic steps are required to implement the Servlet Include web bean. Personalization Considerations • None. Known Issues • None 562
  • 563. Oracle Application Framework Developer's Guide, Release 12.1.3 Inline Messaging, Tips, Hints and Bubble Text Overview Per the Oracle Browser Look-and-Feel (BLAF) UI Guideline Inline Messaging, Tips, Hints and Bubble Text [ OTN Version ], you can add supplemental helpful text to your pages to help the user complete the task at hand. Within this general category of help methods (see the UI Guideline for information on how to choose the appropriate help method(s) for your design), this document describes how to add field-level hints, tips and bubble text. Figure 1 shows instruction text set for the page and region-levels, field-level hints and a tip. Figure 2 shows bubble text examples. • See the Instruction Text document for information on adding primary task help text at the page and region levels. • See the Buttons (Global) document for information on adding page-level context sensitive help to the Help global button. Figure 1: Example of page and region-level instruction text, field-level hints and a tip. Figure 2: Bubble text examples. 563
  • 564. Oracle Application Framework Developer's Guide Inline Messages / Field-Level Hints You can declaratively create either short or long field-level hints: • The short hints render immediately below the item as shown in Figure 1 (see the Purchase Order field). • The long hints render as a selectable information icon next to the item (see the Created poplist in Figure 1). When the user selects the information icon, a dialog window opens as shown in Figure 3 below. Note that you cannot configure a static error message as shown in the UI Guidelines (this is displayed automatically for you when field-level validation fails; see Error Handling for additional information about this). You also cannot associate a warning icon with an item as shown in the UI Guidelines. Field-Level Hint To configure a field-level hint for any field that is not displaying a date (see the date format instructions below for this case): Step 1: In the JDeveloper structure pane, select the item with which you want to associate a hint. Note: Field-level hints can be configured only for those items whose name begins with message (for example, a messageChoice or a messageTextInput). Step 2: Set the Tip Type property to shortTip. Step 3: Define a message in the Applications Message Dictionary for the text you want to display. Set the Tip Message Appl Short Name and the Tip Message Name properties accordingly. 564
  • 565. Oracle Application Framework Developer's Guide, Release 12.1.3 The OA Framework displays your text in the current session language immediately beneath the related item. To configure the standard date format example beneath a date field: Step 1: In the JDeveloper structure pane, select the date item that needs a format example. Step 2: Set the Tip Type property to dateFormat. The OA Framework automatically renders a standard date format example using the user's date format preference. Long Hint (with Information Icon) To add a long hint to an item: Step 1: In the JDeveloper structure pane, select the item with which you want to associate a hint. Step 2: Set the Tip Type property to longMessage. Step 3: Configure the long message content: • (Option 1) Define a message in the Applications Message Dictionary for the text you want to display. Set the Tip Message Appl Short Name and the Tip Message Name properties accordingly, and the OA Framework displays your message in the dialog shown below when the user selects the item's information icon. • (Option 2) If you need complete control of the contents in the dialog window, do not specify the Tip Message Appl Short Name and Tip Message Name properties. Instead, design your own region and specify its fully qualified name for the Long Tip Region property (for example, /oracle/apps/fnd/framework/toolbox/webui/PurchaseOrderLongTipRN). At runtime, the OA Framework displays your region in the dialog. Figure 3: Dialog window that opens when the information icon is selected. 565
  • 566. Oracle Application Framework Developer's Guide Tips Although the field-level hint properties in JDeveloper are called "tips," a tip in BLAF UI Guidelines parlance is a special component with an icon, a standard "TIP" prefix and the tip text that you define (an example is shown immediately above the search results table in Figure 1). When you define a tip for your page, the OA Framework instantiates an oracle.apps.fnd.framework.webui.beans.OATipBean and renders the tip text in the current session language. Tip: If you want to display tip text that includes HTML tags, see the Custom HTML document. Declarative Implementation To add a tip to your document: Step 1: In the JDeveloper structure pane, select the region where you want to add a tip, right- click and select New > Item. Note that, unlike field-level hints which are associated with directly with existing items, tips are like any other item; you can simply add them wherever you need them. Step 2: Specify the item ID in accordance with the OA Framework Naming Standards and set the Item Style to tip. Step 3: If your tip text is very brief, you may enter it directly in the Text property. Otherwise, define a message in the Applications Message Dictionary, and then set the Tip Message Appl Short Name and the Tip Message Name accordingly. Runtime Control Warning: You should create web beans programmatically only if you cannot create them declaratively. Programmatically created web beans cannot be personalized, reused, or extended easily. See the OA Framework Controller Coding Standards for additional information about this and other guidelines that you should consider when writing web bean manipulation code. If you need to create a tip programmatically, follow these steps: Step 1: Create a message in the Applications Message Dictionary. Step 2: Instantiate the tip as shown below. Then, instantiate an oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBean to hold your tip text and add it as an indexed child of the tip. Note that UIX automatically sets the CSS style to OraTipText on your behalf. 566
  • 567. Oracle Application Framework Developer's Guide, Release 12.1.3 import oracle.apps.fnd.framework.webui.OAWebBeanConstants; import oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBean; import oracle.apps.fnd.framework.webui.beans.OATipBean; ... public void processRequest(OAPageContext pageContext, OAWebBean webBean) { // Always call this first. super.processRequest(pageContext, webBean); // Instantiate the tip bean using the factory mechanism (do not use "new"). OATipBean tip = (OATipBean)createWebBean(pageContext, OAWebBeanConstants.TIP_BEAN, null,"aName"); // Instantiate the text portion of the tip. OAStaticStyledTextBean tipText = (OAStaticStyledTextBean)createWebBean(pageContext, OAWebBeanConstants.STATIC_STYLED_TEXT_BEAN, null,"anotherName"); // Obtain the translated text value from the Applications Message Dictionary // and set it as the text value in the static styled text bean. String tipTextValue = pageContext.getMessage("AK", "FWK_TBX_T_TIP_BEAN", null); tipText.setText(tipTextValue); 567
  • 568. Oracle Application Framework Developer's Guide // Add the tip text to the tip bean. tip.addIndexedChildren(tipText); } Bubble Text Bubble text, otherwise known as "ALT" or "rollover" text, should be added to buttons and images as described in the OA Framework View Coding Standards Accessibility section. See this document for instructions on when and how to specify the ALT text. See the UI Guideline for information on appropriate verbiage. Related Information • BLAF UI Guidelines o Inline Messaging, Tips, Hints and Bubble Text [ OTN Version ] • Javadoc o oracle.apps.fnd.framework.webui.beans.OATipBean o oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBea n • Developer's Guide o Instruction Text o Buttons (Global) o Custom HTML o OA Framework View Coding Standards o OA Framework File Standards o Error Handling • OA Framework ToolBox Tutorial / Sample Library o oracle.apps.fnd.framework.toolbox.tutorial.webui.PoSearchPG .xml 568
  • 569. Oracle Application Framework Developer's Guide, Release 12.1.3 Instruction Text Overview Per the Oracle Browser Look-and-Feel (BLAF) UI Guideline Instruction Text [ OTN Version ], instruction text is the primary method for directing and helping users to perform specific tasks. Instruction text can be specified in relation to the following as illustrated in Figure 1 below. • the entire page • a section of content (a subheader or a subsubheader) • a table • a group of components within a section of content (rare, not illustrated in Figure 1) Figure 1: Example of instruction text in different parts of the page. See Inline Messages, Tips, Hints and Bubble Text for information on creating field-level hints and tips as shown above the table in Figure 1. Declarative Implementation To add plain instruction text (without any links or HTML formatting) in any of the valid page areas, following these steps and the OA Framework will create an oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBean. Tip: If you want to display tip text that includes HTML tags, see the Custom HTML document. Step 1: Create a message in the Applications Message Dictionary. Step 2: Create a region item and set its Style to staticStyledText. Step 3: Set the region item's ID property in accordance the OA Framework File Standards. 569
  • 570. Oracle Application Framework Developer's Guide Step 4: Set the CSS Class property to OraInstructionText. Step 5: Associate the message you created in Step 1 with the region item you created in Step 2 by setting its Message Name and Message Appl Short Name properties as appropriate for your message. Runtime Control Warning: You should create web beans programmatically only if you cannot create them declaratively. Programmatically created web beans cannot be personalized, reused, or extended easily. See the OA Framework Controller Coding Standards for additional information about this and other guidelines that you should consider when writing web bean manipulation code. If you need to create a tip programmatically, follow these steps: Step 1: Create a message in the Applications Message Dictionary. Step 2: Instantiate the static styled text and configure its key properties. import oracle.apps.fnd.framework.webui.OAWebBeanConstants; import oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBean; ... public void processRequest(OAPageContext pageContext, OAWebBean webBean) { // Always call this first. super.processRequest(pageContext, webBean); // Instantiate the instruction text bean using the createWebBean() factory. OAStaticStyledTextBean helpText = (OAStaticStyledTextBean)createWebBean(pageContext, OAWebBeanConstants.STATIC_STYLED_TEXT_BEAN, 570
  • 571. Oracle Application Framework Developer's Guide, Release 12.1.3 null,"aName"); // Obtain the translated message from Message Dictionary and set it // as the bean's value. String helpTextValue = pageContext.getMessage("AK", "FWK_TBX_T_REGION_GENERAL", null); helpText.setText(helpTextValue); // Set the CSS Style to OraInstructionText. helpText.setCSSClass("OraInstructionText"); } Personalization Considerations • None Known Issues • None Related Information • BLAF UI Guidelines: o Instruction Text [ OTN Version ] • Developer's Guide o Custom HTML • Javadoc o oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBea n 571
  • 572. Oracle Application Framework Developer's Guide Buttons (Links) Overview This document describes the different kinds of links that you can create for your pages. • "Return to" Link • Display-Only Table Column Link • Display-Only Text Field Link • Plain Link • "Mailto" Action Link • Form Submit Links Note: For information about buttons that behave as links, see Buttons (Action / Navigation). For information about embedding links in instruction text, see the Instruction Text document. "Return to" Link "Return to..." links render below the page contents bottom line as shown: Figure 1: "Return to..." link an a page-level action/navigation button below the "ski" Declarative Implementation A "Return to... link" is a special named component of the page layout region. To create one: Step 1: Select your pageLayout region in the JDeveloper Structure pane, right-click and select New > ReturnNavigation. JDeveloper creates a link item for you. Step 2: Name the link in accordance with the OA Framework File Standards, set the Text to display, and set the Destination URI to the target page. For example: OA.jsp?page=/oracle/apps/dem/employee/webui/EmpSearchPG&retainAM=Y. Runtime Control Warning: You should create web beans programmatically only if you cannot create them declaratively. Programmatically created web beans cannot be personalized, reused, or extended easily. See the OA Framework Controller Coding Standards for additional information about this and other guidelines that you should consider when writing web bean manipulation code. 572
  • 573. Oracle Application Framework Developer's Guide, Release 12.1.3 Instantiate To add a return link programmatically: processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OALinkBean returnLink = (OALinkBean)createWebBean(pageContext, OAWebBeanConstants.LINK_BEAN, null, "returnLink"); returnLink.setDestination("OA.jsp?page=/oracle/apps/dem/employee/webui /EmpSearchPG&retainAM=Y"); // Retrieve and set the translated link text. String linkText = pageContext.getMessage("AK", "FWK_TBX_T_RETURN_TO_POS", null); returnLink.setText(linkText); // Add the return link to the page. This example assumes the controller is // associated with the pageLayout region. ((OAPageLayoutBean)webBean).setReturnNavigation(returnLink); } Display-Only Table Column Link 573
  • 574. Oracle Application Framework Developer's Guide Typically, display-only table columns are messageStyledText items. To enable the link, simply set the Destination URI property and set the CSS Class to OraLinkText. Then, set the View Instance and View Attribute properties as you normally would to obtain the link text. Remember that you can use tokens in your Destination URI to obtain parameter values for the request when the link is selected. For example, the following Destination URI value obtains the empNum primary key from the EmployeeNumber attribute in the current row of the associated view object: OA.jsp?page=/oracle/apps/dem/employee/webui/EmpDetailsPG &retainAM=Y&addBreadCrumb=Y&empNum={@EmployeeNumber} Figure 2: Example of display-only text table column links. See Implementing the View for detailed information about using URL tokens. Display-Only Text Field Link The important characteristic of a display-only text field link is it renders aligned with other text fields, and it includes a prompt. To achieve this, simply create a messageStyledText bean and configure its properties as described in the Display-Only Table Column Link section above. Plain Link If you want to display a simple link without a prompt, add a link item to your page and set its Destination URI property. You can either set its Text property, or you can bind the link to a view object by setting its View Instance and View Attribute properties. "Mailto"Action Link If you want a link to send an email when selected, for any component that can be configured as a link, simply set the destination property to mailto:<emailAddress>. For example, the Destination URI property for the "Buyer" field shown in Figure 3 above is defined as mailto:{@BuyerEmail}. 574
  • 575. Oracle Application Framework Developer's Guide, Release 12.1.3 Note the use of token replacement to obtain the BuyerEmail value from a view object attribute. Form Submit Links If you need to perform specific actions when users select a link or an image, you can configure them to submit the page form instead of simply navigating to their target pages. See Submitting the Form for instructions on how to implement this. Related Information • BLAF UI Guidelines o Buttons (Links) [ OTN Version ] • OA Framework Developer's Guide o Submitting the Form o Implementing the View o OA Framework File Standards o OA Framework Controller Coding Standards o Buttons (Action / Navigation) o Instruction Text • Javadoc o oracle.apps.fnd.framework.webui.beans.message.OAMessageStyl edTextBean o oracle.apps.fnd.framework.webui.beans.nav.OALinkBean o oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBe an 575
  • 576. Oracle Application Framework Developer's Guide List of Values (LOV) Overview As described in Oracle Browser Look-and-Feel (BLAF) UI Guideline: LOV (List of Values) [ OTN Version ], a List of Values (LOV) is a special control that lets users choose a value from a predefined list of values for the purpose of populating one or more fields on a page. Implementation details for the following LOV types are described below. • Text Field LOV • Dependent LOV Text Field • LOV Choice List • Multiselect LOV (For a Table) • Multiselect LOV (For a Single Field) An LOV Primer Before learning how to implement a List of Values, it's important to understand its key components and behavior. This section briefly describes each of the following; implementation- level details are provided below for the different LOV types. • Base Page and LOV Window • LOV Mappings • Dependent LOVs • Validation (Also Known as "Autocompletion") • AutoClear • Look Ahead LOV Base Page and LOV Window A base page includes an LOV control in its page layout. For example, Figure 1 illustrates a "Purchase Order" LOV field. When the user selects the magnifying glass icon, the LOV window shown in Figure 2 displays. The user optionally searches within the LOV using designated query criteria, and selects a row from the results list to populate the value(s) in the base page (you can configure your LOV to return multiple values to different base page items). Figure 1: Purchase Orders and LOV Search. 576
  • 577. Oracle Application Framework Developer's Guide, Release 12.1.3 Figure 2: An LOV window with Advanced Search enabled LOV Mappings 577
  • 578. Oracle Application Framework Developer's Guide LOV Mappings define the data communication between the base page and the LOV window. An LOV map is comprised of the following participants: LOV Item The item in the LOV for which the mapping is defined. (Base Page) Criteria When the user invokes a List of Values, one or more field values from the base page can be passed to the LOV to be used as search criteria (note that the LOV field on the base page should always be configured as a search criteria item). When the LOV window renders, the query results are displayed. For example, in the purchase order example above, if the user enters "2" in the "Purchase Order" field and selects the LOV icon, the query will return all purchase orders whose number starts with "2." If you need to programmatically control the query criteria (for example, you need to intercept base page values to ascertain what the real query criteria should be), then you must configure the LOV to accept passive criteria, which is loosely defined to mean any LOV query criteria that you specify programmatically in an associated LOV controller. (Base Page) Result When the user selects a row in the LOV, one or more values are returned to the base page. In the ToolBox Tutorial Application example shown in Figure 1 above, each of the user-friendly "Buyer," "Supplier" and "Supplier Site" LOV fields also have hidden primary keys. When the user selects a value from the LOV, the OA Framework copies both the user-friendly name and the primary key values to the base page. Figure 3: XML page structure showing the Buyer, Supplier and Supplier Site LOV fields and the corresponding hidden primary key fields. 578
  • 579. Oracle Application Framework Developer's Guide, Release 12.1.3 Dependent LOVs You can also configure an LOV value to depend on a value from another field(s). For example, in the ToolBox Tutorial Application example shown above, the user cannot select a supplier site value until a supplier is selected, so the "Supplier Site" LOV is configured to depend on the "Supplier" value. Validation (Also Known As "Autocompletion") LOVs can be configured to automatically validate data that the user enters without invoking the LOV window unless required. For example, if partial page rendering (PPR) is enabled and the user enters the value "Smi" in a Buyer name field and then tabs out, the OA Framework automatically queries all buyers whose name begins with "Smi." In such a case, the following outcomes are possible: • If a single match is found, the OA Framework automatically populates the result field(s). • If multiple matches are found, the OA Framework displays the LOV window so the user can try different search criteria. • If no matches are found, the OA Framework displays the LOV window so the user can try different search criteria. • Note: PPR does not work with pages that have errors on them; the OA Framework resorts to a full page refresh in these cases. 579
  • 580. Oracle Application Framework Developer's Guide Validate-On-Submit The OA Framework also automatically validates hidden formValue LOV result fields when the page form is submitted (You can declaratively disable this for formValue fields and enable it for displayed LOV fields). This second level of checking is important for the following reasons: • If PPR is disabled, validation is simply not performed when the user enters a value and tabs out; no other result fields will be populated. • Even if validation causes the LOV window to open, the result fields will still be empty if the user cancels out without making a selection. • If the user enters a value in the LOV field and immediately selects a submit button, link or icon without tabbing out first, regular validation is not performed. When validate-on-submit is enabled, the LOV behaves almost exactly the same as it does when performing the standard validation: • If a single match is found, the OA Framework automatically populates the result field(s). • If multiple matches are found, the OA Framework displays an error message at the top of the base page. • If no matches are found, the OA Framework displays an error message at the top of the base page. Passive Criteria Previously, LOVs with passive criteria could not be properly validated. Even if a single valid match was found for the given criteria, the OA Framework displayed the LOV window so the user could select the single matching value. Now, even LOVs with passive criteria can be validated (assuming you enable validation on the LOV field as described in the implementation details below). AutoClear The OA Framework automatically clears dependent fields when the user changes the LOV value. • First, if the user changes a value of the LOV field, or any criteria items for the LOV, and tabs out, the OA Framework clears all associated result field values. • Second, if the user changes the value of an LOV criteria field and tabs out, the OA Framework clears the LOV field value. Note that AutoClear cascades throughout LOV relationships. For example, assume the user changes the value of a criteria field and tabs out. The OA Framework clears the corresponding LOV input field, and all related results fields. If any of these result fields are designated as a criterion for different LOV field, that LOV input will also be cleared along with its result fields. This continues until all related LOV items have been cleared. 580
  • 581. Oracle Application Framework Developer's Guide, Release 12.1.3 Warning: If an LOV result is written to a messageStyledText item, AutoClear cannot clear this field. Look Ahead LOV The List of Values component also has type-ahead search capabilities. As an end-user types in characters in the LOV search field, the results are fetched and displayed inline to the LOV component. A user can select a value from this look ahead window just as in the classic LOV window. For most use cases, this capability eliminates the need to launch the LOV modal window, to perform a search within the window, and to navigate through the results using Next / Previous links in the LOV window results table, thereby saving a number of clicks and server- side requests, and significantly enhancing end-user productivity. The Look Ahead LOV is enabled by default. It is controlled by a property on the messageLovInput item and the profile option FND: Disable Look Ahead LOV at the Site or Application level. When Look Ahead LOV is enabled for a LOV component, a UI indicator of a dimmed downward arrow in the lower right corner of the LOV text input field appears. Figure 4: The Look Ahead LOV window appears as a user enters data in the Application Name LOV. An inline list of values appears only when a user enters 1 or more alpha-numeric characters into the LOV input field. You can specify the minimum number of characters required to initiate the Look Ahead LOV by setting a property on the messageLovInput item or by setting the profile option FND: Minimum Characters for Look Ahead at the Site or Application level. By default, the Look Ahead LOV performs a search for records that "start" with the alpha- numeric characters entered. You can change this behavior to search for records that "contain" the criteria entered, by setting a property on the messageLovInput item. 581
  • 582. Oracle Application Framework Developer's Guide The matching records appear in the Look Ahead LOV window below the LOV text input field. The matching records update in real-time as the user enters or deletes characters in the LOV input field. By default, only a maximum of 50 records are fetched at a time, but you can change that maximum by setting a property on the messageLOVInput item. Users can click on the Next/Previous links in the window to fetch further or previous records. By default, the Look Ahead LOV displays 10 rows in its visible area. Depending on your page, you can change the number of rows to display in its visible area by setting a property on the messageLOVInput item. Users can navigate the Look Ahead LOV window of matching records by using the keyboard or mouse. Keyboard Navigation • [Tab] - Highlights the next record. • [Up Arrow] - Highlights the previous record. If the currently highlighted record is the first record, the Up Arrow removes the highlighting from that record. If no record is currently highlighted, the Up Arrow has no effect. • [Down Arrow] - Highlights the first record if no records are currently highlighted, or highlights the next record if a record is already highlighted. • [Esc] - Dismisses the Look Ahead LOV window without selecting a record. • [Alt][<] or [Alt][Shift][,]- navigates to the previous page of records. • [Alt][>] or [Alt][Shift][.]- navigates to the next page of records. • [Alt][R] - invokes the LOV modal window where you can refine your search. • [Space bar] - selects the highlighted value. Mouse Navigation • Hovering over a particular record highlights the record. • Left-clicking on the highlighted record selects the highlighted record and populates the record values into the result fields. • Scrolling the mouse scrolls the Look Ahead LOV window. Note: If a user enters data into the LOV input field without first entering values for the LOV's criteria fields, then the message about missing validation criteria appears, as in the traditional LOV modal window. If no records match the data that the user enters into the LOV input field, then the same message of 'No records found' appears as in the results table of the LOV modal window. Figure 5: A 'No Items found' message displayed by the Look Ahead LOV feature if no record matches the data entered by the user. 582
  • 583. Oracle Application Framework Developer's Guide, Release 12.1.3 Text Field LOV As illustrated in Figures 1 and 3 above, a Text Field LOV is an updateable text field with an associated flashlight icon. Its behavior at runtime depends on your configuration decisions. Declarative Implementation Driving View Object Based on Entity Objects If the view object that you are updating with the LOV selection results is based on entity objects, and your LOV will be returning values mapped to entity-object based attributes on one or more reference entity objects: 1. You must define associations between the driving entity and each reference entity. 2. In the view object definition wizard, you must configure each reference entity object's Association End as Reference and Read Only. For example, assume you define a page to create a purchase order including an LOV to select a supplier: • The LOV returns a SUPPLIER_ID foreign key value for update on the purchase order (PurchaseOrderEO), and a SUPPLIER_NAME value to display in the UI. • The SUPPLIER_NAME value is mapped to a reference entity object attribute (SupplierEO.SUPPLIER_NAME). • There is a reference association (PoToSupplierAO) that joins the PurchaseOrderEO.SUPPLIER_ID and the SupplierEO.SUPPLIER_ID. When you configure the purchase order view object to reference the SupplierEO via the PoToSupplierAO, you must check both the Read Only and Reference properties. If you follow these instructions, OA Framework does not attempt to write any values on reference entities (thereby avoiding a BC4J runtime error regarding updates to a Read Only entity), and BC4J's standard faulting mechanism is used to automatically query the reference values as needed. 583
  • 584. Oracle Application Framework Developer's Guide LOV View Object and Application Module Step 1: As described in Implementing the Model, define a view object for your list of values query (note that the OA Framework File Standards recommend creating this application module in the oracle/apps/<app_short_name>/<module>/lov/server directory). • This view object should include all the columns you want to display in the LOV results table, and any hidden values that you want to return when the user makes a choice. For example, a view object for selecting a buyer might include BUYER_NAME (displayed value), BUYER_ID (hidden primary key), and JOB_TITLE (displayed value). • You do not need to include a WHERE clause for the base page search criteria items; the OA Framework automatically appends an appropriate WHERE clauses and bind variables based on the LOV criteria. That said, however, your LOV can include a WHERE clause that always restricts the result set (for example, an END_DATE check for a "Currently Employed Buyers" LOV). • The view object for the LOV region can be based on an entity object, but given its limited data selection, it's typically created using plain SQL. Step 2: If you have not already done so, create a dedicated application module (AM) to contain all view objects that are shared by a package or module (note that the OA Framework File Standards recommend creating this application module in the oracle/apps/<app_short_name>/<module>/lov/server directory). Add the view object that you created in Step 1 to this application module. Note: Do not designate this application module as being passivation-enabled (it isn't a real root application module). LOV Field and (Optional) Additional Criteria/Results Fields Step 3: In the OA Extension Structure pane, select the region where you want to add the LOV field, right-click and select New > Item. Set the Item Style property to messageLovInput. • Step 3.1: Specify a standards-compliant ID, an Attribute Set and other properties as usual for text fields. • Step 3.2: If you don't want the LOV to automatically validate when the user enters a value and tabs out or submits the form without tabbing out, set the Disable Validation property to True. Note that, per the OA Framework View Coding Standards, this value should always be False unless it's essential that you allow partial values in the field (in a search region, for example). • Step 3.3: To enable or disable the Look Ahead LOV feature, set the Look Ahead Enabled property to True or False, respectively. You can also update the profile FND: Disable Look Ahead LOV at the Site or Application level to False to enable the Look Ahead feature for all LOVs. The default value for this profile option is False at the Site level. Note that the value you set on the Look Ahead Enabled property overrides the profile value for this LOV. • Step 3.4: Control the minimum number of alpha-numeric character inputs required to activate the Look Ahead LOV feature by setting the profile option FND: Minimum Characters for Look Ahead at the Site or Application levels. The default value for the profile option is 3. To override this profile option value and set a different minimum 584
  • 585. Oracle Application Framework Developer's Guide, Release 12.1.3 number of characters to activate the Look Ahead feature for this LOV, set the Minimum Characters For Look Ahead property to a value of 1 or higher. Note: For smaller width LOVs, that is, those LOVs whose width is 5 characters or less, if the width of the messageLovInput item is smaller (for example, 2) than the width set on the Minimum Characters For Look Ahead property or the FND: Minimum Characters for Look Ahead profile (for example, 3), then the minimum number of characters required to activate the Look Ahead LOV defaults to1. • Step 3.5: Set the Look Ahead Search Type property to specify the search type of the Look Ahead LOV. Set the property to contains, to have the Look Ahead LOV return records whose LOV field value contains the matching characters anywhere within the value. Set the property to startsWith to have the Look Ahead LOV return records that start with the criteria entered. The default value for this property is startsWith. Note: For selective search criteria LOVs, Look Ahead Search Type cannot use the contains value. • Step 3.6: By default, the Look Ahead LOV window fetches a maximum of 50 records. A scroll bar along with Next and Previous links enable navigation. Set the Look Ahead Records Displayed property to specify a different maximum. If more than the maximum number of records match the user's input, then Next and Previous links appear in the window to let the user navigate among the records. • Step 3.7: By default, the Look Ahead LOV window displays 10 rows in its visible area. Set the Look Ahead Records Visible property to specify a different number of rows to display in the visible area to suit the needs of your specific page. • Step 3.8: The Look Ahead Selection Event Enabled property lets you determine what happens when the user selects a value in the Look Ahead LOV window. If the property is set to: o True - a server-side LOV validate event fires, and the page refreshes with the resulting fields. o False - no server-side event fires, and the results are based on the client side. Note: According to the OA Framework View Coding Standards, this value should always be True if you have special handling in your controller for LOV events, like using isLovEvent(). Step 4 (optional): Create additional items for LOV result values. For example, if you create an LOV for "Employee Name," you will probably need a hidden field for the "Employee ID" value. Note that you should set the Style to formValue and the Rendered property to True for all hidden fields used for LOV results. Items of type messageStyledText are also valid for results. Step 5 (optional): Create additional items for LOV search criteria. Note that LOV criteria items must be form elements (for example, they cannot be of type messageStyledText). If not, the LOV cannot read their values. For example, if you define a text input field as an LOV criteria item, but you set its Read Only property to True, it is not rendered as a form element. 585
  • 586. Oracle Application Framework Developer's Guide Tip: If you want to use the value that you display in a messageStyledText field as LOV search criteria, consider creating a mirror formValue field to hold the same value. LOVs do allow formValue items as criteria items. Warning: Query criteria for supplemental fields (in addition to the LOV field itself) must be used carefully. For example, assume an "Employee Name" LOV is configured to apply a "Department" value as query criteria. If the user enters a value of "Sales" in the "Department" field and selects the "Employee Name" LOV icon, all employees in the sales department are displayed. • The value entered in the criteria field is used to perform an exact match (the base page LOV field's value is an exception to this rule as it is always used to perform a partial match). As a consequence, if the user enters "Sa" in the "Department" field and invokes the "Employee Name" LOV, the query will not find any employees in the "Sales" department. • Supplemental query criteria items cannot be used as user enterable search criteria within the LOV itself. So, in our "Department" example, the LOV cannot be configured to let the user search on "Department" within the LOV window (if she realizes she wants to search in the "Consulting" department instead, she needs to dismiss the LOV and change the "Department" value on the base page before opening invoking the LOV a second time). LOV Region Step 6: Create the LOV region itself. First, you need to decide if you want to create an "external" LOV that can be leveraged in multiple pages by defining unique mappings for each instance, or a single-use LOV for use only in the current page. Instructions for each are provided below. To create a single-use LOV region: • Step 6.1 When a you create a messageLovInput item, OA Extension automatically creates an inline LOV region (listOfValues style) for this item. • Step 6.2: Select your new listOfValues region in the Structure pane, and set its AM Definition property to the fully qualified name of the application module you created in Step 2 above (for example, /oracle/apps/fnd/framework/toolbox/tutorial/lov/server/TutorialLO VAM). • Step 6.3: Select the listOfValues region again, right-click and select New > Region Using Wizard to create your results table and bind it to the view object you created above (see the Tables documentation for additional information about creating this component). o Remember to give the region and its items standards-compliant IDs, and specify appropriate Attribute Sets for the items. o Set the item Style to messageStyledText for any items you want to display in the LOV "Results" table. Note that at least one table item must be of type messageStyledText for the LOV to render properly. o Set the item Style to formValue for any hidden items (remember to set their Rendered property value to True so the OA Framework includes them in the web bean hierarchy). 586
  • 587. Oracle Application Framework Developer's Guide, Release 12.1.3 o Set the Search Allowed property to True for any LOV result items you want to present to the user as searchable values. These items are listed in the search poplist the user sees in the LOV window.  At a minimum you must set the Search Allowed property to True for the the result table item corresponding to the LOV field on the base page.  Do NOT set the Search Allowed property to True for any result table items that correspond to the supplemental search criteria items that you created in Step 5 above. o Set the Selective Search Criteria property to True to identify items for which the user must provide search criteria (see the Search topic for additional information about selective search criteria).  In the simple LOV search, only those items that have both the Search Allowed and Selective Search Criteria properties set to True will appear in the Search By poplist. At runtime, the user must provide a real search value; if the user enters % or tries to perform the search without specifying a Search By value, the OA Framework displays the standard selective search criteria error message. Note: For backwards compatibility, simple searches will function as they always have if none of the items are marked with the Selective Search Criteria property set to True.  In the advanced LOV search (instructions for enabling an advanced search are provided below), all items whose Search Allowed property is set to True will render, however, the user must enter a value in at least one of the designated Selective Search Criteria fields. Note: If you enable an advanced search, you must designate at least one Selective Search Criteria item. • Step 6.4 (optional): Select the listOfValues region again, right-click and select New > searchInstructions to provide custom help text for the LOV search region. Specify a standards-compliant ID, set the CSS Class to OraInstructionText and specify the Message Dictionary message to display as the help text by setting the Tip Message Appl Short Name and the Tip Message Name as appropriate. To create a reusable LOV region: • Step 6.1: Create the shared region (not a page!) using the instructions provided in Implementing the View: Create a Shared Region. Set its Style to listOfValues. • Steps 6.2 - 6.4: Follow as documented above for the single-use LOV region. • Step 6.5: Associate the reusable LOV with the base page LOV field. In the OA Extension Structure pane, select the LOV item you created in Step 3 and set its External LOV property to the fully qualified name of the shared listOfValues region you just created (for example, /oracle/apps/fnd/framework/toolbox/tutorial/lov/webui/EmployeesLo vRN). 587
  • 588. Oracle Application Framework Developer's Guide Note: OA Extension confirms that you want to replace the default generated inline LOV region with the external LOV. Select the OK button to proceed, and OA Extension will remove the inline LOV region and display the external LOV in a dimmed state since you cannot edit a referenced object. Tip: If you change your mind and want to create an inline LOV after setting an external LOV, select the Set to Default Property Inspector toolbar button to clear the External LOV property. OA Extension automatically recreates the default inline LOV region for you. LOV Mappings Step 7: Create the LOV Mappings (regardless of whether you choose to implement a reusable LOV or a single-use LOV, you map its data communication relationship to the base page in the same way). For the first mapping, select the LOV mapping that was created by default when you created your messageLovInput. To create additional mappings, select the lovMappings node in the Structure window, right-click and select New > lovMap from the context menu. To configure a mapping: • Specify the LOV Region Item that will participate in the mapping. • Specify the Criteria Item for a base page item whose value is to be used as LOV search criteria. • Specify the Return Item for a base page item whose value is to be populated by the LOV selection. • Set the Required property to True for Criteria Items whose values must be populated before the LOV can be invoked (if not, the OA Framework displays an error message in the LOV window). • Set the Programmatic Query property to True for any Criteria Items whose values you want to apply to the WHERE clause programmatically. • Tip: you might use this approach, for example, if you have supplemental Criteria Items whose values should be used for partial matches instead of the default OA Framework behavior of an exact match (remember that the LOV field value itself is always used for a partial match). • Set the Use for Validation property one of the following values: o default validate-on-submit will be triggered if the base item is of type formValue, and if it has no value (this is the OA Framework 5.7 behavior) o yes validate-on-submit will be triggered if the base item has no value regardless of the item type. o no validate-on-submit is not triggered by a null value regardless of the item type. o Note: if you want to turn off validate-on-submit altogether for an LOV input, you need to set the Use for Validation property to no for all LOV maps whose base item is of type formValue. When configuring your mappings, pay close attention to the following usage notes: 588
  • 589. Oracle Application Framework Developer's Guide, Release 12.1.3 • First and foremost, you need one mapping for each distinct field on the base page that you want to use as criteria and/or to which you want to return a result value. A single LOV mapping for the LOV field can handle both sending criteria values to the LOV, and receiving result values from the LOV. Note that older pages migrated from previous versions of JRAD or AK may show separate mappings for each direction. • The data types for the LOV Region Item and the Criteria/Results Items must match. If they do not, and you are running in Developer Test Mode, you will receive an error. • You must have a mapping for the base page LOV field. Specify the name of that field for both the Criteria Item and Return Item properties. For the LOV Region Item property, specify the item in the LOV region that corresponds to the base page LOV field. If you fail to configure the LOV field as a Criteria Item and you are running your page in Developer Test Mode, the OA Framework will display an error. • In LOV mappings for fields other than the LOV field itself, you can specify either the Criteria Item or the Return Item property, but not both. Do not try to create one mapping for a (non-LOV field) field as criteria and another mapping for the same field as a return item, as this will cause runtime errors. For the LOV Region Item property, specify the item in the LOV region that corresponds to the appropriate base page field. • If your LOV does not naturally include a formValue result item (so it returns its values only to visible fields), you must add at least one formValue result field whose Use for Validation property is set to True. For example, consider the following Address example: LOV Usage Item Name Item Type criteria AddressLov messageTextInput result AddressLov messageTextInput result City messageTextInput result State messageTextInput • In this case, we have an AddressLov field with associated City and State fields. When the user selects a value from the Address list of values, results are returned to the AddressLov field and its related City and State fields. This configuration can lead to the submission of invalid values when partial page rendering (PPR) is disabled. To resolve this, simply add a formValue item for one of the results as shown: LOV Usage Item Name Item Type criteria AddressLov messageTextInput result AddressLov messageTextInput result City messageTextInput result State messageTextInput result AddressFormValue formValue • If the user tries to submit invalid values for the address fields, the OA Framework detects that the AddressFormValue field is null (meaning that it has not been populated by a valid LOV result value), and so it will validate the values on submission. 589
  • 590. Oracle Application Framework Developer's Guide General Usage Notes • The base page's LOV value is applied only to the first, automatic query that the OA Framework executes when the LOV window first opens (or for autovalidation, when the user leaves the LOV field after entering a partial value). Any subsequent searches performed by the user in the LOV window do not use the base page LOV value. • If there are no criteria in the base page LOV field, the OA Framework does not perform an automatic query when the LOV window opens. • Query criteria from fields other than the LOV field are not displayed in the LOV window, but they will affect all queries executed in the LOV window. • Any query criteria values from items configured as passive criteria are not automatically added to the WHERE clause; you must manually set them in a controller as described above. • A table and an LOV used in a table should always used different view objects to avoid stale data errors. • If an LOV is used in a table or an HGrid, you cannot map to criteria or result fields outside the table or HGrid. • If you make an LOV text input field read only, the OA Framework hides the LOV icon and renders the data in messageStyledText item. • If an LOV is used in a table with an "Add Another Row" button, and the LOV returns a result to a messageStyledText item, add a mirror formValue item for the messageStyledText item and map it to the same underlying view object attribute. Then, add a special LOV map to return the same value to the formValue field that you return to the messageStyledText field. This ensures that the data is properly written to the underlying view object. • If the selected LOV value is longer than the specified maximum length of the LOV field, browsers exhibit different runtime behaviors. For example, Internet Explorer displays a client-side validation error message while Mozilla-based browsers return a truncated value to the base page. When designing your LOV, it is therefore desirable to ensure that the mapped value lengths are consistent. Enabling Advanced Search in Your LOV If you want to enable an advanced search in your LOV, in addition to the default simple search, set the Advanced Search Allowed property on the listOfValues region to True. You can also set this property programmatically by calling setAdvancedListOfValues(Boolean.true) on the OAListOfValuesBean. Note that this should be called only in the processRequest method of a controller associated with the listOfValues region. Advanced Search Usage Notes • Per the BLAF UI guidelines, the Simple Search always displays by default, even if the Advanced Search is enabled. This state is illustrated in Figure 1 above. • If the user searches in one mode and toggles to the other, the underlying query criteria object is cleared to avoid inconsistency. • You should not make any changes to the underlying query criteria object yourself as this might destabilize the LOV. 590
  • 591. Oracle Application Framework Developer's Guide, Release 12.1.3 • The Advanced Search displays any listOfValues region items whose Search Allowed property is set to True. Runtime Control Warning: You should create web beans programmatically only if you cannot create them declaratively. Programmatically created web beans cannot be personalized, reused, or easily extended . See the OA Framework Controller Coding Standards for additional information about this and other guidelines that you should consider when writing web bean manipulation code. Instantiate The following example code illustrates how to create a Text Field LOV programmatically. See the oracle.apps.fnd.framework.webui.beans.message.OAMessageLovInputBean Javadoc for additional information about these methods. public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OAMessageLovInputBean lovInput = (OAMessageLovInputBean)createWebBean(pageContext, LOV_TEXT, null, "inputTest"); webBean.addIndexedChild(lovInput); // Specify the path to the base page. lovInput.setAttributeValue(REGION_CODE, "/oracle/apps/dem/webui/Basic"); // Specify the application id of the base page. lovInput.setAttributeValue(REGION_APPLICATION_ID, new Integer(20001)); 591
  • 592. Oracle Application Framework Developer's Guide // Specify the LOV region definition. lovInput.setLovRegion("/oracle/apps/fnd/framework/toolbox/tutorial/web ui/EmployeesLovRN", 0); // Validation should be enabled for LOVs unless it's essential for the field to allow // a partial value (in a "Search" region, for example). lovInput.setUnvalidated(false); // Configure the LOV mappings. // Note that you must call this method after you add the messageLovInput item // to the web bean hierarchy. lovInput.addLovRelations(pageContext, "inputTest", // base page item "Empname", // lov item LOV_RESULT, // direction LOV_REQUIRED_NO); lovInput.addLovRelations(pageContext, "inputTest", // base page item "Empname", // lov item LOV_CRITERIA, // direction LOV_REQUIRED_NO); // Enable Look ahead. 592
  • 593. Oracle Application Framework Developer's Guide, Release 12.1.3 lovInput.setLookAheadEnabled(true); // Set the Search Type as contains. lovInput.setSearchType(CONTAINS); // Change the default number of records displayed to 100. lovInput.setLookAheadSize(100); // Enable Client side population. lovInput.setLookAheadSelectionEventEnabled(false); // Set the minimum characters to initiate look ahead as 1. lovInput.setMinCharsForLookAhead(1); } Usage Note: For the above code example, the REGION_CODE and REGION_APPLICATION_ID attributes must be set to the path of a valid base page and to that valid base page's application ID, respectively. These attribute values must represent an existing personalizable static region reference and cannot be set to arbitrary values. OA Framework validates these values when it renders "Personalize ..." region links on the page and a Java exception results when these values do not represent a valid combination. The following example illustrates how to add an LOV relation programmatically to a declaratively defined LOV. See the OAMessageLovInputBean Javadoc for additional information about these methods. public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OAMessageLovInputBean msglov = 593
  • 594. Oracle Application Framework Developer's Guide (OAMessageLovInputBean)webBean.findChildRecursive("Employee"); msglov.addLovRelations(pageContext, "Employee", // base page item name "EmpName", // lov item name LOV_CRITERIA, // direction LOV_REQUIRED_YES); } Configure WHERE Clause Based on Passive Criteria If you have configured one or more criteria items as passive criteria, you must obtain the passive criteria values and manually apply them to the WHERE clause in a controller associated with the LOV region as illustrated in the Dependent Text Field LOV / Passive Criteria Example below. Switch LOV View Objects Based on Passive Criteria If you need to change the view object an LOV queries dynamically, create a controller and associate it with the LOV region. Then, create one or more passive criteria items that you can inspect in this controller's processRequest metho