Databases Reference
In-Depth Information
Figure 16-13.
Creating a dynamic action with multiple triggering elements
5.
Set
Condition
to
is null
, and click
Next
.
6.
Set
Action
to
Set Style
, and deselect
Fire On Page Load
.
7.
In the
Settings
region, enter
background
for
Style Name
and
pink
for
Value
, and click
Next
.
8.
Set
False Action
to
Set Style
, and deselect
Fire On Page Load
.
9.
In the
Settings
region, enter
background
for
Style Name
and
white
for
Value
, and click
Next
.
10.
Set
Selection Type
to
Triggering Element
, and click
Create Dynamic Action
.
By entering a comma-separated list of page items, you indicate that the Lose Focus event should fire when the
user navigates away from any of these items. When the dynamic action fires, it checks to see if that item is null and
sets it to the appropriate color. The dynamic action knows which item's background color to set by referencing the
triggering element for the affected element.
Run page 2 of the Help Desk application, and tab through each field, leaving them all blank. You should notice
that as you leave a blank field, it immediately turns pink. If you go back and enter text into a pink field and then
navigate away, the background is set to white.
■
Depending on the browser you're using, you may see that after the pop-up message is dismissed, the subject
field turns pink. this has to do with the order of precedence some browsers give to Javascript events. Certain browsers
place the cursor in the initial page item prior to raising the
PageLoad
event. once the
PageLoad
event fires, the subject
field loses focus, and the
LoseFocus
event fires. When you have multiple dynamic actions on a page, which you often will,
you need to make sure they don't adversely affect one another.
Note
Dynamic Actions Using PL/SQL
Dynamic actions are architected to be an extensible framework, giving the developer full control over coding complex
actions that might not be available in a purely declarative environment. In the spirit of UI usability, you should help