Skip Headers
Oracle® HTML DB User's Guide
Release 1.6

Part Number B14303-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

8 Building an Application

This section describes how to use Application Builder to build an application and application components. It includes instructions for creating an application and adding pages as well as adding components (reports, charts, or forms), page controls (buttons, items, list of values), or a shared components (menus, lists, or tabs).

This section contains the following topics:

Creating an Application

You create a new application in Oracle HTML DB using the Create Application Wizard. You delete an application from the Application Builder home page.

Topics in this section include:

Creating a New Application

You can use the Create Application Wizard to create a new application having up to nine pages.

To create an application using the Create Application Wizard:

  1. Navigate to the Workspace home page.

  2. Click the Create Application button.

  3. Choose the method by which you want to create your application:

    • From Scratch. Enables you to define tabs, select a user interface (UI), and many other options.

    • Based on an Existing Application. Creates a copy of another application, including any authentication settings, but without any the pages. Select this option to create an application using the same user interface templates as an existing application.

    • Based on an Existing Table. Creates a complete application based on an existing table in your workspace. The resulting application includes a standard report, an insert form, an update form, a success form (indicates when a record is successfully inserted), an analysis menu page, analysis reports, analysis charts, and a login page.

    • Demonstration Application. Installs a demonstration application included with Oracle HTML DB.

    • Based on Spreadsheet. Creates an easily deployable application from a spreadsheet.

    • From an Application Export File. Uploads an application export file.

  4. Follow the on-screen instruction.

    Once you create an application the next step is to specify application attributes.

Deleting an Application

You can delete an application from the Application Builder home page, or while editing application attributes. If you delete an application you also delete all defined components (reports, charts, or forms), page controls (buttons, items, list of values), or a shared components (menus, lists, or tabs).

To delete an application from Application Builder home page:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select an application.

  3. When Application Builder appears, verify the application name and the application ID at the top of the page.

  4. From the Tasks list, select Delete this Application.

  5. Follow the on-screen instructions.

To delete an application while editing application attributes:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select an application.

  3. When Application Builder appears, verify the application name and the application ID at the top of the page.

  4. Click the Edit Attributes icon.

    The Edit Application Attributes page appears.

  5. Verify the application ID and name.

  6. Click Delete at the top of the page.

Adding Additional Pages

You can add a new page or add a component to an existing page by running the Create Page Wizard. You can access this wizard on the Application Builder home page, the Page Definition, or by selecting the New... link on the Developer toolbar.

When you run the Create Page Wizard, you choose whether to create a blank page or a page with a component. Select Page with Component to create a page containing a report, a chart, a form, a wizard, a calendar, or a tree.


Note:

You can add a component (that is, a report, chart, form, wizard, a calendar, or tree) to an existing page using the Create Page Wizard. When prompted, specify an existing page number.

Topics in this section include:

Creating a Page from Application Builder

To create a new page from the Application Builder home page:

  1. Navigate to Workspace home page.

  2. From the Applications list, select an application.

  3. On the Application Builder home page, click Create Page.

  4. Select the type of page you wish to create:

    • Blank Page

    • Page with Component

      Select Page with Component to create a page containing a report, a chart, a form, a wizard, a calendar, or a tree. Selecting this option creates complete pages containing multiple attributes. For example, the Report wizard generates one page containing one region and multiple buttons.

  5. Follow the on-screen instructions.

Creating a Page from the Page Definition

To create a new page while viewing a Page Definition:

  1. Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)

  2. From the navigation bar at the top of the page, click the Create button.

  3. Select the type of page you wish to create:

    • Blank Page

    • Page with Component

      Select Page with Component to create a page containing a report, a chart, a form, a wizard, a calendar, or a tree. Selecting this option creates complete pages containing multiple attributes. For example, the Report wizard generates one page containing one region and multiple buttons.

  4. Follow the on-screen instructions.

Creating a Page from the Developer Toolbar

Users who log in to Oracle HTML DB having developer privileges have access to the Developer toolbar. The Developer toolbar displays at the bottom every page and offers a quick way create a new page.

To create a new page from the Developer toolbar:

  1. On the Developer toolbar, select New.

    The New Component Wizard appears.

  2. Select the type of page you want to create:

    • Page (Blank Page)

    • Component (Report, Form, Chart)

    • Page Control (Region, Item, Button)

    • Shared Control (Menu, List, Tab)

  3. Follow the on-screen instructions.

Running a Page

The HTML DB engine dynamically renders and process pages based on data stored in database tables. To view a rendered version of your application, you run or submit it to the HTML DB engine. As you create new pages you can run them individually, or run an entire application. You can run a page from numerous locations within Application Builder by clicking the Run icon. (See Figure 8-1.)

Figure 8-1 Run Icon on the Pages List

Description of run_ico_sm.gif follows
Description of the illustration run_ico_sm.gif

To run a specific page from the Pages list:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select an application.

    Application Builder appears. The list of pages for the selected application appears at the bottom of the page.

  3. From the Pages list, locate the page you wish to run and click the Run button in the far right column.

To run a specific page from the Page Definition:

  1. Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)

  2. Click the Run button in the upper right corner of the page.

To run an entire application:

  1. Navigate to the Workspace home page.

  2. Locate the application in the Applications list.

  3. Click the Run button in the far right column.

Grouping Pages

You can make the pages within your application easier to access by organizing them into page groups.

Topics in this section include:

Creating a Page Group

To create a page group:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select an application.

  3. From the Tasks List on the right side of the page, select Manage Page Groups.

  4. On the Page Groups page, click Create.

  5. Enter a name, a description (optional), and click Create.

Assigning Pages to a Page Group

To assign pages to page group:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select the application.

  3. From the Tasks List on the right side of the page, select Manage Page Groups.

  4. From the Tasks list, select Report Unassigned Pages.

    The Unassigned Pages page appears.

  5. From Page Group, select a group to assign pages to.

  6. Select the pages to be assigned.

  7. Click Assigned Checked.

    Selecting the page number takes you to the Page Attributes page. Selecting the Page Name links to the Page Definition.

Viewing the Page Group Report

The Page Group Report offers a comprehensive list of which pages in an application are assigned to a group and which pages are unassigned.

To view the Page Group Report:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select the application.

  3. From the Tasks List on the right side of the page, select Manage Page Groups.

  4. On the Page Groups page, click Report Page Groups.

Locking and Unlocking Page

You can prevent conflicts during application development by locking pages of your application. By locking a page, you prevent other developers from editing it.

To lock a page of your application:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select the application.

  3. To lock pages from the Locked Pages page:

    1. From the Tasks List on the right side of the page, select Manage Page Locks.

    2. Select the appropriate pages and click Lock.

    3. Enter a comment in the Comment field.

    4. Click Lock Pages.

  4. To lock pages from the Pages list:

    1. Click the Lock icon in the Pages list.

    2. Enter a comment in the Comment field.

    3. Click Lock Pages.

  5. To lock pages from the Page Definition:

    1. Navigate to the Page Definition. (See "Viewing a Page Definition".)

    2. Click the Lock icon in the upper right corner above Shared Components.

      The Locked Pages page appears.

    3. Select the appropriate pages and click Lock.

    4. Enter a comment in the Comment field.

    5. Click Lock Pages.

Only the user who locked a page can unlock it.

To unlock a page of your application:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select the application.

  3. To unlock pages from the Locked Pages page:

    1. From the Tasks List on the right side of the page, select Manage Page Locks.

    2. Select the appropriate pages.

    3. Click UnLock.

  4. To unlock pages from the Pages list:

    1. Click the Lock icon in the Pages list.

      The Edit Page Lock page appears.

    2. Click UnLock.

  5. To unlock pages from the Page Definition:

    1. Navigate to the Page Definition. (See "Viewing a Page Definition".)

    2. Click the Lock icon in the upper right corner above Shared Components.

      The Locked Pages page appears.

    3. Select the appropriate pages.

    4. Click UnLock.

Note the Lock icon changes to reflect the lock status of a given page.

Accessing Alternative Locked Pages Views

You can access a number of different views of Locked Pages on the Locked Pages page.

To access different views of locked pages:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select the application.

  3. From the Tasks List on the right side of the page, select Manage Page Locks.

  4. From the Tasks list, select one of the following:

    • Show Locked Pages displays only locked pages within the current application

    • Show All Pages displays all pages within the current application

    • Show Unlocked Pages display only unlocked pages within the current application

    • Administer Locks enables workspace administrators to unlock any pages locked by a developer

Deleting a Page

You can delete a page from the Page Definition or while editing page attributes.

To delete a page from the Page Definition:

  1. Navigate to the Page Definition. (See "Viewing a Page Definition".)

  2. Verify the page name.

  3. From the navigation bar at the top of the page, click Delete.

  4. Follow the on-screen instructions.


See Also:

"Editing a Page Definition" for more information on editing page attributes

To delete a page while editing page attributes:

  1. Navigate to the Page Definition. (See "Viewing a Page Definition".)

  2. From the navigation bar at the top of the page, click Edit Attributes.

  3. Verify the application ID and page name.

  4. Click Delete.

  5. Follow the on-screen instructions.

Creating Reports

In Oracle HTML DB a report is the formatted result of a SQL query. You can generate reports by selecting and running a built-in query, or by defining a report region based on a SQL query.

Topics in this section include:

Creating a Report Using a Wizard

Oracle HTML DB includes the number of built-in wizards for generating reports.

To create a report using a wizard:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select the application.

    Application Builder appears.

  3. Click Create Page.

  4. Select Page with Component.

  5. Select Report.

  6. Select one of the following report types:

    • Easy Report - Does not require any SQL knowledge. Simply select the appropriate schema, table, columns, and result set display.

    • Report with Form - Builds a two page report and form combination. The first page enables users to specify the row to be updated. The second page includes a form for updating the selected table or view.

    • SQL Report - Creates a report based on a custom SQL SELECT statement or a PL/SQL function returning a SQL SELECT statement that you provide.

  7. Follow the on-screen instructions.

Editing Report Attributes

You can use the Report Attributes and Column Attributes pages to precisely control the look and feel of report pages. For example, you can use these attributes to alter column heading text, change column positioning, hide a column, create a sum of a column, or select a sort sequence.

