Oracle Application Express includes support for modal and non-modal dialog pages. Modal and non-modal dialog pages are only supported if the current application theme contains at least one page template of template type Dialog Page.
6.4.1 About Supported Dialogs
When you create a new page, the wizard prompts you to select a Page Mode. The Page Mode determines if the page is a normal application page or a dialog page. Oracle Application Express supports two types of dialog pages:
Modal Dialog - A modal dialog is an overlay window positioned within the same browser window. A modal dialog remains active and focused until the user has finished with it and closes it. While a modal dialog is active, the user is unable to interact with the rest of the page until the dialog is closed.
Non-modal Dialog - A non-modal dialog displays a separate popup browser window. A user can interact with a non-modal dialog and content on the page. Use a non-modal dialog when the requested information is not essential to continue. This type of window can be left open while work continues elsewhere.
6.4.2 Using a Dialog Page Template
Oracle Application Express includes dialog page templates in the Universal Theme - 42. When you set the Page Mode to either Modal or Non-Modal, Oracle Application Express automatically uses the default dialog page template. This section describes how to create a dialog template if your theme does not include one and how to edit dialog template attributes.
22.214.171.124 Creating a Dialog Page Template
If you are using an existing application and the theme does not contain such a dialog page template, then you must create one. While you can create one from scratch, the easiest option is to copy an existing dialog template.
To create a dialog page template:
- Navigate to the Shared Components, Templates page:
- On the Workspace home page, click the App Builder icon.
- Select an application.
- Click Shared Components.
- Under User Interface, select Templates.
- Click Create.
- In the Create Template Wizard:.
- Template Type - Select Page and click Next.
- Creation Method - Select As a Copy of an Existing Template and click Next.
- Copy From - Select the application to copy from and click Next.
- Identify Theme - Select the theme you are copying from and the theme you are copying to and click Next.
- New Templates - Locate the Modal Dialog template. Under Copy, select Yes.
- Select Copy Page Templates.
- Verify the dialog page template is active in the current theme
126.96.36.199 About Defining Dialog Page Template Attributes
6.4.3 Defining a Dialog Page in Page Designer
To define a page as a dialog in Page Designer:
- View the page in Page Designer:
Page Designer appears. Attributes are organized in groups.
- On the Workspace home page, click the App Builder icon.
- Select an application.
- Select a page.
- In Page Designer locate the Appearance group.
- For Page Mode, select one of the following:
- Modal Dialog - The page is presented as a modal dialog. A modal dialog is an overlay window positioned within the viewport, which remains active and focused until the end user dismisses (closes) it. The underlying page is grayed out and the end user is prevented from interacting with the rest of the page until the dialog is closed.
- Non-Modal Dialog - The page is presented as a non-modal dialog. A non-modal dialog is an overlay window positioned within the viewport, where the end user can interact with the dialog, and content on the page that launched the dialog. A non-modal dialog can be used when the requested information is not essential to continue, work can continue elsewhere while the window is still open.
- Edit other Appearance attributes as needed.
To learn more about an attribute, see field-level Help.
- Under Dialog, edit the appropriate attributes:
- Width - Enter the width of the dialog, in pixels
or a percentage. The substitution string
#DIALOG_WIDTH#in the dialog initialization code of the page template is replaced with the value entered in this item. For a page using a Desktop user interface, the value is set in pixels, such as 500.
- Height - Enter the height of the dialog, in pixels, for example, 500. The substitution string
#DIALOG_HEIGHT#in the dialog initialization code of the page template is replaced with the value entered.
- Maximum Width - Enter the maximum width of the dialog in pixels. The substitution string
#DIALOG_MAX_WIDTH#in the dialog initialization code of the page template is replaced with the value entered in this item.
- Attributes - Dialog support varies depending on the user interface of the page. A subset of dialog attributes are declaratively supported: height, width, and maximum width. To define any additional attributes for the dialog, enter the name/value pairings in a comma separated list. The substitution string
#DIALOG_ATTRIBUTES#in the dialog initialization code defined at page template level, is replaced by any value(s) entered in this item.
- CSS Classes - Enter classes to add to this component. You may add multiple classes by separating them with spaces.
- Chained - Select On if this dialog is opened by another dialog, and should reuse the same dialog window. For example, if this dialog is part of a multiple page dialog wizard and you wish to reuse the dialog window for each step of the wizard. Select Off if this dialog is opened by another dialog and should be opened in a new dialog window. For example, when this dialog is modal, and you wish to open it within a parent modal dialog window.
- Width - Enter the width of the dialog, in pixels or a percentage. The substitution string
- To save your changes, click Save.
6.4.4 Generating a Cancel Dialog Dynamic Action on the Dialog Page
apex.navigation.dialog.cancel) to handle the cancelling the dialog.
6.4.5 Generating a Close Dialog Page Process on the Dialog Page
You close a dialog page in Oracle Application Express by creating a Close Dialog page process. In previous releases, this page process was referred to as a
apex.navigation.dialog.close), to handle the closing of the dialog. The page process also supports the return of dialog page items, which you may wish to reference on the parent page. To view examples, edit any of the Dialog pages in the Sample Database Application.
6.4.6 About Branching with Dialog Pages
You can open dialog pages using buttons or links. Dialog pages support the following branching options:
Dialog page to dialog page.
You can branch from one dialog page to another dialog page if:
Both pages have the same Page Mode, for example Modal Dialog and the dialog Chained attribute is set to On. Setting the Chained attribute to On enables support for chained or nested dialogs such as the dialogs that appear many internal Application Express wizards. Chained or nested dialogs enable you to re-use a dialog window to display each page.
Dialog page to Normal page.
When branching from a dialog page to a normal page, the dialog page is closed and the user navigates to a new page in the browser. The new page can be parent (or launching) page or another Normal page in an application.
6.4.7 Handling Refresh Actions on Parent Page
If you have generated a Close Dialog page process on the dialog page, you must implement refresh actions on the parent page using the new
Dialog Closed dynamic action event type. You can use the set type Dialog Return Item when creating a Set Value True Action, to set a single value, based on the return item of a dialog.
To see an example, go to the Products page in the Sample Database Application. On the Products page, the Create Product button has an associated dynamic action that launches the dialog. Closing the dialog triggers the
Dialog Closed dynamic action. You can use this type of dynamic action for whatever True Actions you wish to define. In this example, it refreshes the report on the parent page and submits the page.
For a partial page refresh of a parent page, implement the close dialog with dynamic action (for example, for report and form pages where you want to edit data in a modal dialog form and only want the report refreshed on close). In contrast, branching is the best approach if you have a multi step modal wizard or if you have several possible target pages when closing the dialog.