01 04 Implement View

download 01 04 Implement View

of 37

Transcript of 01 04 Implement View

  • 8/3/2019 01 04 Implement View

    1/37

    Copyright Oracle Corporation, 2002. All rights reserved.

    Implementing the View:Building a Page in JDeveloper

  • 8/3/2019 01 04 Implement View

    2/37

    1-2 Copyright Oracle Corporation, 2002. All rights reserved.

    Agenda

    Terminology

    OA Workspaces and OA Projects

    Regions

    Items

    CSS Styles

    Attribute Sets

    Extending Other Objects

    Binding Data to Items

    Region Wizard

    Query Bean

    LOVs

  • 8/3/2019 01 04 Implement View

    3/37

    1-3 Copyright Oracle Corporation, 2002. All rights reserved.

    Terminology

    Property

    Anything shown in the Property Inspector

    Attribute

    Means "property" in UIX (XML attribute in the XMLfile)

    Roughly equivalent to "column" in BC4J (view

    object attribute)

    Various other meanings

    Instance and Usage

    Mean the same thing

  • 8/3/2019 01 04 Implement View

    4/37

    1-4 Copyright Oracle Corporation, 2002. All rights reserved.

    OA Workspaces and OA Projects

    Be careful to create OA workspaces and OA projects,

    rather than plain workspaces or projects.

    Only OA projects allow you to create pages,

    regions, and attribute sets. Only OA projects capture Oracle Applications-

    related information.

    Run options such as Developer Mode

    OA Framework connection information

  • 8/3/2019 01 04 Implement View

    5/37

    1-5 Copyright Oracle Corporation, 2002. All rights reserved.

    Region Styles

    The region style in the Property Inspector determines

    the UI Bean for the region. Different Beans have very

    different behaviors.

    header

    Table or advancedTable switcher

    hGrid

    hideShow

    advancedSearch and so onSee the OA Framework Developer's Guide and the

    online help in JDeveloper.

  • 8/3/2019 01 04 Implement View

    6/37

    1-6 Copyright Oracle Corporation, 2002. All rights reserved.

    Region Styles

    Some styles need to be combined to build a particular

    layout on your page, such as an arrangement of fields

    and buttons that use a tableLayout region to define

    their locations. Table Layout

    Row Layout

    Cell Format

    Spacer

  • 8/3/2019 01 04 Implement View

    7/37

    1-7 Copyright Oracle Corporation, 2002. All rights reserved.

    Named Children and Indexed Children

    Named children of a Bean have a specific name

    and purpose

    Like properties of the Bean that can be Beans

    themselves Indexed children

    of a Bean depend

    on their order

    under the Bean

  • 8/3/2019 01 04 Implement View

    8/37

    1-8 Copyright Oracle Corporation, 2002. All rights reserved.

    Page Layout Region

    The page layout region (pageLayout style) is required

    to be the first region. It has several properties and

    named children that define the overall appearance and

    behavior of your page. (Root) Application Module Definition

    AutoFooter

    Title

    Window Title

    Product Branding

    Return Navigation

  • 8/3/2019 01 04 Implement View

    9/37

    1-9 Copyright Oracle Corporation, 2002. All rights reserved.

    Styles and Bean Names

    Region or item style names in the JDeveloper

    Property Inspector appear in the Java naming

    convention starting with lower case letter.

    The corresponding programmatic versions (webBean names) usually prepend "OA", append

    "Bean" and capitalize the first letter.

    defaultSingleColumn becomesOADefaultSingleColumnBean

    table becomes OATableBean See the OA Framework Developer's Guide and OA

    Framework Javadoc

  • 8/3/2019 01 04 Implement View

    10/37

    1-10 Copyright Oracle Corporation, 2002. All rights reserved.

    Item Styles

    Item styles that start with "message" (such as

    messageTextInput, messageStyledText,

    messageLovInput, and so on) create displayed

    data fields. Use messageTextInput for an input field.

    Use messageLovInput for an input field with an

    LOV.

    Use messageStyledText for a display-only field.

    Use staticStyledText for plain boilerplate text on apage such as an instruction.

    Use submitButton for a button that does a post

    (the button item style does not submit).

  • 8/3/2019 01 04 Implement View

    11/37

    1-11 Copyright Oracle Corporation, 2002. All rights reserved.

    Attribute Sets

    Use attribute sets to set certain properties by

    inheritance using the Attribute Set property.

    Prompts and text

    Maximum length, display width

    Attribute sets should be created and used for

    every displayable table column in an application.

  • 8/3/2019 01 04 Implement View

    12/37

    1-12 Copyright Oracle Corporation, 2002. All rights reserved.

    Extending Other Objects

    Some parts of your page can be inherited by extending

    other regions or items using the Extends property.

    For example, extend

    /oracle/apps/fnd/framework/webui/OAReqFieldDescRG region to get a Required Key

    region

    Extend entire regions (and their logic) that are

    common to several pages.

    Extend single objects.

  • 8/3/2019 01 04 Implement View

    13/37

    1-13 Copyright Oracle Corporation, 2002. All rights reserved.

    CSS Styles

    Apply CSS (cascading style sheet) styles to regions

    and items to provide a consistent look and feel

    Customers can change styles easily

    Master list of styles at BLAF UI website:http://scout/appsui/ss_guidelines/specs/

    textstandards_spec_v21.html

    Many of these are already built into UIX and do not

    need to be applied manually.

  • 8/3/2019 01 04 Implement View

    14/37

    1-14 Copyright Oracle Corporation, 2002. All rights reserved.

    Common CSS Styles

    You must set style sheet tags for many of the UI

    Beans, particularly fields and "field-like" Beans

    (poplists, checkboxes, static page text, and so on).

    OraDataText: bold, left-aligned display-only field data

    OraFieldText:

    plain text in updatable fields, checkboxes, etc.

    The text displayed for a checkbox is not considered

    to be a prompt, so do not use OraPromptText

  • 8/3/2019 01 04 Implement View

    15/37

    1-15 Copyright Oracle Corporation, 2002. All rights reserved.

    Common CSS Styles

    OraPromptText:

    right-aligned prompts

    Note that any of the "message" Beans, such as

    messageTextInput, automatically set the correctCSS class for the prompt.

    OraLinkText:

    left-aligned plain text data that should render as a

    link in the link color.

    OraInstructionText: any of the left-aligned plain text instructions that

    you add to your page

  • 8/3/2019 01 04 Implement View

    16/37

    1-16 Copyright Oracle Corporation, 2002. All rights reserved.

    Accessibility, Translation, and

    Customization Requirements

    CSS style sheets and attribute sets help us meet

    requirements for:

    Accessibility

    Translation Customization/personalization

  • 8/3/2019 01 04 Implement View

    17/37

    1-17 Copyright Oracle Corporation, 2002. All rights reserved.

    Accessibility, Translation, and

    Customization Standards

    You must also follow all the related standards in:

    Oracle Applications Framework Developer's Guide

    Chapter 10: Standards and Guidelines

    Chapter 8: Testing, Debugging and Troubleshooting

    See also www-

    apps.us.oracle.com/atg/accessibility (internal).

  • 8/3/2019 01 04 Implement View

    18/37

    1-18 Copyright Oracle Corporation, 2002. All rights reserved.

    Binding Data to Items

    In your declarative data, binding data from an existing

    VO to a specific item is simple.

    Add the VO instance to the root AM.

    Specify the root AM for the pageLayout. Specify the View Instance in the Property

    Inspector for each item.

    Also called view object instance or view usage

    Specify the View Attribute in the Property

    Inspector for that item.

    Also called view object attribute

  • 8/3/2019 01 04 Implement View

    19/37

    1-19 Copyright Oracle Corporation, 2002. All rights reserved.

    Creating a Region with the Region Wizard

    Use the Region Wizard when you need to create

    multiple items based on one VO instance.

    Choose yourAM and VO instance (usage).

    Typically AM is set at pageLayout level, so do notcheck the "Use as AM for the Region" box.

    Choose your region style (such as table).

    Specify attribute sets before changing prompts.

    Attribute sets often change prompts.

    Set IDs and item styles as needed.

    Make other property changes to individual items

    when you are done with the wizard.

  • 8/3/2019 01 04 Implement View

    20/37

    1-20 Copyright Oracle Corporation, 2002. All rights reserved.

    Mailto Links

    The Destination URI property lets you link from a field.

    For an email link, set Destination URI property to

    mailto:{@}

    For example:mailto:{@ManagerEmail}

  • 8/3/2019 01 04 Implement View

    21/37

    1-21 Copyright Oracle Corporation, 2002. All rights reserved.

    Destinations and Links

    The Destination URI property lets you link from a field.

    For a link to another page:

    OA.jsp?[page= or

    OAFunc=]&={@ViewAttributeName1}&retainAM=&addBreadCrumb=

    The same syntax can also be used withpageContext.setForwardURL

    Links can also perform submits using a special

    Javascript syntax (will be changing for 11.5.10E).

  • 8/3/2019 01 04 Implement View

    22/37

    1-22 Copyright Oracle Corporation, 2002. All rights reserved.

    Overview of Building Search Regions

    The user can have three main types of search

    interface.

    The developer has three main ways (construction

    modes) of building search regions on pages. Any search user interface can be done with either

    Results-based search orAuto Customization

    Criteria.

    User Interfaces

    Simple

    Advanced

    Views

    Construction Mode

    Results-based Search

    Auto Customization Criteria

    Manual

  • 8/3/2019 01 04 Implement View

    23/37

    1-23 Copyright Oracle Corporation, 2002. All rights reserved.

    Simple Search

    The simple search interface provides:

    one or more fields for a user to type a criteria

    value

    a Go button a Clear button.

  • 8/3/2019 01 04 Implement View

    24/37

    1-24 Copyright Oracle Corporation, 2002. All rights reserved.

    Advanced Search

    The advanced search interface provides:

    one or more fields for a user to type a criteria

    value

    a Go button a Clear button

    AND, OR, and datatype-specific search

    capabilities

  • 8/3/2019 01 04 Implement View

    25/37

    1-25 Copyright Oracle Corporation, 2002. All rights reserved.

    Personalized Views

    The views search interface allows a user to name,

    save, and rerun queries with particular query

    criteria.

    The results table and items in the table must have"User Personalization" set to True to make this

    work.

    The developer must specifically set these.

  • 8/3/2019 01 04 Implement View

    26/37

    1-26 Copyright Oracle Corporation, 2002. All rights reserved.

    Construction Mode

    There are three construction modes for your query

    region:

    resultsBasedSearch

    autoCustomizationCriteria none

  • 8/3/2019 01 04 Implement View

    27/37

    1-27 Copyright Oracle Corporation, 2002. All rights reserved.

    Results-based Search

    A results-based search is the simplest to build, but

    offers little control of the search panels.

    All you need to build is the results table.

    Set the Search Allowed property to True forcolumns that should have fields in the search panel.

    You do not need to handle any buttons.

    You do not need to build an initQuery() method on

    your VO.

    You cannot have an LOV or other specialvalidation on a search field.

  • 8/3/2019 01 04 Implement View

    28/37

    1-28 Copyright Oracle Corporation, 2002. All rights reserved.

    Auto Customization Criteria Search

    An autoCustomizationCriteria search requires you to

    build the search panels but allows greater control.

    Build the results table.

    Build the search fields for each search panel. Create mappings between the search fields and

    the table columns.

    Build any LOV or other special validation you want

    on a search field.

    You do not need to handle any buttons.

    You do not need to build an initQuery() method on

    your VO.

  • 8/3/2019 01 04 Implement View

    29/37

    1-29 Copyright Oracle Corporation, 2002. All rights reserved.

    Construction Mode of "None"

    For the "none" construction mode, you must create

    your own simple and/or advanced search panels, and

    you must implement your own Go button.

  • 8/3/2019 01 04 Implement View

    30/37

    1-30 Copyright Oracle Corporation, 2002. All rights reserved.

    Manually-Built Search Regions

    Many Search regions have been built manually without

    using the query bean.

    Build region with search criteria fields and a Go

    button. Build results table region.

    Handle Go button in processFormRequest.

    Call AM and have the AM call initQuery method in

    your VO.

    Initialize and execute query in your initQuery

    method in your VOImpl.java class.

    You must write code to prevent blind queries.

  • 8/3/2019 01 04 Implement View

    31/37

    1-31 Copyright Oracle Corporation, 2002. All rights reserved.

    Disabling Blind Queries

    Blind queries can cause huge performance impacts

    and must be prevented.

    With query bean, use Selective Search Criteria

    property set to True on items to force the user toenter criteria in at least item where it is set to

    True.

    For a manually-built search, you must write code

    to prevent blind queries.

  • 8/3/2019 01 04 Implement View

    32/37

    1-32 Copyright Oracle Corporation, 2002. All rights reserved.

    Lists of Values (LOVs)

    Two types of declarative LOV

    In-line LOV region

    External LOV region

    Dynamic query construction Add to either in-line or external LOV

    Define "Programmatic Criteria" in LOV mappings

    Requires an extra controller

  • 8/3/2019 01 04 Implement View

    33/37

    1-33 Copyright Oracle Corporation, 2002. All rights reserved.

    Lists of Values (LOVs)

    1A

    Base Page

    2B

    C

    4D

    LOV Window

    Search by 1

    4

    2 4

    4

    1

    4

    ResultsE F G H

    E

    F

    Search

    Go

    Cancel Select

    Criteria

    Hidden Criteria

    Return

  • 8/3/2019 01 04 Implement View

    34/37

    1-34 Copyright Oracle Corporation, 2002. All rights reserved.

    Defining an LOV

    Build the LOV region:

    Create an LOV region of style ListofValues

    Create a table region inside the LOV region

    Include items to show in the results table of theLOV window

    Items that user can choose to enter query criteria

    in LOV window must have Search Allowed

    property set to True.

  • 8/3/2019 01 04 Implement View

    35/37

    1-35 Copyright Oracle Corporation, 2002. All rights reserved.

    Defining an LOV

    Attach the LOV region to the base page (if an external

    LOV region):

    Base page LOV field must have Item Style

    property set to messageLovInput. Set External List of Values property to qualified

    name of region file.

  • 8/3/2019 01 04 Implement View

    36/37

    1-36 Copyright Oracle Corporation, 2002. All rights reserved.

    Defining an LOV

    Create the LOV mappings:

    LOV field on base page must be specified for both

    Criteria From and Return To properties.

    Other fields can only be used for one direction(criteria item or return item).

    Other criteria fields provide hidden criteria that is

    always applied to the search in the LOV window.

  • 8/3/2019 01 04 Implement View

    37/37

    1-37 Copyright Oracle Corporation 2002 All rights reserved

    Summary

    You should now be able to build a basic OA Extension

    page using:

    Regions

    Items Attribute sets

    Search regions

    LOVs