On the Page Definition, you can access the Report Attributes page by clicking either Q or RPT adjacent to the report region you want to edit. Q indicates the report is a regular report and RPT indicates the report is an easy report. You can also navigate to the Report Attributes page by clicking the region name then selecting the Report Attributes tab.

To access the Report Attributes page:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select the application.

  3. Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)

  4. Under Regions, click Q next to the name of the report region you want to edit.

    The Report Attributes page appears.

    Figure 8-2 Report Attributes Page

    Description of rpt_att.gif follows
    Description of the illustration rpt_att.gif

    Heading Type identifies how the heading was generated for the report. Use the Report Column Attributes section to control report column appearance and functionality. The Link column indicates whether a column link is currently defined. The Edit column indicates whether or not a column is currently updatable. The Edit column.

    Table 8-1 describes common report column edits.

    Table 8-1 Common Report Column Edits

    Description Developer Action
    Alter column display sequence. Click the up and down arrows.
    Alter heading alignment. Under Column Alignment, select a new column alignment.
    Change column heading text. Under Heading, enter a different heading text.
    Control which columns display. Click Show to indicate a column should display.
    Enable an unique sort sequence. Click Sort and select a sequence number from Sort Sequence.
    Enable the sum of a column. Click Sum to enable the sum of a column.

    You can further refine the attributes of a specific column on the Column Attributes page.

  5. To access the Column Attributes page, click the Edit icon adjacent to the appropriate column name.

    See online help for more information on a specific attribute.

Controlling Report Pagination

You control report pagination by:

  • Including a pagination substitution string in the report template

  • Making selections from Layout and Pagination on the Report Attributes page

You control how pagination displays by making selections from the Layout and Pagination attributes on the Report Attributes page.

To access the Layout and Pagination section of the Report Attributes page:

  1. Create a report. (See "Creating a Report Using a Wizard".)

  2. Under Regions, click the appropriate report attributes link (Q or RPT).

    The Report Attributes page appears.

  3. Scroll down to Layout and Pagination.

    You use the Layout and Pagination attributes to select a pagination style, determine where pagination displays, and specify the number of rows that display on each page. Table 8-2 describes the most commonly used Layout and Pagination attributes.

Table 8-2 Layout and Pagination Attributes

Attribute Description
Report Template Specifies a template to be applied to this report. Report templates provide control over the results of a row from your SQL query. You can choose from a number of default templates, or pick a custom build template.
Pagination Scheme Specifies a pagination scheme for this report.

Pagination provides the user with information about the number of rows and the current position within the result set. Pagination also defines the style of links or buttons used to navigate to the next or previous page.

For more information, see the help for this item.

Display Position Defines where pagination displays.

If you choose to display pagination above a report, the selected report template needs to support that type of display.

Number of Rows Defines the maximum number of rows to display on each page.
Strip HTML Specifies whether or not to remove HTML tags from the original column values for HTML expressions and column links.

If you select values from the database that already contain HTML tags, then those tags can cause conflicts with the HTML generated for your columns links or HTML expressions. When this option is enabled, only the actual data portion of your column value is used.


Including Pagination After the Rows in a Report

To include pagination after the rows in a report:

  1. Create a report. (See "Creating a Report Using a Wizard".)

    Next, select the appropriate Layout and Pagination attributes.

  2. Navigate to the Report Attributes page:

    1. Navigate to the Page Definition.

    2. Under Regions, click the appropriate report attributes link (Q or RPT)

      The Report Attributes page appears.

  3. Under Layout and Pagination, select the following:

    1. Report Template - Select a report template (optional).

    2. Pagination Scheme - Select a pagination scheme.

    3. Display Position - Select a display position.

    4. Number of Rows - Specify how many rows display on each page.

    5. Click Apply Changes.

  4. Edit the report template.

    1. Navigate to the Page Definition.

    2. Under Templates, select the report template name.

    3. Include the #PAGINATION# substitution string in the After Rows attribute.

    4. Click Apply Changes.

  5. Run the page.

Including Pagination Before the Rows in a Report

To include pagination after the rows in a report:

  1. Create a report. (See "Creating a Report Using a Wizard".)

    Next, select the appropriate Layout and Pagination attributes.

  2. Navigate to the Report Attributes page:

    1. Navigate to the Page Definition.

    2. Under Regions, click the appropriate report attributes link (Q or RPT).

      The Report Attributes page appears.

  3. Under Layout and Pagination:

    1. Report Template - Select a report template (optional).

    2. Pagination Scheme - Select a pagination scheme.

    3. Display Position - Select a position that contains the word "top."

    4. Number of Rows - Specify how many rows display on each page.

    5. Click Apply Changes.

  4. Edit the report template.

    1. Navigate to the Page Definition.

    2. Under Templates, select the report template name.

    3. Include the #TOP_PAGINATION# substitution string in the Before Rows attribute.

    4. Click Apply Changes.

  5. Run the page.

Enabling Column Sorting

You enable column sorting on the Report Attributes page.

To enable column sorting:

  1. Navigate to the Report Attributes page. (See "Editing Report Attributes".)

  2. Under Report Column Attributes, select the Sort check box adjacent to the columns to be sorted.

  3. From Sort Sequence, select a sequence number.

    Sort Sequence is optional. However, if there are one or more sort enabled columns, then at least one column needs a defined Sort Sequence.

  4. Scroll down to Sorting.

  5. Specify ascending and descending image attributes or click set defaults.

Exporting a Report as a CSV or XML File

You can create a link within a report that enables users to export the report as either a comma delimited file (.csv) or XML file. You specify an export format by selecting a report template.

To specify an export report template:

  1. Navigate to the appropriate Report Attributes page. (See "Editing Report Attributes".)

  2. Scroll down to Layout and Pagination.

  3. From the Report Template list, select one of the following:

    • export: CSV exports the report as a CSV file

    • export: XML exports the report as a XML file

    Selecting either option prevents the HTML DB engine from rendering the page and dumps the content to either a CSV or XML file.

    You can use the options under CSV Output to create a link that downloads the content of the report.

  4. Scroll down Report Export.

  5. From Enable SCV output, select Yes.

  6. (Optional) In the Separator and Enclosed By fields, define the separator and delimiter characters.

    The default Enclosed By by characters are a double quotes (" "). The default delimiter character is either a comma or a semicolon depending upon your current NLS settings.

  7. In the Link Label field, enter link text. This text will display in your report and enable users to invoke a download.

  8. (Optional) To specify a default export filename, enter a name in the Filename field.

    By default, the HTML DB engine creates an export filename by taking the region name and adding the appropriate filename extension (.csv or .xml).

  9. Click Apply Changes.

Creating a Column link

Use the Column Link attributes to create a link from a report to another page in your application or to a URL.

To create a column link to another page:

  1. Navigate to the appropriate Report Attributes page. (See "Editing Report Attributes".)

  2. Under Report Column Attributes, locate the column to contain the link.

  3. Click the Edit icon adjacent to the column name.

    The Column Attributes page appears.

  4. Scroll down to Column Link.

  5. To create a Column Link to another page:

    1. From Target, select Page in this Application.

    2. (Optional) In Link Attributes, specify additional column link attributes that will be included in the <a href= > tag (for example, a link target, classes, or styles).

    3. In Link Text, enter text to be displayed as a link, specify an image tag, or pick from the list of default images.

    4. In Page, specify the target page number. To reset pagination for this page, select Reset Pagination.

    5. In Request, specify the request to be used.

    6. In Clear Cache, specify the pages (that is, the page numbers) on which to clear cache. You can specify multiple pages by listing the page numbers in a comma delimited list.

    7. Use the Name and Value fields to specify session state for a specific item.

  6. Click Apply Changes.

To create a column link to a URL:

  1. Navigate to the appropriate Report Attributes page. (See "Editing Report Attributes".)

  2. Access the Column Attributes page by clicking the Edit icon adjacent to the appropriate column.

    The Column Attributes page appears.

  3. Scroll down to Column Link.

  4. Under Column Link, make the following selections

    1. From Target Type, select URL.

    2. In Link Text, enter text to be displayed as a link, select a substitution string.

    3. (Optional) In Link Attributes, specify additional column link attributes that will be included in the <a href= > tag (for example, a link target, classes, or styles).

    4. In URL, enter the appropriate address.

  5. Click Apply Changes.

Defining an Updatable Column

You can make a column updatable by editing Tabular Form Element attributes on the Column Attributes page. Note that the HTML DB engine can only perform updates if a multi row update is defined, or PL/SQL process is implemented to process updated data.

To define updatable column attributes:

  1. Navigate to the appropriate Report Attributes page. (See "Editing Report Attributes".)

  2. Access the Column Attributes page by clicking the Edit icon adjacent to the appropriate column.

    The Column Attributes page appears.

  3. Scroll down to Tabular Form Element.

  4. Under Tabular Form Element, make the following selections:

    1. From Display As, select a type of updatable column.

      Use this option to make a column updatable. Updates can only be performed if a multi row update is defined, or PL/SQL process is implemented to process updated data.

    2. From Date Picker Format Mask, make a selection if you selected the Display As type of Date Picker.

    3. In Element Width, specify the width of the form item.

    4. In Number of Rows, specify the height of a form item (applicable to text areas).

    5. In Element Attributes, define a style or standard form element attribute.

    6. In Element Option Attributes, specify form element attributes for items in a radio group or check box.

    7. From Default Type, identify the default type.

    8. In Default, identify the default source.

      Use Default Type and Default Source to add new rows to a tabular form. The HTML DB engine uses this setting to determine the default value for the column. Otherwise, the column is defined as NULL.

    9. From Reference Table Owner, identify the owner of the referenced table. Use this attribute to build User Interface Defaults for reports.

    10. In Reference Table Name, identify the table or view that contains the current report column.

    11. In Reference Column Name, identify the column name that this report column references

  5. Click Apply Changes.

Defining a Column as a List of Values

Report columns may be rendered as lists of values. For example, a column can be rendered using a select list or a popup list of values. Or, a column can also be rendered as read-only text based on a list of values.

This last approach is an effective strategy when creating display lookup values and is particularly useful in regular, non-updatable reports. This approach enables you to display the value of a column without having to write a SQL JOIN.

