Databases Reference
In-Depth Information
Figure 7-24. Stop Execution On Error
Settings
The Settings section is only available for certain actions. Each Settings section is different depending on
the action selected. In the example, the only available option is to Show all page items on the same line.
This section will cover the settings options for two different action types: Execute JavaScript Code and
Execute PL/SQL Code.
Execute JavaScript Code: When the action is set to Execute JavaScript Code the Settings section
contains a text box where you can enter some JavaScript code to be run. To help, APEX provides the this
object which contains five different elements. this.triggeringElement , this.browserEvent , and
this.data were already covered in the Dynamic Actions Condition section.
this.action contains information about the action along with some additional
information such as action attributes. Action attributes are useful in plug-in
development. Please refer to Chapter 11 for more information about plugins.
this.affectedElements is a jQuery object array of all the elements that should be
affected as part of this action. If your JavaScript code modifies anything on the
page you should reference this object to find out which elements to modify. The
affected elements are defined in the Affected Elements section on the Edit Action
page which will be covered in the next subsection.
You can get an overview of these objects by clicking on the Code label. To explore all the options
available enter console.log(this); in the Code section, refresh your page, trigger the Dynamic Action,
then look at the console window.
Execute PL/SQL Code: When the action is set to Execute PL/SQL Code, APEX will send an AJAX
request to the database to execute the block of PL/SQL code. You can reference page and application
items using bind variables in this block of code. It's important to remember that the page and
application items are the values in session memory, which may not be the same as the values currently
displayed on the page.
To submit page items as part of the AJAX request, enter them as a comma-delimited list in the Page
Items to Submit field. If any of the items submitted as part of the action have session state protection
enabled, the action will fail since the item requires a checksum which is not provided in AJAX requests.
This is done for security reasons to prevent malicious users from tampering with data.
Search WWH ::




Custom Search