Oracle® HTML DB
Release 2.0
  Go To Table Of Contents
Contents

Previous
Previous
Next
Next
 

Editing a Page Definition

A page is the basic building block of an application. Each page has page ID, a name, and typically some text attributes such as a header, title and footer. You add content to your page by creating page controls (regions, items, and buttons). Page templates and page region templates control the exact look and feel of each page.

Topics:

Accessing a Summary View of Controls, Components, and Application Logic

Each Page Definition serves a a central navigation point for all the controls, components, and application logic that define a page.

You can access a summary view of all defined controls or components by selecting the title (for example, Regions, Button, Items, Computations, Processes, and so on). For example, selecting Regions displays a summary report of all currently defined regions on the current page. You can use this summary view to:

  • Edit the multiple attributes at once by making new selections from the available fields and select lists.

  • Link to a definition page by clicking the Edit icon.

You can access additional summary views by clicking the buttons at the top of each page. To save your edits to any summary view, click Apply Changes.

You can also view the attributes of a specific control or component by selecting its name on the Page Definition. For example, suppose your Page Definition contains a region named Customers. Clicking the region name Customers would display an attributes page for that region.

Copying or Creating a Control or Component

You can copy or create new controls or components by clicking the Copy and Create icons. The Create icon resembles of a plus (+) sign that overlaps a small page. Click the Create icon to create a new control or component.

The Copy icon resembles two small overlapping pages. Click the Copy icon to make a copy of an existing control or component.

Editing Page Attributes

Page attributes only apply to a specific page. You access page attributes from the Page Definition.

To edit page attributes:

  1. Navigate to the Page Definition:

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. At the top of the page, click Edit Attributes.

    The Page Attributes page appears. Required values are marked with a red asterisk (*).

The topics that follow describe the specific sections of the Page Attributes page.


See Also:

"Adding Pages to an Application" for information about creating a new page

Name

Use these attributes to define general attributes for the current page such as a page name, an optional alphanumeric alias, and associated page groups. Table 5-7 describes these attributes.

Table 5-6 Page Attributes: Name

Attributes Descriptions

Name

Identifies the name of the current page for application developers. This name is used in numerous Oracle HTML DB pages and reports, along with the page ID and page title.

Page Alias

Enter an alphanumeric alias for this page. This alias must be unique within the current application.

For example, if you were working on page 1 of application 100, you could create an alias called home. You could then access this page from other pages using the following f?p syntax:

f?p=100:home

Group

Identify the page group you would like to associate with this page. Page groups do not affect functionality, but help developers manage the pages within an application.

See Also: "Grouping Pages"


Display Attributes

Use these attributes to define general display attributes for the current page such as the selected page template, standard tab set, title, and cursor focus. Table 5-7 describes these attributes.

Table 5-7 Page Attributes: Display Attributes

Attributes Descriptions

Page Template

Select a page template to control the appearance of this page. Making a selection here overrides the default page template defined within the current theme.

See Also: "Changing Default Templates in a Theme"

Standard Tab Set

Select a standard tab set to be used for this page. A standard tab set is associated with a specific page and page ID. You can use standard tabs to link users to a specific page.

See Also: "Creating Tabs"

Title

Enter a title to display in the title bar of the browser window. The HTML DB engine uses the title you specify here in place of the #TITLE# substitution string used in the page template. This title is inserted between the HTML tag <TITLE></TITLE>.

Cursor Focus

Select whether or not you want the cursor focus to be placed in the first field on the page.

Select Do not focus cursor if you do not want to include JavaScript.


Header and Footer

Use these attributes to define page header, body header, body footer, and page footer text. Table 5-8 describes these attributes.

Table 5-8 Page Header, Footer and Text Attributes

Attribute Description

Header Text

Enter the text of the HTML to display after the page template header and before page template body.

Body Header

Enter the text of the HTML to display before showing regions. Displays before the page template #BOX_BODY# substitution string.

Footer