To render a report column as a list of values:

  1. Navigate to the appropriate Report Attributes page. (See "Editing Report Attributes".)

  2. Access the Column Attributes page by clicking the Edit icon adjacent to the appropriate column.

    The Column Attributes page appears.

  3. Scroll down to List of Values.

  4. From Named LOV, make a selection from the Named List of Values repository.

  5. To include a null value in a list of values:

    1. In Display Null, select Yes.

    2. In Null Text, specify the value that displays.

    A column may also have a value that does not display in its list of values.

  6. To define a value that does not display in the list of values:

    1. From Display Extra Value, select Yes.

      The extra value is used if the actual column value is not part of the LOV. In that situation, the actual value is shown. If you do not display extra values, you may end up with the wrong value and unintentionally and update your data incorrectly.

    2. In Null Value, specify the value that displays.

    3. If you have not selected a Named LOV, enter the query used to display a select list in the LOV Query field.

  7. If you have not selected a Named LOV, enter the query used to display a select list in LOV Query.

  8. Click Apply Changes.

Controlling When Columns Display

You can use the Authorization and Conditional Display column attributes to control when a column displays.

Authorization enables you to control access to resources (such as a report column) based on predefined user privileges. For example, you could create an authorization scheme in which only managers can view a specific report column. Before you can select an authorization scheme, you must first create it.

A condition is a small unit of logic that enables you to control the display of a column based on a predefined condition type. The condition evaluates to true or false based on the values you enter in the Expressions fields.

To specify Authorization and Conditional Display attributes:

  1. Navigate to the appropriate Report Attributes page. (See "Editing Report Attributes".)

  2. Access the Column Attributes page by clicking the Edit icon adjacent to the appropriate column.

    The Column Attributes page appears.

  3. Under Authorization, make a selection from the Authorization Scheme list.

  4. Under Conditional Display, make a selection from the Condition Type list and depending upon your selection, enter an expression or value in the appropriate Expression fields.

    If the authorization is successful and the condition type display evaluates to true, the column displays.

Controlling Column Breaks

You can control whether a specific column repeats and how column breaks appear when printed using Break Formatting attributes. For example, suppose your report displays employee information by department number. If multiple employees are members of the same department, you can increase the readability by specifying the department number only appears once.

To create this type of column break:

  1. Navigate to the appropriate Report Attributes page. (See "Editing Report Attributes".)

  2. Scroll down to Break Formatting.

  3. Make a selection from the Breaks list.

Creating Forms

You can include a variety of different types of forms in your applications. You can include forms that enable users to update just a single row in a table or multiple rows at once. Oracle HTML DB includes a number of wizards you can use to create forms automatically, or you can create forms manually.

Topics in this section include:

Creating a Form Using a Wizard

The easiest way to create a form is to use a wizard. For example, the Form on Table or View Wizard creates one item for each column in a table. It also includes the necessary buttons and processes required to insert, update, and delete rows from the table using a primary key. Each region has a defined name and display position all other attributes are items, buttons, processes, and branches.

To create a form using a wizard:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select an application.

    Application Builder appears.

  3. Click Create Page.

  4. Select Page with Component.

  5. Select Form.

  6. Under Forms, select a wizard described in Table 8-3.

    Table 8-3 Forms Wizards

    Wizard Description
    Form on a Procedure Builds a form based on stored procedure arguments. Use this approach when you have implemented logic or DML (Data Manipulation Language) in a stored procedure or package.
    Form on a SQL Query Creates a form based on the columns returned by a SQL query such as an equijoin.
    Form on a Table or View Creates a form that enables users to update a single row in a database table.
    Form on a Table with Report. 2 pages Creates two pages. One page displays a report. Each row provides a link to the second page to enable users to update each record.

    Note: This wizard does not support tables having more than 127 columns. Selecting more than 127 columns will generate an error.

    Form on Web Service Creates a page with items based on a Web service definition. This wizard creates a user input form, a process to call the Web service, and a submit button.

    See Also: "Creating a Form on a Web Service"

    Form and Report on Web Service Creates a page with items based on a Web service definition. This wizard creates a user input form, a process to call the Web service, a submit button, and displays the results returned in a report.

    See Also: "Creating an Input Form and Report on a Web Service"

    Master Detail Form Creates a form which displays a master row and multiple detail rows within a single HTML form. With this form, users can query, insert, update, and delete values from two tables or views.

    See Also: "Building a Master Detail Form"

    Summary Page Creates a read-only version of a form. Typically used to provide a confirmation page at the end of a wizard.
    Tabular Form Creates a form in which users can update multiple rows in a database.

    See Also: "Creating a Tabular Form"


  7. Follow the on-screen instructions.

Creating a Tabular Form

A tabular form enables users to update multiple rows in a table. The Tabular Form Wizard creates a form to perform update, insert, and delete operations on multiple rows in a database table.

To create a tabular form:

  1. From the Workspace home page, select the appropriate application.

  2. Click Create Page.

  3. Select Page with Component.

  4. Select Form.

  5. Select Tabular Form.

    The Tabular Form Wizard appears.

  6. On Identify Table/View Owner:

    1. Specify the table or view owner on which you want to base your tabular form.

    2. Select the type of tabular form you want to create.

    3. Select a table.

  7. On Identify Table/View Name, select a table.

  8. On Identify Columns to Display:

    1. Specify whether to use user interface defaults.

      User interface defaults enable you to assign default user interface properties to a table, column, or view within a specified schema.

    2. Select the columns (updatable and nonupdatable) to include in the form.

      You can modify the column order or your SQL query after you have created the page.

  9. On Identify Primary Key, select the Primary Key column and a foreign key column (if applicable).

  10. On Defaults for Primary and Foreign Keys, select a source type for the primary key column. Valid options include:

    • Existing trigger - Select this option if a trigger is already defined for the table. You do not need to define a primary key column source for existing columns. Existing columns already have a primary key.

    • Custom PL/SQL function - Select this option if the source is a PL/SQL function returning the key value.

    • Existing sequence - Select this option if an existing sequence is defined for the table. If that is the case, the sequence next value would be used.

  11. On Updatable Columns, select which columns should be updatable.

  12. On Identify Page and Region Attributes.

    1. Specify page and region information.

    2. Select a region template.

    3. Select a report template.

  13. On Identify Tab, specify a tab implementation for this page.

  14. On Button Labels, enter the display text to appear on the Cancel, Submit, Delete, and Add Row buttons.

  15. On Identify Branching, specify the pages to branch to after the user clicks the Submit and Cancel buttons.

  16. Click Finish.


Note:

Do not modify the select list of a SQL statement of a tabular form after it has been generated. Doing so can result in a checksum error when you alter data in the form.

Building a Master Detail Form

A master detail form reflects a one-to-many relationship between two tables in a database. Typically a master detail form displays a master row and multiple detail rows within a single HTML form. With this form, users can insert, update, and delete values from two tables or views.

To create a master detail form:

  1. From the Workspace home page, select the appropriate application.

  2. Click Create Page.

  3. Select Page with Component.

  4. Select Form.

  5. Select Master Detail Form.

    The Master Detail Wizard appears.

  6. On Define Master Table:

    1. Select a table or view owner

    2. Select a table or view name

    3. Select the columns to display

  7. On Define Detail Table:

    1. Specify to show only related tables

    2. Select the table or view owner

    3. Select the table or view name

    4. Select the columns to display

  8. On Define Primary Key, select the primary key column for the master table and then the primary key column for the detail table.

  9. On Define Master and Detail, define the relationships between master and detail tables.

  10. Specify the source for the master table and detail table primary key columns.

  11. On Define Master Options, specify whether to include master row navigation.

    If you include master row navigation, define navigation order columns. If a navigation order column is not defined, the master update form will navigate by the primary key column.

  12. On Choose Layout, specify the layout of the master detail pages.

    You can include the master detail as a tabular form on the same page, or add the master detail on a separate page.

  13. On Page Attributes, review and edit the master page and detail page information.

  14. On Identify Tabs, specify whether to include an optional tab set.

  15. Click Create.

Creating a Form Manually

You can also create a form manually by performing the following steps:

  • Create an HTML region (to serve as a container for your page items)

  • Create items to display in the region

  • Create processes and branches

To create a form manually:

  1. Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)

  2. Create an HTML region:

    • Under Regions, click Create

    • Select the region type HTML

    • Follow the on-screen instructions

  3. Start adding items to the page:

    • Under Items, click Create

    • Follow the on-screen instructions

Processing a Form

Once you create a form, the next step is to process the data a user types by inserting into or updating the underlying database tables or views. There are three ways to process a form:

Creating an Automatic Row (DML) Processing Process

One common way to implement a form is to manually create an Automatic Row Processing (DML) process. This approach offers three advantages. First, you are not required to provide any SQL coding. Second, Oracle HTML DB performs DML processing for you. Third, this process automatically performs lost update detection. Lost update detection ensures data integrity in applications where data can be accessed concurrently.

In order to implement this approach you need to:

  • Add items and define the Item Source Type as Database Column and specify a case-sensitive column name

  • Select the option Always overrides the cache value

To create an Automatic Row Processing (DML) process:

  1. Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)

  2. Under Processes, click the Create icon.

  3. Select the process type Data Manipulation.

  4. Select the process category Automatic Row Processing (DML).

  5. Specify the following process attributes:

    1. In the Name field, type a name to identify the process.

    2. In the Sequence field, specify a sequence number.

    3. From the Point list, select the appropriate processing point. In most instances, select Onload - After Header.

    4. From the Type list, select Automated Row Processing (DML).

  6. Follow the on-screen instructions.

Creating a Process that Contains One or More Insert Statements

In this approach to form handling, you create one or more processes to handle insert, update and delete actions. Instead of having the HTML DB engine handling everything transparently, you are in complete control.

For example, suppose you have a form with three items:

  • P1_ID - A hidden item to store the primary key of the currently displayed row in a table.

  • P1_FIRST_NAME - A text field for user input.

  • P1_LAST_NAME - A text field for user input.

Assume also there are three buttons labeled Insert, Update, and Delete. Also assume you have a table T which contains the columns id, first_name, and last_name. The table has a trigger which automatically populates the ID column when there is no value supplied.

To process the insert of a new row, you create a conditional process of type PL/SQL that executes when the user clicks the Insert button. For example:

BEGIN
  INSERT INTO T ( first_name, last_name )
     VALUES  (:P1_FIRST_NAME, :P1_LAST_NAME);
END; 

To process the update of a row, you create another conditional process of type PL/SQL. For example:

