13.3 Managing Buttons
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). You can also configure buttons to display conditionally or warn users of unsaved changes.
- About Actions Buttons Can Perform
Use buttons to submit a page or redirect to a different page or different URL. - Creating a Button
Create buttons in Page Designer. - Editing a Button
Edit buttons in Page Designer. - About Branching with Buttons
Learn about branching with buttons. - About the Relationship Between Button Names and REQUEST
The name you give a Submit button (that is, a button with an Action of Submit Page) determines the value of the built-in attributeREQUEST
when the page is submitted. - Displaying a Button Conditionally
You can choose to have a button display conditionally by editing the Server-side Condition attribute in Page Designer. - Configuring Button Attributes to Warn Users of Unsaved Changes
Use the Warn on Unsaved Changes attribute to warn users of unsaved changes when they attempt to navigate away from a page. - Displaying a Button Confirmation Dialog
Display a Confirmation dialog after the button is clicked by enabling the Requires Confirmation attribute.
Parent topic: Managing Application Controls
13.3.1 About Actions Buttons Can Perform
Use buttons to submit a page or redirect to a different page or different URL.
The Behavior, Action attribute determines the action to be performed when a button is clicked. Available options include:
-
Submit Page - Submit the current page with a
REQUEST
value equal to the Button Name. -
Redirect to Page in this Application - Redirect to a page in the current application with optional additional attributes for resetting pagination, setting the request value, clearing cache, and setting item values on the target page.
-
Redirect to Page in a different Application - Redirect to a page in a different application with optional additional attributes for resetting pagination, setting the request value, clearing cache, and setting item values, on the target page.
Note:
Redirecting to a page in different application relies on deep linking being enabled in the target application. To enable deep linking, go to the application's Security attributes and enable Deep Linking. -
Redirect to URL - Redirect to the target URL you specify.
-
Defined by Dynamic Action - Does not submit the page or redirect to another page. Instead the button's behavior is defined by a Dynamic Action.
Parent topic: Managing Buttons
13.3.2 Creating a Button
Create buttons in Page Designer.
To create a button in Page Designer:
See Also:
Parent topic: Managing Buttons
13.3.3 Editing a Button
Edit buttons in Page Designer.
To edit a region button in Page Designer:
Parent topic: Managing Buttons
13.3.4 About Branching with Buttons
Learn 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 Oracle APEX 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 App 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 is only be considered if a user clicks the button.
See Also:
Parent topic: Managing Buttons
13.3.5 About the Relationship Between Button Names and REQUEST
The name you give a Submit button (that is, a button with an Action of Submit Page) determines the value of the built-in attribute REQUEST
when the page is submitted.
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. And you can 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 capitalization (case) is preserved. In other words, if you name a button LOGIN, then a request looking for the name Login fails. For example:
<input type="BUTTON" value="Finish" onclick="apex.submit('Finish');">
In this example Finish is the name of the REQUEST
and this example is case-sensitive.
Parent topic: Managing Buttons
13.3.6 Displaying a Button Conditionally
You can choose to have a button display conditionally by editing the Server-side Condition attribute in Page Designer.
To have a button display conditionally:
Parent topic: Managing Buttons
13.3.7 Configuring Button Attributes to Warn Users of Unsaved Changes
Use the Warn on Unsaved Changes attribute to warn users of unsaved changes when they attempt to navigate away from a page.
To configure the Warn on Unsaved Changes attribute:
Tip:
The Warn on Unsaved Changes attribute is implemented using the apex.page.warnOnUnsavedChanges
API.
See Also:
Configuring Pages to Warn Users of Unsaved Changes and warnOnUnsavedChanges in Oracle APEX JavaScript API Reference
Parent topic: Managing Buttons
13.3.8 Displaying a Button Confirmation Dialog
Display a Confirmation dialog after the button is clicked by enabling the Requires Confirmation attribute.
To display a button confirmation dialog:
Parent topic: Managing Buttons