Enter the text of the HTML to display after page template body and before page template footer.


HTML Header

Use this attributes to replace the #HEAD# substitution string in the page template header. The values entered here are inserted after the HTML <HEAD> tag. Common uses of these attributes:

  • Code page-specific inline cascading style classes

  • Add additional style sheets for a specific page

  • Code page-specific JavaScript

  • Code page-specific meta tag page refresh

On Load

Use this attribute to add events when the page is being loaded, such as calls to JavaScript. In the Page HTML Body Attribute, enter JavaScript or text to be substituted for your page template's #ONLOAD# substitution string. To use this feature, your page template must include the #ONLOAD# substitution string.

You can use the Page HTML Body attribute to write into the contents of the opening <BODY> tag. A typical page template might use #ONLOAD# within the opening <body> tag as shown in the following example:

<html>
<head>
...
</head>
<body #ONLOAD# >

Security

Use these attributes to specify an authorization scheme, authentication, and URL access protection for the current page. Table 5-9 describes these attributes

Table 5-9 Page Attributes: Security

Attribute Description

Authorization Scheme

Select an authorization scheme to be applied to the page. Authorization schemes are defined at the application level and can be applied to many elements within the application.

An authorization scheme is evaluated either once for each application session (at session creation), or once for each page view. If the selected authorization scheme evaluates to true, then the page displays and is subject to other defined conditions. If it evaluates to false, then the page will not display and an error message displays.

See Also: "Providing Security Through Authorization"

Authentication

Specifies whether this page has been defined as public or requires authentication. If a page is identified as public, the page can be viewed before authentication. This attribute only applies if the application uses SCHEME authentication. The application's page sentry function can access this page attribute to identify pages that do not require prior authentication to view. The implementation of the authentication scheme's page sentry function determines if this attribute has any effect.

See Also: "Establishing User Identity Through Authentication"


Duplicate Submission

Use the Allow duplicate page submissions list to specify whether or not Oracle HTML DB users may process a page multiple times in a row. Set this attribute to No to prevent duplicate page submissions from being processed multiple times.

Examples of duplicate page submissions include:

  • A user clicks the Submit button multiple times.

  • You create a branch of type Branch to Page, and the user clicks the browser reload button.

Configuration

Build options allow you to enable or disable functionality. Most application attributes have a build option attribute. Do not specify a build option for the current page unless you plan to exclude the page in certain configurations.

Build options have two possible values: INCLUDE and EXCLUDE. If you specify an attribute as being included, then the HTML DB engine considers it part of the application definition at run time. Conversely, if you specify an attribute as being excluded, then the HTML DB engine treats it as if it does not exist

On Error Text

Use this attribute to specify the error text that displays in the #NOTIFICATION_MESSAGE# template substitution string in the event an error occurs on the page.


See Also:

"Page Templates"

Help

Use this attribute to enter Help text for the current page.

Help text is displayed using a help system that you must develop. To show the Help for a specific page, call the HTMLDB_APPLICATION.HELP procedure from a page that you create for displaying Help text. For example, you could use a navigation bar icon similar to:

f?p=4000:4600:&APP_SESSION.::&DEBUG::LAST_STEP:&APP_PAGE_ID

Page-level help supports shortcuts using the following syntax:

"SHORTCUT_NAME"

Comments

Use this attribute to record developer comments about the current page. These comments never display when the application is running.

About Page Rendering Controls

Use the Page Rendering section of the Page Definition to specify attributes for defined regions, buttons, items, page rendering computations, and page processes.

Regions

A region is a section of a page that serves as a container for content within a page. The content of a region is determined by the region source. For example, a region may contain a report based on a SQL query you define, or it may contain static HTML.


See Also:

  • "Customizing Regions" for information about creating specific types of regions

  • Oracle Database Application Developer's Guide - Fundamentals for information about developing Web applications with PL/SQL

  • Oracle Database PL/SQL Packages and Types Reference for information about htp packages