BEGIN
    UPDATE T
       SET first_name = :P1_FIRST_NAME,
           last_name = :P1_LAST_NAME
    WHERE ID = :P1_ID;
END; 

To process the deletion of a row, you create a conditional process that executes when the user clicks the Delete button. For example:

BEGIN
    DELETE FROM T
    WHERE ID = :P1_ID;
END;

Using a PL/SQL API to Process Form Values

For certain types of applications it is appropriate to centralize all access to tables in a single or few PL/SQL packages. If you have created a package to handle DML operations, you can call procedures and functions within this package from a After Submit PL/SQL process to process insert, update and delete requests.

Populating Forms

Oracle HTML DB populates a form on load, or when the HTML DB engine renders the page. You can populate a form in the following ways:

  • Create a process and define the type as Automated Row Fetch

  • Populate the form manually by referencing a hidden session state item

To create an Automated Row Fetch process:

  1. Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)

  2. Under Processes, click Create.

  3. Select the process type Data Manipulation.

  4. Select the process category Automatic Row Fetch.

  5. Specify the following process attributes:

    1. In the Name field, type a name to identify the process.

    2. In the Sequence field, specify a sequence number.

    3. From the Point list, select the appropriate processing point.

    4. From the Type list, select Automated Row Fetch.

  6. Follow the on-screen instructions.

You can also populate a form manually by referencing a hidden session state item. For example, the following code in an Oracle HTML DB process of type PL/SQL would set the values of ename and sal. The example also demonstrates how to manually populate a form by referencing a hidden session state item named P2_ID.

FOR C1 in (SELECT ename, sal
FROM emp WHERE ID=:P2_ID)
LOOP     
     :P2_ENAME := C1.ename;
     :P2_SAL := C1.sal;
END LOOP;

In this example:

  • C1 is an implicit cursor

  • The value of P2_ID has already been set

  • The process point for this process would be set to execute (or fire) on or before Onload - Before Regions

Validating User Input in Forms

You can use validations to check data a user types prior to processing. Once you create a validation and the associated error message, you can associate it with a specific item. 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.

Creating an inline error message involves these steps:

  • Create a new validation and specify error message text

  • Associate the validation with a specific item

To create a new validation:

  1. Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)

  2. Under Validations, click the Create icon.

  3. When the Create Validations Wizard appears, follow the on-screen instructions.

    Validations Types are divided into two categories:

    • Item. These validations start with the phrase "Item" and provide common checks you may want to perform on the item that the validation is associated with.

    • Code. These validations require you provide either a piece of PL/SQL code or SQL query that defines the validation logic. Use this type of validation to perform custom validations that require verifying values of more than one item or accessing additional database tables.

  4. Follow the on-screen instructions.


Note:

Validations may not contain more than 3,950 characters.

To associate an item with a validation and specify error message text:

  1. Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)

  2. Under Validations, select the validation item you want to associate.

    The attributes page for the validation appears.

  3. Scroll down to Error Messaging:

    • In Error message display location, verify the display location

    • In Associated Item, select the item you want to associate with this validation

  4. Click Apply Changes.

About Error Messaging

Error message display location 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.

If you want to create a hard error that stops processing of any remaining validations, you must display the error on an error page.

Creating Charts

Oracle HTML DB includes built-in wizards for generating HTML and Scalable Vector Graphics (SVG) charts. Oracle HTML DB supports two types of graphical charts:

SVG is an XML-based language for Web graphics from the World Wide Web Consortium (W3C). SVG charts are defined using an embed tag. When evaluating whether a SVG chart is the appropriate chart type for your application remember that:

Topics in this section include:

About SVG Plug-in Support

The Adobe SVG plug-in can properly handle data encoded in UTF-8, UTF-16, ISO-8859-1, and US-ASCII. Encoding of an SVG chart is determined by the database access descriptor (DAD) database character set. If the DAD character set is not UTF8, AL32UTF8, AL16UTF16, WE8ISO8859P1, or US7ASCII, SVG charts may not render properly in the Adobe SVG plug-in.

About Creating Charts

You define a chart in Oracle HTML DB using a wizard. For most chart wizards, you select a chart type and provide a SQL query using the following syntax:

SELECT link, label, value
FROM   ...

Where:

  • link is a URL

  • label is the text that displays in the bar

  • value is the numeric column that defines the bar size

For example:

SELECT null, ename, sal
FROM   scott.emp
WHERE  deptno = :P101_DEPTNO

To create a dial chart, select a dial chart type and provide a SQL query using the following syntax:

SELECT value , maximum_value [ ,low_value [ ,high_value] ]
FROM   ...

Where:

  • value is the starting point on the dial

  • maximum_value is the possible highest point on the dial

  • low_value and high_value are the historical low and high values

For example:

select dbms_random.value(500, 1200), 1300, dbms_random.value(100, 200)
FROM DUAL

Table 8-4 describes the chart types available in Oracle HTML DB.

Table 8-4 Available Chart Types

Chart Type Description
Bar (HTML) Bar chart showing one data series with each data point represented by a bar.

HTML-based. Does not require a plug-in.

Bar, Horizontal Single series based bar chart oriented horizontally with each data point in series represented by a bar.

SVG-based. Requires a SVG plug-in.

Bar, Vertical Single series based bar chart oriented vertically with each data point in series represented by a bar.

SVG-based. Requires a SVG plug-in.

Cluster Bar, Horizontal Multiple series based bar chart oriented horizontally and clustered by a common variable with each data point in series represented by a bar (for example, Department sales total clustered by month of year).

SVG-based. Requires a SVG plug-in.

Cluster Bar, Vertical Multiple series based bar chart oriented vertically clustered by a common variable with each data point in series represented by a bar (for example, Department sales total clustered by month of year).

SVG-based. Requires a SVG plug-in.

Dial - Sweep Also known as an angular gauge, this chart shows either percentage of maximum value or absolute value compared to a maximum value represented as a solid area.

SVG-based. Requires a SVG plug-in.

Dial Also known as angular gauge, this chart shows either percentage of maximum value or absolute value compared to maximum value represented as a line.

SVG-based. Requires a SVG plug-in.

Line Multiple series based line chart oriented with each line representing all data points in the series.

SVG-based. Requires a SVG plug-in.

Pie Single series based pie chart with each slice representing a data point in the series.

SVG-based. Requires a SVG plug-in.

Stacked Bar, Horizontal Multiple series based bar chart oriented horizontally with each data point being an absolute value in series representing a segment of a single bar.

SVG-based. Requires a SVG plug-in.

Stacked Bar, Vertical Multiple series based bar chart oriented vertically with each data point being an absolute value in series representing a segment of a single bar.

SVG-based. Requires a SVG plug-in.

Stacked Percentage Bar, Horizontal Multiple series based bar chart oriented horizontally with each data point being an percentage of 100% of the series represented by a segment of a single bar.

SVG-based. Requires a SVG plug-in.

Stacked Percentage Bar, Vertical Multiple series based bar chart oriented vertically with each data point being an percentage of 100% of the series represented by a segment of a single bar

SVG-based. Requires a SVG plug-in.



Note:

Do not change the Type of an existing chart. Instead, delete the existing chart and then re-create it.

Creating a New Chart

How you create a chart depends upon whether you are adding the chart to an existing page, or adding a chart on a new page.

Adding a Chart to an Existing Page

To add a chart to an existing page:

  1. Navigate to the Page Definition.

  2. Under Regions, click the Create icon.

    The Create Region Wizard appears.

  3. Select Chart.

  4. Select the type of chart you wish to create. (See Table 8-4.)

  5. Follow the on-screen instructions.

Adding a Chart to a New Page

To create a chart on a new page:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select an application.

  3. Click Create Page.

  4. When prompted for the type of page to create, select Page with Component.

  5. Select the component type Chart.

  6. Select the type of chart you wish to create. (See Table 8-4.)

  7. Follow the on-screen instructions.

Editing Chart Attributes

Once you have created a chart you can alter its display by editing chart attributes on the chart attributes page.

To access the Chart Attributes page:

  1. Navigate to the Page Definition.

  2. Under Regions, click Chart next to the name of the chart region you wish to edit.

    The Chart Attributes page appears.

    Note that removing the chart title (that is, the Chart Title attribute) may negatively impact the location and display of the chart legend.

Understanding Chart CSS Classes

When you create a new chart, Oracle HTML DB renders it based on cascading style sheet (CSS) classes associated with the current theme. You can change the appearance of a chart by referencing another CSS or by overriding individual classes in the CSS section of the Edit Attributes page

The following sample contains the CSS classes for the dial chart in Sample Application. This example contains all the available CSS classes. Class names appear in boldface.

text{font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;fill:#000000;}
tspan{font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;fill:#000000;}
text.title{font-weight:bold;font-size:14;fill:#000000;}
text.moredatafound{font-size:12;}
rect.legend{fill:#EEEEEE;stroke:#000000;stroke-width:1;}
text.legend{font-size:10;}
#background{fill:#FFFFFF;stroke:none;}
rect.chartholderbackground{fill:#ffffff;stroke:#000000;stroke-width:1;}
#timestamp{text-anchor:start;font-size:9;}
text.tic{stroke:none;fill:#000000;font-size:12}
line.tic{stroke:#000000;stroke-width:1px;fill:none;}
#dial{stroke:#336699;stroke-width:2px;fill:#336699;fill-opacity:.5;}
#dial.alert{fill:#FF0000;fill-opacity:.5;}
#dialbackground{stroke:#000000;stroke-width:none;fill:none;filter:url(#MyFilter);}
#dialcenter{stroke:none;fill:#111111;filter:url(#MyFilter);}
#dialbackground-border{stroke:#DDDDDD;stroke-width:2px;fill:none;filter:url
(#MyFilter);}#low{stroke-width:3;stroke:#336699;}
#high{stroke-width:3;stroke:#FF0000;}
#XAxisTitle{letter-spacing:2;kerning:auto;font-size:14;fill:#000000;text-anchor:middle;}
#YAxisTitle{letter-spacing:2;kerning:auto;font-size:14;fill:#000000;text-anchor:middle;writing-mode:tb;}
.XAxisValue{font-size:8;fill:#000000;}
.YAxisValue{font-size:8;fill:#000000;text-anchor:end;}
.nodatafound{stroke:#000000;stroke-width:1;font-size:12;}
.AxisLine{stroke:#000000;stroke-width:2;fill:#FFFFFF;}
.GridLine{stroke:#000000;stroke-width:0.3;stroke-dasharray:2,4;fill:none;}
g.dataholder rect{stroke:#000000;stroke-width:0.5;}
.legenditem rect{stroke:#000000;stroke-width:0.5;}

Table 8-5 describes all supported CSS class. Note that certain classes only apply to specific chart types.

Table 8-5 Available Chart CSS Classes

Class Description
text Defines the appearance of text that displays in a chart.
tspan Defines the appearance of text that displays in a chart. tspan should match the definition of text.
text.title Overrides the default chart text. Use this class for title text.
text.moredatafound Defines the appearance of more datafound text.
rect.legend Creates the rectangular box that holds the chart legend.

For a remove the legend border, change rect.legend to the following:

rect.legend{fill:#CCCC99;stroke:none;} 

text.legend Defines the text that appears in the chart legend.
#background Creates the entire background for the SVG plug-in.

For a solid white background with no border, change #background to the following:

#background{fill:#FFFFFF;stroke:#FFFFFF;stroke-width:2;}

rect.chartholderbackground (Not applicable to pie and dial charts.) Creates the background of the rectangle that holds the chart data.

For a clear background, change rect.chartholderbackground to the following:

rect.chartholderbackground(display:none;)

#timestamp Only applicable if the Asynchronous Update chart attribute is set to Yes. Controls the appearance of the update timestamp test.

To disable the display of the timestamp, use defines #timestamp as follows in the Custom CSS, Inline attribute.

"#timestamp{display:none;}" 

See Also: "Enabling Asynchronous Updates"

text.tic (Dial charts only.) Defines the numbers on a dial chart.
line.tic (Dial charts only.) Defines the graduation mark that displays directly beneath the number on a dial chart.
#dial (Dial charts only.) Defines the value that displays on the dial chart.
#dial.alert (Dial charts only.) Defines a value (called an alert value) that renders on in a dial chart using a different display.
#dialbackground (Dial charts only.) Creates the background of a dial chart.
#dialcenter (Dial charts only.) Creates the center of the dial on a dial chart.
#dialbackground-border (Dial charts only.) Works in conjunction with #dialbackground to create specific graphic effect.
#low (Dial charts only.) Defines a historical low watermark of the data being displayed on a chart.
#high (Dial charts only.) Defines historical high watermark of the data being displayed on a chart.
#XAxisTitle Defines the title that appears on the X axis
#YAxisTitle Defines the title that appears on the Y axis.
.XAxisValue Defines the value that appears on the X axis.
.YAxisValue Defines the value that appears on the Y axis.
.AxisLabel Similar to axis value.
.nodatafound Defines the text element that displays if no information is available.
.AxisLine Indicates zero on charts that have negative values.
.GridLine Creates the horizontal and vertical lines on the chart.
g.dataholder rect Applies a blanket style to all data that displays in the chart.
.legenditem rect Applies a blanket style to all rectangular items in the legend.

Referencing a Custom Cascading Style Sheet

You can reference a custom cascading style sheet for a chart using the CSS section of the Chart Attributes page. When you reference an external CSS, you can reference it entirely or simply override specific styles.

To reference a custom chart CSS:

  1. Upload the CSS to Oracle HTML DB. (See "Uploading Cascading Style Sheets").

  2. Create a chart. (See "Creating a New Chart".)

  3. Navigate to the Page Definition.

  4. Under Regions, click Chart next to the region name.

    The Chart Attributes page appears.

  5. Scroll down to the CSS section.

  6. From Use Custom CSS, select Yes.

  7. To reference an external CSS exclusively:

    1. In Custom CSS, Link enter a link to a custom CSS. For example:

      #IMAGE_PREFIX#themes/theme_4/svg.css
      
      
    2. Specify that the CSS should be used exclusively. In Custom CSS, Inline enter the following:

      /**/
      
      
  8. To reference a custom CSS and override specific styles:

    1. In Custom CSS, Link enter a link to a custom style sheet. For example:

      #IMAGE_PREFIX#themes/theme_4/svg.css
      
      
    2. In Custom CSS, Inline, enter the custom CSS styles you want to override.

Specifying Custom CSS Styles Inline

You can override specific styles within the default CSS, using the Custom CSS, Inline attribute on the Chart Attributes page.

To override specific styles within the default CSS:

  1. Create a chart. (See "Creating a New Chart".)

  2. Navigate to the Page Definition.

  3. Under Regions, click Chart next to the region name.

    The Chart Attributes page appears.

  4. Scroll down to CSS.

  5. From Use Custom CSS, select Yes.

  6. In Custom CSS, Inline, enter the custom CSS styles you want to override.

Enabling Asynchronous Updates

You can create charts that monitor information by enabling the Asynchronous Update attribute on the Chart attributes page. Enabling this attribute updates the chart to reflect changes in the underlying data within a specified time interval.

To enable asynchronous updates:

  1. Create a chart. (See Creating a New Chart.)

  2. Navigate to the Page Definition.

  3. Under Regions, click Chart next to the region name.

    The Chart Attributes page appears.

  4. Scroll down to Refresh.

  5. From Asynchronous Update, select Yes.

  6. In Update Interval (Seconds), enter the interval in seconds between chart updates. For optimal performance, select an interval that is greater than 2 seconds.

When Asynchronous Update is enabled, a timestamp displays on the chart indicating that last update.

To disable the Asynchronous Update timestamp:

  1. Navigate to the Chart Attributes page.

  2. Locate the CSS section.

  3. From Use Custom CSS, select Yes.

  4. In Custom CSS, Inline edit #timestamp as follows:

    #timestamp{display:none;}
    

Displaying Charts in Other Languages

To display a chart in another language, you edit the text and tspan classes to reflect the correct language.

To display a chart in another language:

  1. Navigate to the Chart Attributes page. (See Editing Chart Attributes.)

  2. Scroll down to CSS.

  3. From Use Custom CSS, select Yes.

  4. In Custom CSS, Inline, edit the text and tspan classes to reflect the correct language. The following example demonstrates how to change a chart to Korean:

    text{font-family:Batang;fill:#000000;}
    tspan{font-family:Batang;fill:#000000;}
    
    

Creating 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 (for example, by creating Create, Cancel, Next, Previous, or Delete buttons).

Buttons can perform two different types of actions. A button can submit the page and then redirect to a URL. Alternately, a button can simply branch to a URL without submitting the page.

Topics in this section include:

Creating a Button Using a Wizard

You create a button by running the Create Button Wizard from the Page Definition. Each button resides in a region. A region is a area on a page that serves as a container for content.

To create a new button:

  1. Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)

  2. If necessary, create an HTML region. (See "Customizing Regions".)

  3. Under Buttons, click the Create icon.

    The Create Button Wizard appears.

  4. Select a region to contain the button.

  5. Select a position for the button:

    • Create a button displayed among this region's items

    • Create a button in a region position

    Select Create a button displayed among this region's items to add a button to a region as if it was an item (for example, to add a button directly to the right of a form field).

  6. If you select Create a button in a region position:

    1. Specify the Button Name and Label.

    2. Select a Button Type: HTML Button (Default), Image, or Template Driven

      Select Button is Reset to create an Undo button. When enabled, this type of button resets the page values to the state they were in when the page was initially rendered.

    3. Select an Action.

      Selecting Submit page and redirect to URL submits the current page to the HTML DB engine whenever a user clicks the button.

      Selecting Redirect to URL without submitting page avoids submitting the page. Choose this action when submitting the page for processing is not necessary (for example, a Cancel button). This action avoids processing in the database and therefore reduces the load.

  7. If you select Create a button displayed among this region's items:

    1. Specify the Button Name and Sequence.

    2. Specify whether the button displays at the beginning of a new line or new field.

    3. Specify a Label.

    4. Enter the value of Request.

    5. Select the Button Style.

  8. Follow the on-screen instructions

Creating an HTML Button

Buttons can be placed in predefined region template position or among items in a form. To create an HTML button, select one of the following while running the Create Button Wizard:

  • Under Task, select Create a button in a region position

  • Under Button Type, select a button type and then HTML Button (default)

Creating Multiple Buttons

You can create multiple buttons within the same region at once using the Create Multiple Buttons Wizard.

To create multiple buttons at once:

  1. Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)

  2. If necessary, create an HTML region. (See "Customizing Regions".)

  3. Under Buttons, click the Create icon.

    The Create Button Wizard appears.

  4. From the Tasks list, select Create Multiple Buttons.

    The Create Multiple Button Wizard appears.

  5. From Place Buttons in Region, select the region to contain the buttons.

  6. From Template, select a template.

  7. In HTML Attributes, Specify HTML attributes for these buttons. This text will be added to the HTML element definition. For example, you could set the class of a text button as follows:

    class="myclass"
    
    
  8. To quickly populate the remaining fields, select make a selection from the Quick Button list on the right side of the page.

  9. Click Create Buttons.

Understanding the Relationship Between Button Names and REQUEST

The name you give a button determines the value of the built-in attribute REQUEST. You can reference the value of REQUEST from within PL/SQL using the bind variable :REQUEST. By using this bind variable, you can conditionally process, validate, or branch based on which button the user clicks. You can also create processes that execute when the user clicks a button. You can also use a more complex condition as demonstrated in the following examples:

If :REQUEST in ('EDIT','DELETE') then ...
If :REQUEST != 'DELETE' then ...

These examples assume the existence of buttons named EDIT and DELETE. You can also use this syntax in PL/SQL Expression conditions. Be aware, however, that the button name case is preserved. In other words, if you name a button "LOGIN" then a request looking for the name "Login" will fail. For example:

<input type="BUTTON" value="Finish" onClick="javascript:doSubmit('Finish');">

Note that in this example Finish is the name of the REQUEST and this example is case-sensitive.

About Branching with Buttons

Each page can include any number of branches. A branch links to another page in your application or to a URL. The HTML DB engine considers branching at different times during page processing. You can choose to branch before processing, before computation, before validation, and after processing. Like any other control in Application Builder, branching can be conditional. For example, you can branch when a user clicks a button. When you create a branch, you associate it with a specific button. The branch will only be considered if a user clicks the button.

Displaying Buttons Conditionally

You can choose to have a button display conditionally by editing attributes on the Edit Pages Button page.

To have a button display conditionally:

  1. Create the button. (See "Creating a Button Using a Wizard".)

  2. Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)

  3. Under Buttons, select the button name.

    The attributes page for the button appears.

  4. Scroll down to Conditional Button Display.

  5. Make a selection from the Condition Type list.

  6. Enter an expression in the fields provided.

  7. Click Apply Changes.

Creating Items

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

There are two types 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. You can use an application item as a global variable.

Topics in this section include:

Creating a Page Level Item

You create a page level item by running the Create Item Wizard from the Page Definition.

To create a new page level item:

  1. Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)

  2. If necessary, create an HTML region. (See "Customizing Regions".)

  3. Under Items, click the Create icon.

  4. Select an item type. (See "About Item Types".)

  5. Follow the on-screen instructions

About Item Naming Conventions

When specifying an item name, remember the following rules. Item names must:

  • Not use quotes

  • Begin with a letter or a numeral, and subsequent characters can be letters, numerals, or underscore characters

  • Be case insensitive

  • Should not exceed 30 characters

  • Cannot contain letters outside the base ASCII character set

About Item Types

When you create an item, you specify an item type. Once you create an item, these types appear on the Display As list on the Edit Page Item page. Table 8-6 describes available item types.

Table 8-6 Available Item Types

Item Type Description
Button Used to build forms in Oracle HTML DB. Use an Item Button when you want to place a button among other fields (or items) in a form. When clicked, this type of button will automatically switch the HTML DB engine to processing mode, enabling you to perform validations, execute processes, or branch the user to another page.
Display Only Oracle HTML DB uses HTML tables to render items. Use this item to control the layout of items in forms by closing a table and starting a new one.
Check box Displayed using a list of values. A list of values is required for items displayed as check boxes. The value corresponding to a checked box is returned in a single colon (:) delimited string.

The following example demonstrates how to create a single check box that returns YES. This example would display both a check box and a field label.

SELECT NULL display_text, 'YES' return_value FROM DUAL;

This example includes the additional text "Click to select."

SELECT 'Click to select' display_text, 'YES' return_value FROM DUAL;

See Also: "HTMLDB_UTIL" for information on breaking up returned values

Date Picker Displays a text field with a Calendar icon next to it. When clicked, this icon displays a small calendar from which the user can select a date and a time (optional).

If the format you need is not included in the Display As list, select Date Picker (use application format mask). When using a format mask, your application looks for the format in an item called PICK_DATE_FORMAT_MASK. Note that you need to populate this item before this item type will work.

See Also: "Populating an Alternative Date Picker Format"

File Browse Displays a text field with a "Browse..." button. This enables the user to locate a file on a local file system and upload it. Oracle HTML DB provides a table for these files to be uploaded to as well as an API to retrieve the files.
Hidden Renders an HTML hidden form element. Session state can be assigned and referenced just like a text field.
List Managers Based on a list of values. This item enables you to manage a list of items by selecting and adding to a list. The list of values display as a popup.
Multiple Select Renders as a multiselect HTML form element. When submitted, selected values are returned in a single colon delimited string. You can break up the values using the HTMLDB_UTIL API.

See Also: "HTMLDB_UTIL"

Password Renders as an HTML password form element.
Popup List of Values Renders as a text field with an icon next to it from which a user can select a value from a popup window. The list in the popup window is driven by a list of values. There are two types of Popup LOVs, one that fetches a set of rows when the window pops up and one that does not.

Popup LOV values must select two columns. For example:

SELECT ename, empno FROM emp

If one of the columns is an expression, remember to use an alias. For example:

SELECT ename||' '||job display_value, empno FROM emp

Radio Renders as an HTML radio group form element, based on a list of values. Choose Radiogroup with Submit to have the page submitted when the radio button is selected.

The following example displays employee names (ename), but returns employee numbers (empno):

SELECT ename, empno FROM emp

Select List Displays using a list of values. A list of values is required for items displayed as a select list. Select lists are rendered using the HTML form element <select>. The values in a select list are determined using a named list of values or a list of values defined at the item level. You may specify the NULL display value and NULL return value.

The following example would return employee names (ename) and employee numbers (empno) from the emp table. Note that column aliases are not required and are included in this example for clarity.

SELECT ename display_text, empno return_value FROM emp

Oracle HTML DB provides additional enhancements to a standard HTML select list:

  • Select List with Submit - Submits the page when the user changes its selected value. Upon submit, the REQUEST will be set to the name of the item that represents the select list, allowing you to execute conditional computations, validations, processes, and branches.

  • Select List with Redirect - Redirects the user back to the same page, setting ONLY the newly selected value of the select list in session state.

  • Select List Returning URL redirect - Based on a list of values with URLs as the return values. Changing the value of the select list causes the browser to redirect to the corresponding URL.

  • Select List with Branch to Page - Based on list of values with page numbers as return values. Changing the selected value in the select list causes the HTML DB engine to branch to the corresponding page.

Text Displays as an HTML text field containing a maximum of 30,000 bytes of text. You control the maximum length and display width by editing the Height and Width item attribute.
Text Area Renders as an HTML text area. This is no maximum length for an item displayed as a text area. You control the height and width by editing the Height and Width item attribute. Additional available Text Area Display As options include:
  • Text Area (auto height) - Varies the height based on the amount of text. Use this option to have a large text area when you have a lot of data and a smaller text area when you have little or no data.

  • Text Area with Counter - Includes a counter that displays the number of bytes entered in the field.

  • Text Area with Spell Checker - Provides a popup English language spell checker.

  • Text Area with HTML Editor - Provides basic text formatting controls. Note that these controls may not work in all Web browsers.

Text Available Text Control display options include:
  • Text Field - Renders as a text field.

  • Text Field (Disabled, does not save state) - Displays a read-only version of a display value from a list of values by using the item's value in session state to look up the corresponding display value in the associated list of values. The value displayed on the screen is not saved in session state upon submit.

  • Text Field (Disabled, saves state) - Displays a read-only version of a display value from a list of values by using the item's value in session state to look up the corresponding display value in the associated list of values.

  • Text Field (always submits page when Enter pressed) - Displays a read-only version of the value in session state. Upon submit, the value displayed is saved in session state.

  • Text Field with Calculator Popup - Renders as a text field with an icon next to. When clicked, the icon displays a small window containing a calculator. Calculations are placed back in the text field.


Referencing Item Values

You can reference item values stored in session state in regions, computations, processes, validation, and branches. Table 8-7 describes the supported syntax for referencing item values.

Table 8-7 Syntax for Referencing Item Values

Type Syntax Description
SQL :MY_ITEM Standard bind variable syntax for items no longer than 30 bytes. Use this syntax for references within a SQL query and within PL/SQL.
PL/SQL V('MY_ITEM') PL/SQL syntax referencing the item value using the V function.

See Also: "Oracle HTML DB APIs"

PL/SQL NV('MY_NUMERIC_ITEM') Standard PL/SQL syntax referencing the numeric item value using the NV function.

See Also: "Oracle HTML DB APIs"

Static Text &MY_ITEM Static text.
Static Text (exact) &MY_ITEM. Static text. Exact Substitution.

You can set the value of an item in your application using any of the following methods:

  • For page items, use the Source Attribute to set the item value.

    From the Page Definition, select the item name to view the Edit Page Item page. Scroll down to Source and edit the appropriate fields.

    You can also set the value of an item in any region based on PL/SQL or a process using the following syntax:

    BEGIN
     :MY_ITEM :=  'new value';
    END;
    
    
  • Pass the value on a URL reference using f?p syntax. For example:

    f?p=100:101:10636547268728380919::NO::MY_ITEM:ABC
    
    
  • Set the value using a computation. Computations are designed to set item values. For example:

    TO_CHAR(SYSDATE,'Day DD Month, YYYY');
    
    
  • Use the PL/SQL API to set an item value within a PL/SQL context. For example:

    HTMLDB_UTIL.SET_SESSION_STATE('MY_ITEM',SYSDATE);
    
    

Displaying Conditional or Read-only Items

You can choose to have an item display conditionally or as read-only by editing attributes on the Edit Pages Item page.

To display a conditional or read-only item:

  1. Create the item. (See "Creating a Page Level Item".)

  2. Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)

  3. Under Items, select the item name.

    The attributes page for the item appears.

  4. To display an item conditionally:

    1. Scroll down to Conditional Display.

    2. Make a selection from the Condition Type list.

    3. Enter an expression in the fields provided.

  5. To make an item read-only:

    1. Scroll down to Read Only Display Settings.

    2. Make a selection from the Read Only Condition Type list.

    3. Enter an expression in the fields provided.

  6. Click Apply Changes.

Creating an Application Level Item

Application level items do not display, but are used as global variables to the application. To reference an application level item you must set a value by using an ON_NEW_INSTANCE computation.

To create a new application level item:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select an application name.

  3. When Application Builder appears, click Shared Components.

  4. Under Logic, select Items.

    The Application Items page appears.

  5. To create a new application item, click the Create icon.

  6. Follow the on-screen instructions.

Accessing Application Item History

You can view history of changes to application items by clicking History at the top of the Application Items page.

Populating an Alternative Date Picker Format

If you need to create a Date Picker item, but the format you need does not appear in the Display As list, you should select Date Picker (use application format mask). When an application uses this type of date picker, the HTML DB engine derives the date format from an item named PICK_DATE_FORMAT_MASK. You can populate this item in two ways:

  • By defining an application substitution string named PICK_DATE_FORMAT_MASK

  • By creating an application level item named PICK_DATE_FORMAT_MASK

Defining PICK_DATE_FORMAT_MASK as an Application Substitution String

One approach to populating PICK_DATE_FORMAT_MASK is to create an application substitution string. You define application level substitution strings on the Edit Application Attributes page. Remember that an application level substitution string is a static value and cannot be altered at runtime.

To define a new application substitution string named PICK_DATE_FORMAT_MASK:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select an application.

    Application Builder appears.

  3. Click the Edit Attributes icon.

  4. Scroll down to Static Substitution Strings.

  5. Create a new static substitution string named PICK_DATE_FORMAT_MASK:

    1. In Substitution String, enter the name PICK_DATE_FORMAT_MASK.

    2. In Substitution Value, enter a value for your for your date format (for example, Month DD, YYYY).

Defining an Application Level Item Named PICK_DATE_FORMAT_MASK

Another approach to populating PICK_DATE_FORMAT_MASK is to create an application level item named PICK_DATE_FORMAT_MASK. This approach enables you to control any items rendered as Date Picker (use application format mask) by simply setting the value of this item. Plus, you can set the value of PICK_DATE_FORMAT_MASK using a computation from anywhere within your application.

If you wish to provide the user with a list of date formats as preferences, you will need to create an application level item named PICK_DATE_FORMAT_MASK and then use a computation to set the value of this item based upon the user's selection.

Creating Lists of Values

A list of values (LOV) is a static or dynamic definition used to display a specific type of page item, such as popup lists of values, a select list, a check box, a radio group, or multiple select lists.

Topics in this section include:

Creating Named LOVs at the Application Level

You define named (or shared) LOVs at the application level by running the Create LOV Wizard and adding them to the Named List of Values repository. All LOVs can be defined as static or dynamic. Static lists are based on predefined pairs of display and return values. Dynamic lists are based on a SQL query you write that selects values from a table.

To create a named LOV:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select an application name.

  3. When Application Builder appears, click Shared Components.

  4. Under User Interface, select Lists of Values.

  5. To create a new LOV, click the Create icon.

  6. Follow the on-screen instructions.

    New named LOVs are added to the Named List of Values repository.

About Static LOVs

Static LOVs are based on a static list of display and return values you specify when you run the Create LOV Wizard. To create a static LOV you run the Create LOV Wizard and select the LOV type Static. Oracle HTML DB stores the display values, return values, and sort sequence you specify in the Named List of Values repository. Once you add a static LOV to the repository you can create an item and display it as a check box, radio group, select list, or popup list based on this definition.

About Popup LOVs

Using a popup LOV is a good choice for lists of values that are too large to return on a single page. Popup LOVs create an icon to the right of a standard text field. When the user clicks this icon, a popup window appears with a list of values represented as a series of links. When the user selects from this searchable list, the selected value will be placed in the text field. You control popup LOVs through templates. You can only specify one popup LOV template for each application.

Popup LOVs must be based on a query that selects two columns with different column aliases. For example:

SELECT ename name, empno id 
   FROM emp

Referencing Session State within a LOV

You can reference session state by using bind variables. In the following example, this LOV only works if the item called my_deptno contains a valid department number.

SELECT ename, empno FROM emp WHERE deptno = :my_deptno

Accessing LOV Reports

Application Builder includes a number of reports designed to help you better manage LOVs, including:

To access LOV reports:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select an application name.

  3. When Application Builder appears, click Shared Components.

  4. Under User Interface, select Lists of Values.

  5. Select one of the following buttons at the top of the page:

    • Edit all lists of values entries

    • Subscription

    • Utilization

    • History

  6. Follow the on-screen instructions.

Bulk Update LOV Data Values

Click Edit all lists of values entries to display the Bulk Update LOV Data Values page. Use this page to edit the display values of all static LOVs at once. To save your changes, click Apply Changes. To search for a specific name, enter keywords at the top of the page and click Go.

Subscribed LOVs

Click Subscription to display the Subscribed LOVs page. This page displays all subscribed LOVs in your application.

LOV Utilization

Click Utilization to display the LOV Utilization page. This page displays LOVs used in the current application. To edit an LOV, click the LOV name.

LOV Change History

Click History to display the LOV Change History page. This page displays a history of recently changed LOVs by date.

Creating Calendars

Oracle HTML DB includes a built-in wizard for generating a calendar. Once you specify the table on which the calendar is based you can create drill down links to information stored in specific columns.

Topics in this section include:

About Creating Calendars

Oracle HTML DB supports two calendar types:

  • Easy Calendar creates a calendar based on schema, table, and columns you specify. The wizard prompts you to select a date column and display column.

  • SQL Calendar creates a calendar based on a SQL query you provide. The SQL SELECT statement you provide must include at least two columns, a date column and display column.

The date column determines which days on the calendar will contain entries. The display column defines a specific row that will display a calendar date.


See Also:

"Calendar Display"

Supported Calendar Substitution Strings

Oracle HTML DB supports a number of date format substitution strings. You can view a complete list of supported substitution strings on the Calendar Templates page.

To view a list of supported substitution strings for calendars:

  1. Navigate to the appropriate calendar template.

  2. Expand the Substitution Stings list on the right side of the page.


See Also:

See "Viewing Templates"

Creating a New Calendar

How you create a calendar depends upon whether you are adding a calendar to an existing page, or adding a calendar on a new page.

Adding a Calendar to an Existing Page

To add a calendar to an existing page:

  1. Navigate to the Page Definition.

  2. Under Regions, click the Create icon.

    The Create Region Wizard appears.

  3. Select Calendar.

  4. Select the type of calendar you wish to create:

    • Easy Calendar creates a calendar based on the date column and display column you specify.

    • SQL Calendar creates a calendar based on a SQL query you provide.

  5. Follow the on-screen instructions.

Adding a Calendar to a New Page

To create a calendar on a new page:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select an application.

  3. Click Create Page.

  4. When prompted for the type of page to create, select Page with Component.

  5. Select the component type Calendar.

  6. Select the type of calendar you wish to create:

    • Easy Calendar creates a calendar based on the date column and display column you specify.

    • SQL Calendar creates a calendar based on a SQL query you provide.

  7. Follow the on-screen instructions.

Converting an Easy Calendar to a SQL Calendar

Creating an Easy Calendar is the simplest way to create a calendar in Oracle HTML DB. However, if you find the resulting calendar does not meet your needs, you can quickly convert it to SQL Calendar.

To convert an Easy Calendar to a SQL Calendar:

  1. Navigate to the Page Definition.

  2. Under Regions, click CAL next to the region name.

    The Calendar Attributes page appears.

  3. From the Tasks list, select Convert to SQL Based calendar.

    Converting an Easy Calendar to a SQL Calendar, adds a Region Source section to the Region Definition. The Region Source contains the original SQL query that creates the calendar. By having accessing the Region Source, you can easily edit the query to meet your needs.

Editing a Calendar Title

The title that appears at the top of calendar corresponds to the region title.

To alter the region title:

  1. Navigate to the Page Definition.

  2. Under Regions, select the region name.

    The Region Definition appears.

  3. Under Region, enter a new title.

  4. Click Apply Changes.

Editing Calendar Attributes

Once you have created a calendar you can alter how it appears by editing its attributes.

Topics in this section include:

Accessing the Calendar Attributes Page

To access the Calendar Attributes page:

  1. Navigate to the appropriate Page Definition. (See "Viewing a Page Definition".)

  2. Under Regions, click CAL next to the region name.

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

Calendar Display

Use Calendar Display to specify a calendar template, date columns, and general calendar formatting.

Calendar Template determines what template is used when the HTML DB engine renders a calendar. Date Column defines the column from the table or query containing the dates to be placed on the calendar. Display Column defines a specific row that displays on a calendar date.

To select another Display Column:

  1. Navigate to the appropriate Calendar Attributes page.

  2. Locate the Calendar Display section.

  3. To specify another display column, make a selection from the Display Column list.

  4. Click Apply Changes.

To specify a custom Display Column:

  1. Navigate to the appropriate Calendar Attributes page.

  2. Locate the Calendar Display section.

  3. From Display Type, select Custom.

  4. In Column Format enter a custom column format. You can use an HTML expression and supported substitution strings.

  5. Click Apply Changes.

Calendar Interval

Use Calendar Interval to define the dates which are included in the calendar.

Begin At Start Of Interval determines when the calendar should start. Selecting this option creates a calendar that spans an entire interval (for example, a month). For example:

  • If Begin at start of interval is selected, the date is June 15th, and the display is monthly, the resulting calendar spans from June 1st to June 30th.

  • If Begin at start of interval is not selected, the date is June 15th, and the display is monthly, the resulting calendar spans from June 15th to June 30th.

Date Item holds the date on which the calendar is based.

The next two attributes define which items hold the calendar start date and end date. You can use these attributes to create calendars that span multiple months at a time. Item Containing Start Date points to an item that holds the start date of the calendar. Item Containing End Date points to an item that holds the end date of calendar. Note that format of the date of either item must be YYYMMDD.

Start of Week determines the day of the week on which the calendar starts.

Column Link

Use Column link to create a link on the column in the calendar.

To create a column link to another page:

  1. Navigate to the appropriate Calendar Attributes page.

  2. Scroll down to Column Link.

  3. From Target is a, select Page in this Application.

  4. In Page, specify the target page number. To reset pagination for this page, select reset pagination for this page.

  5. In Request, specify the request to be used.

  6. In Clear Cache, specify the pages (that is, the page numbers) on which to clear cache. Specify multiple pages by listing the page numbers in a comma delimited list.

    You can set session state (that is, give a listed item a value) using the next two attributes:

  7. To set session state:

    1. Set these items - Enter a comma delimited list of item names for which you would like to set session state.

    2. With these values - Enter a comma delimited list of values for the items specified in the previous step.

      You can specify static values or substitution syntax (for example, &APP_ITEM_NAME.). Note that item values passed to f?p= in the URL may not contain a colon (:). Additionally, item values may not contain commas unless you enclose the entire value in backslash characters (for example, \1234,56\).

  8. Click Apply Changes.

To create a column link to a URL:

  1. Navigate to the appropriate Calendar Attributes page.

  2. Scroll down to Column Link.

  3. From Target is a, select URL.

  4. In URL, enter the appropriate address.

  5. Click Apply Changes.

Day Link

Use Day link to create link on a day in the calendar. This attribute creates a link on an actual numeral (or day) on the calendar.

To create a day link to another page:

  1. Navigate to the appropriate Calendar Attributes page.

  2. Scroll down to Day Link.

  3. From Target is a, select Page in this Application.

  4. In Page, specify the target page number.

    To reset pagination for this page, select reset pagination for this page.

  5. In Request, specify the request to be used.

  6. In Clear Cache, specify the pages (that is, the page numbers) on which to clear cache. Specify multiple pages by listing the page numbers in a comma delimited list.

    You can set session state (that is, give a listed item a value) using the next two attributes:

  7. To set session state:

    1. Set these items - Enter a comma delimited list of item names for which you would like to set session state.

    2. With these values - Enter a comma delimited list of values for the items specified in the previous step.

      You can specify static values or substitution syntax (for example, &APP_ITEM_NAME.). Note that item values passed to f?p= in the URL may not contain a colon (:). Additionally, item values may not contain commas unless you enclose the entire value in backslash characters (for example, \1234,56\).

  8. Click Apply Changes.

To create a day link to a URL:

  1. Navigate to the appropriate Calendar Attributes page.

  2. Scroll down to Day Link.

  3. From Target is a, select URL.

  4. In URL, enter the appropriate address.

  5. Click Apply Changes.

Utilizing Shortcuts

By using shortcuts you can avoid repetitive coding of HTML or PL/SQL functions. You can use a shortcut to define a page control such as a button, HTML text, a PL/SQL procedure, or HTML. Once defined, you can invoke a shortcut using specific syntax unique to the location in which the shortcut is used. Shortcuts can be referenced many times, thus reducing code redundancy.

This section contains the following topics:

About Shortcut Types

When you create a new shortcut, you must specify the type of shortcut you wish to create. Oracle HTML DB supports the following shortcut types:

  • PL/SQL Function Body

  • HTML Text

  • HTML Text with Escaped Special Characters

  • Image

  • Text with JavaScript Escaped Single Quotes

  • Message

  • Message with JavaScript Escaped Special Quotes

Text with JavaScript Escaped Single Quotes

Use this type of shortcut to reference a shortcut inside of a JavaScript literal string. This shortcut defines a text string. When the shortcut is referenced, it escapes the single quotes required for JavaScript.

Message

Use this type of shortcut to reference a translatable message at runtime. Note that since this shortcut does not have a shortcut body, the name of the shortcut must match the corresponding message name. At runtime, the name of the shortcut expands to the text of the translatable message for the current language.

Message with JavaScript Escaped Single Quotes

Use this type of shortcut to reference a shortcut inside of JavaScript literal string and reference a translatable message at runtime.

Defining Shortcuts

Before you can incorporate a shortcut in your application, you must define it and add it to the Shortcuts repository. You reference new shortcuts using the following syntax:

"MY_SHORTCUT"

Note that the shortcut name must be capitalized and enclosed in quotes.

To define a new shortcut:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select an application name.

  3. When Application Builder appears, click Shared Components.

  4. Under User Interface, select Shortcuts.

  5. Click Create.

  6. Select one of the following creation methods:

    • From Scratch

    • As a Copy of an Existing Shortcut

  7. Follow the on-screen instructions.

New shortcuts are added to the Shortcut repository and are available for use within the following locations:

Accessing Shortcut Reports

Application Builder includes a number of reports designed to help you better manage LOVs, including:

To access of report detailing recent shortcut changes:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select an application name.

  3. When Application Builder appears, click Shared Components.

  4. Under User Interface, select Shortcuts.

  5. Click Create.

  6. Follow the on-screen instructions.

Subscribed Shortcuts

Click Subscription to display the Subscribed Shortcuts page. This page displays all subscribed shortcuts in your application.

Shortcut History

Click History to display the Shortcut History page. This page displays a history of recently changed shortcuts by date.

Incorporating JavaScript into an Application

Adding JavaScript to a Web applications is a great way to add features that mimic those found client/server applications without sacrificing all of the benefits of Web deployment. Oracle HTML DB includes multiple built-in interfaces (or "hooks") especially designed for adding JavaScript.

Remember that JavaScript is not appropriate for data intensive validations. For example, to verify that a name is contained within a large database table, you would need to pull down every record to the client, creating a huge HTML document. In general, complex operations are much better suited for server-side HTML DB validations instead of JavaScript.

This section contains the following topics:

About Referencing Items Using JavaScript

When you reference an item, the best approach is to reference by ID. If you view the HTML source of an Oracle HTML DB page in a Web browser, you would notice that all items have an ID attribute. This ID corresponds to name of the item, not the item label. For example, if you create an item with the name P1_FIRST_NAME and a label of First Name, the ID will be P1_FIRST_NAME.

Knowing the item ID enables you to use the JavaScript function getElementById to get and set item attributes and values. The following example demonstrates how to reference an item by ID and display its value in an alert box.

<script language="JavaScript1.1" type="text/javascript">
  function firstName(){    
    alert('First Name is ' + document.getElementById('P1_FIRST_NAME').value );
  }
 // or a more generic version would be
  function displayValue(id){    
    alert('The Value is ' + document.getElementById(id).value );
  }
</script>
 
  // Then add the following to the "Form Element Attributes" Attribute of the item:
  onChange="javascript:displayValue('P1_FIRST_NAME');"

While it is possible to reference items using the HTML form element attribute name (represented in the previous example as form p_t01), this is strongly discouraged. Remember that the name attribute is dynamic and is determined at when a page is rendered. For example, suppose the first element rendered on a page is p_t01 and the second is p_t02. If you write a function that references p_t01 and then create a new item on the page that appears first, the item that was p_t01 will now be p_t02 and your function will break.

How to Incorporate JavaScript Functions

There are two primary places to include JavaScript functions:

  • In the HTML Header attribute of the page

  • In a .js file in the page template.


See Also:

"Text with JavaScript Escaped Single Quotes" for information on referencing a shortcut inside of a JavaScript literal string

Incorporating JavaScript in the HTML Header Attribute

One way to include JavaScript into your application is add it to the HTML Header attribute of the page. This is good approach for functions that are very specific to a page as well as a convenient way to test a function before you include it in the .js file.

You can add JavaScript functions to a page by simply entering the code into the HTML Header attribute of the Page Attributes page. For example, adding following would test function accessible from anywhere on the current page.

<script language="JavaScript1.1" type="text/javascript>
  function test(){
    alert('This is a test.');
  }
</script>


See Also:

"HTML Header"

Including JavaScript in a .js File in the Page Template

In a .js file in the page template. This is the most efficient approach since a .js file loads on the first page view of your application and is then cached by the browser.

The following demonstrates how to include a .js file in the header section of a page template.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>#TITLE#</title>
    #HEAD#
    <script src="#APP_IMAGES#custom.js" type="text/javascript"></script>
</head>
<body #ONLOAD#>#FORM_OPEN#


See Also:

"Page Templates"

Calling JavaScript from a Button

Calling a JavaScript from a button is a great way to confirm a request. Oracle HTML DB actually uses this technique for the delete operation of most objects. For example, when you delete a button, a JavaScript Alert Box appears asking you to confirm your request. Consider the following example:

<script language="JavaScript1.1" type="text/javascript">
  function deleteConfirm(msg)
  {
var confDel = msg;
if(confDel ==null)
  confDel= confirm("Would you like to perform this delete action?");
else
  confDel= confirm(msg);
  
if (confDel== true)
  doSubmit('Delete');
  }
</script>

This example creates a function to confirm a delete action and then calls that function from a button. Note that the function optionally submits the page and sets the value of the internal variable :REQUEST to Delete, thus performing the delete using a process that conditionally executes based on the value of request.

Note that when you create the button you would need to select Action Redirect to URL without submitting page. Then, you would specify a URL target such as the following:

javascript:confirmDelete('Would you like to perform this delete action?');

Creating Dependent Select Lists

You may use a select list to determine the range of values of another select list on the same page. You can achieve this functionality by having a driving select list submit values to a subsequent select list. You incorporate these values in the subsequent select list as a bind variable in the WHERE clause of its query.

You can have one LOV drive another LOV by:

Consider the following example. The first LOV enables the user to pick a state.

SELECT state_name d, state_id v
FROM states

The second LOV selects the country name and country ID based on the state selected in the first LOV.

SELECT county_name d, county_id v
  FROM counties
WHERE state_id = :Px_STATE_ID

Creating a Help Page

Oracle HTML DB includes built-in attributes to make creating help for your application quick and easy. Creating help for your application involves the following steps:

Help created in Oracle HTML DB displays on a dedicated help page. To access help, users click a link that takes them to a dedicated help page. This help page displays page and item help topics specific to the page they are viewing.

Topics in this section include:

Creating a Help Page and Region

The first step in creating a help for your application it to create a dedicated page and Help Text region.

To create a new Help Text region:

  1. Create new page for your help. (See "Adding Additional Pages".)

  2. Navigate to the Page Definition of your help page. (See "Viewing a Page".)

  3. Under Regions, the Create icon.

  4. When prompted to select a region type, select Help Text.

  5. Follow the on-screen instructions.

Defining Help Text

You define help text for a page or single item by editing attributes. Ideally, you would define these attributes as you create your application. For simplicity, however, the following procedures describe how to define this text after the fact.

To define page help text:

  1. Navigate to the Page Definition for the page for which you want to add page help. (See "Viewing a Page".)

  2. Click Edit Attributes to view the existing page attributes.

  3. Scroll down to Page Help Text.

  4. Enter your help text in the field provided.

  5. Click Apply Changes.

Repeat the previous procedure for each page requiring page help text.

To define item help text:

  1. Navigate to the Page Definition for the page for which you want to add item help.

  2. Under Items, click name of the item you want to edit.

  3. Scroll down to Help Text.

  4. Enter your help text in the field provided.

  5. Click Apply Change.

Repeat the previous procedure for each item requiring help text.

About the Item Help Text Report

If you are including item help in your application, you can edit multiple item help topics at once using the Bulk Edit Item Help report.

To view the Bulk Edit Item Help report:

  1. Navigate to the Workspace home page.

  2. Select an application name from the Applications list.

  3. From the Tasks list, select View Application Reports.

    Application Reports page appears.

  4. Select Item Help Text.

  5. Under Item Help Text column, make the appropriate edits.

  6. Click Apply Changes.

Creating a Help Navigation Bar Icon

Once you have created your help, the next step is to create a navigation bar icon so users can link to it.

To create a navigation bar icon:

  1. Navigate to the Page Definition. (See "Viewing a Page".)

  2. Under Navigation Bar, click the Create icon.

  3. Specify the appropriate NavBar entry attributes:

    • Sequence

    • Alt Tag Text

    • Icon Image Name

    • Image Height and Image Width

    • Text

    Specify the target location.

  4. To specify the target location:

    • From Target type, select Page in this application.

    • In Page, specify the page number.

    • In Request, type:

      &APP_PAGE_ID.
      
      

    By specifying substitution string &APP_PAGE_ID as the Request, you are instructing the HTML DB engine to display help text for the current page when the user clicks this icon.