Buttons

As you design your application, you can use buttons to direct users to a specific page or URL, or to post or process information. Buttons can be placed in predefined region template positions or among items in a form.

Items

An item can be a text field, text area, password, select list, check box, and so on. Item attributes affect the display and behavior of items on a page. For example, these attributes can impact where a label displays, how large an item will be, and whether or not the item will display next to, or below the previous item.

There are two categories of items: page items and application items. Page items are placed on a page and have associated user interface properties, such as Display As, Label, and Label Template. Application items are not associated with a page and therefore have no user interface properties. An application item can be used as a global variable.


See Also:

"Creating Items"

Page Computations

You can use computations to assign a value to an identified item when a page is submitted or displayed.

Page Processes

You create a page process to execute some type of logic (for example, using PL/SQL), or to make a call to the rendering engine. Typically a process performs an action. For example, a process may be hand coded PL/SQL, or the invocation of a predefined process available within Oracle HTML DB.

About Page Processing Controls

Use the Page Processing section of the Page Definition to specify application logic such as computations, validations, processes, and branches. In general, the HTML DB engine runs this logic in the order it appears on the Page Definition.

Topics:

Understanding Validations

You can define a validation declaratively by selecting a validation method. You enter the actual validation edit check in the Validation Messages field. Be aware that if a validation fails, subsequent page processes or computations will not occur. Also remember that the validation you enter must be consistent with the validation type you selected. For more information about validation types, see online Help.

Creating a Validation

To create a new validation:


Note:

Text entered for validations may not exceed 3,950 characters.

  1. Navigate to the appropriate Page Definition:

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. Under Validations, click the Create icon.

    The Create Validations Wizard appears.

  3. Select a validation level. Item level validations are specific to a single item. Page level validations do not apply to any single item, but apply to an entire page.

  4. If you selected Item level validation, select the item to be validated and click Next.

  5. Select a validation method as described in Table 5-10.

    Table 5-10 Validation Methods

    Validation Method Descriptions

    SQL

    Compares item values to data in the database.

    For example, you can use a SQL validation to verify whether a last name typed into a field exists in the database. In the following Exists SQL validation, the field is named P1_LAST_NAME and the table is named customers.

    SELECT 1 FROM customers 
    WHERE last_name = :P1_LAST_NAME
    

    PL/SQL

    Useful if you need complex logic to validate entered data.

    For example, suppose you need to create a validation for an address form that requires the user enter a province if the address is not in the United States. You could create the validation as a Function Returning Boolean, using the following PL/SQL:

    BEGIN
      IF :P1_COUNTRY = 'US' AND :P1_PROVINCE IS NULL THEN
         RETURN FALSE;
      ELSE
        RETURN TRUE;
      END IF;
    END;
    
    

    You could also create the same validation implemented as a PL/SQL Expression as follows:

    NOT (:P1_COUNTRY='US' AND  :P1_PROVINCE IS NULL);
    

    Item Level Null

    Checks if an item's value in session state is null.

    For example, you could validate that the user enters a value in a field by creating an item validation and then selecting the validation method Item Not Null.

    Item String Comparison

    Compares the value of an item to a specific string.

    There are several string comparison validations that compare the value of an item to a literal string. For example, you select the validation type Item in Expression 1 is contained in Expression 2 to validate a user entry in a field against a list of values you provide.

    In Expression 1, enter the name of item you want to validate without a colon. For example:

    P1_VALUE
    
    

    In Expression 2, enter a string a values you want to validate against For example:

    ABC/DEF/GHI
    
    

    Regular Expression

    Regular expressions provide a method to describe text patterns. Use a Regular Expression validation to perform data validation.

    For example, you could use the following regular expression validation to verify that a string of entered data always consists of groups of six numbers separated by commas and followed by a comma:

    ^([[:digit:]]{6},)+$
    
    

    This regular expression would find the following entries valid:

    123456,654321,

    123456,

    123456,123456,654321,

    However, the following would not be valid:

    123456,12345

    12345


  6. For SQL, PL/SQL, and Item String Comparison validations, select the type of validation you want to create and click Next.

  7. Specify the sequence and validation name and click Next.

  8. Depending upon the validation method, enter the validation or message text that displays if the validation fails. Click Next.

  9. Define conditions that apply to this validation and click Create.

Defining How Validation Error Messages Display

You can choose to have validation error messages display inline (that is, on the page where the validation is performed) or on a separate error page.

To define how a validation error message displays:

  1. Navigate to the appropriate Page Definition:

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. Under Validations, select the appropriate validation.

    The attributes page for the validation appears.

  3. Scroll down to Error Message.

  4. In Error Message, enter your error message text.

  5. From Error message display location, select a display location.

    This attribute identifies where a validation error message displays. Validation error messages can display on an error page or inline within the existing page. Inline error messages can display in a notification area (defined as part of the page template) or within the field label.

    To create a hard error that stops all processing (including validations), you must display the error on an error page.

  6. If you select Inline with Field or Inline with Field and in Notification, you need to associate an item with the error message. To associate an item with the error message, select the item from the Associated Item list.

  7. Click Apply Changes.

Processing Validations Conditionally

You can control when and if a validation is performed under Conditions.

To create a condition for an existing validation:

  1. Navigate to the appropriate Page Definition:

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. Under Validations, select the appropriate validation.

    The attributes page for the validation appears.

  3. Scroll down to Conditions.

  4. To have a validation performed when a user clicks a particular button, make a selection from the When Button Pressed list.

  5. Make a section from the Condition Type list.

  6. Depending upon the selected Condition Type, enter values in the Expression attributes. The validation will be rendered or processed if the specified condition is met.

  7. Click Apply Changes.

Understanding Branches

A branch is an instruction to go to a specific page, procedure, or URL. For example, you can branch from page 1 to page 2 after page 1 is submitted.

You create a new branch by running the Create Page Branch Wizard and specifying Branch Point and Branch Type. The Branch Type defines the type of branch you are creating. For more information about Branch Types, see online Help.

Defining a Branch Point and Action

When you click a standard tab in an Oracle HTML DB application, the HTML DB engine sets session state, executes computations, and then links you to the target page. It does not run any processes or explicitly defined branches. In cases where the page is submitted without clicking a tab, the HTML DB engine explicitly defined branches to direct users to a subsequent page.

You can control when a branch executes by making a selection from the Branch Point list. Available options include:

  • On Submit: Before Computation - Branching occurs before computations, validations, or processing. Use this option for buttons that do not need to invoke any processing, for example, a Cancel button.

  • On Submit: Before Validation - Branching occurs after computations, but before validations or processing. If a validation fails, page processing stops, a rollback is issued, and the page displays the error. Because of this default behavior, you do not need to create branches to accommodate validations. However, you may want to branch based on the result of a computation (for example, to a previous branch point).

  • On Submit: Before Processing - Branching occurs after computations and validations, but before processing. Use this option to branch based on a validated session state, but before performing any page processing.

  • On Submit: After Processing - Branching occurs after computations, validations, and processing. This option branches to a URL or page after performing computations, validations, and processing. When using this option, remember to sequence your branches if you have multiple branches for a given branch point.

  • On Load: Before Header - Branching occurs before a page is rendered. This option displays another page instead of the current page or redirects the user to another URL or procedure.

Depending upon the Branch Type you select, you can specify the following additional information in the Action attributes:

  • The page ID of the page to which you want to branch

  • PL/SQL procedure which ultimately renders a branch target page

  • A URL address

Branching Conditionally

Like other controls, branches can be made conditional. To create a conditional branch, make a selection from the Condition Type list, and enter text in the expression fields to implement the condition type you choose.

Understanding Page Computations

Use page computations to assign a value to an identified item when a page is submitted or displayed. You can also use application-level computations to assign values to items. Most application-level computations are performed for every page in an application. In contrast, computations created at the page-level only execute when that page is rendered or processed.

Topics:

Creating a Page Computation

You create a page computation by running the Create Page Computation Wizard. For each computation, specify the item for which you are creating the computation as well as a computation type.

To create a page computation:

  1. Navigate to the appropriate Page Definition:

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. Under Computations, click the Create icon.

  3. For Item Location, select the where the computation will execute and click Next. Location options include:

    • Item on this Page

    • Item on Another Page

    • Application Level Item

  4. For Item, select the item and computation point at which you would like to perform the computation:

    1. Compute Item - Select the item the computation will update.

    2. Sequence - Select the order of evaluation.

    3. Computation Point - Select the point at which the computation executes. The computation point On New Instance executes the computation when a new session (or instance) is generated.

    4. Computation Type - Select the method of computation you want to create.

    5. Click Next.

  5. In Computation, enter a computation which corresponds to the selected computation type and click Next.

  6. On Condition, you can choose to make the computation conditional. To make a computation conditional, make selection from the Condition Type list and enter text in the expression fields.

  7. Click Create.

Understanding Computation Points and Computation Syntax

A good example of using computations can be illustrated by a page containing form fields for entering phone numbers. In this example, the phone number is stored in one database column, however the data entry form breaks the phone number into three components; area code, prefix, and line number. In this example, the page items are called P10_AREA_CODE, P10_PREFIX, and P10_LINE_NUMBER.

Next, suppose you need to combine the values stored in these items into a single string. You could accomplish this by using an After Submit computation and store the combined values in an item called P10_PHONE_NUMBER.

To create a computation to store the combined values of P10_AREA_CODE, P10_PREFIX, and P10_LINE_NUMBER in new items:

  1. Navigate to the appropriate Page Definition:

  2. Create a new item named P10_PHONE_NUMBER to store the combined values of P10_AREA_CODE, P10_PREFIX, and P10_LINE_NUMBER. See "Creating a Page-Level Item".

  3. Under Computations, click the Create icon.

  4. For Location, select Item on this Page and click Next.

  5. For Compute Item, select P10_PHONE_NUMBER.

  6. For Sequence, select the order of evaluation.

  7. For Computation, you have the option of creating one of the following computation types:

    1. Static Assignment:

      • For Computation Type, select Static Assignment and click Next.

      • Enter the following computation:

        (&P10_AREA_CODE.) &P10_PREFIX.-&P10_LINE_NUMBER.
        
        
      • Click Next.

    2. PL/SQL Function Body:

      • For Computation Type, select PL/SQL Function Body and click Next.

      • Enter the following computation:

        DECLARE
        l_return_value  VARCHAR2(300) DEFAULT NULL;
        BEGIN
            l_return_value :=
        '('||:P10_AREA_CODE||')'||:P10_PREFIX||'-'||:P10_LINE_NUMBER;
        RETURN l_return_value;
        END;
        
        
      • Click Next.

    3. SQL Query:

      • For Computation Type, select SQL Query and click Next.

      • Enter the following computation:

        SELECT '('||:P10_AREA_CODE||')'||:P10_PREFIX||'-'||:P10_LINE_NUMBER FROM DUAL
        
        
      • Click Next.

    4. PLSQL Expression:

      • For Computation Type, select PLSQL Expression and click Next.

      • Enter the following computation:

        '('||:P10_AREA_CODE||')'||:P10_PREFIX||'-'||:P10_LINE_NUMBER
        
        
      • Click Next.

  8. Click Create.

Editing Page Computation Attributes

Once you create a computation, you can edit it on the Edit Page Computation page.

To edit a page computation:

  1. Navigate to the appropriate Page Definition:

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. Under Computations, select the computation name.

    Edit Page Computation page appears.

  3. Click Apply Changes.

Editing the Computation Point and Source

You control when a computation executes under the Computation Point attributes by specifying a sequence and a computation point. The computation point On New Instance executes the computation when a new session (or instance) is generated.

Under Source, enter an expression or query to compute an item's value. In the event a computation fails, you can optionally define an error message in Computation Error Message field.

Creating Conditional Computations

You can make a computation conditional by making a selection from the Condition Type list and entering text in the expression fields.

Understanding Page Processes

A page process performs an action at a specified point during the rendering or submission of the page. For example, you can create a page process to execute logic or to make a call to the HTML DB engine. A page process is a unit of logic that runs when a specific event occurs, such as loading or submitting page.

From a functional perspective, there is no difference between page-level and application-level processes. The difference between these two process types is where the process is defined, that is at the page level or at the application level.

Topics:

Creating a Page Process

You create a process by running the Create Process Wizard. During the wizard, you define a process name, specify a sequence, the point at which process will execute, and select a process category. You can change nearly all of these attributes on the Edit Page Process page.

To create a new process:

  1. Navigate to the appropriate Page Definition:

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. Under Processes, click the Create icon.

  3. Select a category. Table 5-11 describes available page process categories.

    Table 5-11 Process Categories

    Process Category Description

    Data Manipulation

    Data Manipulation process types are frequently used by wizards to support data manipulation language (DML) actions. Oracle HTML DB supports the following declarative data manipulation processes:

    • Select Automatic Row Fetch and Automatic Row Processing (DML) to create an automatic data manipulation language (DML) process

    • Use Multi Row Update and Multi Row Delete in conjunction with tabular forms.

    • Use Add Rows to Tabular Form in conjunction with a tabular form

    Close Popup Window

    Upon execution, this process type closes a popup window and refreshes the calling window.

    Form Pagination

    Implements pagination through the detail records associated with a master detail form. Most often used in master detail forms (such as in the Master Detail Wizard), this process checks the master table to determine which set of detail records you are in and determines what the next detail record should be.

    See Also: "Building a Master Detail Form"

    On Demand

    Creates an application-level process that can only be executed when called from a specific page. When you create this process type at the page-level, you are creating reference to an existing application-level process.

    See Also: "About On Demand Application Processes"

    PL/SQL

    Runs the PL/SQL you provide. Use this process type to execute a block of PL/SQL entered directly into the process or to simply call an existing API.

    Reset Pagination

    In Report regions, resets pagination back to the first result set. The HTML DB engine keeps track of where the user is within a given result set. This process category returns the user to the beginning result set. In other words, this category resets the counters associated with the report region to return the first part of the result set the next time the result set displays.

    Session State

    Sets the values of existing session state items to null. Select this process type to clear the cache for applications, sessions, or items as well as to clear existing user preferences.

    See Also: "Managing Session State Values" and "Managing User Preferences"

    Web Services

    Implements a Web Service as a process on a page. Running the process submits a request to the service provider.

    See Also: "Invoking a Web Service as a Process"


  4. Follow the on-screen instructions.

Editing Process Attributes

Once you create a process, you can control when the process executes and what the process does by editing attributes on the Edit Page Process page.

To edit an existing page process:

  1. Navigate to the appropriate Page Definition:

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. Select the process name.

    The Edit Page Process page appears.

Changing Processing Points and Source

You control when a process executes by specifying a sequence number and a process point under Process Point. You can prevent a process from running during subsequent visits to a page by selecting one of the following options under Run Process:

  • Once for each page visit

  • Once for each session or when reset

Enter the appropriate code for PL/SQL process types. For PL/SQL anonymous block processes, enter the appropriate code under Process. For Clear Cache processes, enter the appropriate code under Source. In the event a process fails, you can optionally define an error message in the Process Error Message field.

Creating Conditional Processes

You can make a process conditional by selecting a condition type and entering an expression under Conditional Processing.

Additionally, you can also make a selection from the When Button Pressed attribute. When you select a button from this list, the process only executes if a user clicks the selected button.