Databases Reference
In-Depth Information
Chapter 16
Dynamic Actions
One of the most exciting features introduced with APEX 4.0 was dynamic actions, which provide the ability to
declaratively define complex client-side behavior such as validations, highlighting, alerts, setting page values, and so
on, without the need to hand-code large amounts of JavaScript.
Dynamic actions have been significantly extended in APEX 4.2, providing more flexibility and functionality
declaratively. This helps the developer break away from the traditional server-side scripting model by executing the
dynamic-action logic on the browser instead of incurring a round trip to the server.
Dynamic actions are event-driven just as manually written JavaScript would be. But APEX uses the declarative
information provided to generate the required JavaScript code, which is then implemented at runtime. This chapter
examines and implements a number of different dynamic actions so you can get a feel for what they can achieve.
Dynamic Action Benefits
One of the major advantages of using declarative dynamic actions as opposed to hand-coded JavaScript is that
dynamic actions understand and can take advantage of APEX core objects such as regions and items, allowing easy
reference and manipulation. Another benefit of using declarative logic is that, when you choose to upgrade to the next
release of APEX when it comes out, the framework around dynamic actions will ensure that any code generated will
be compatible with the new version of APEX.
But beyond the base benefits of the declarative nature of APEX, dynamic actions let you code very complex
client-side actions without having to learn a whole new technology to do so. In fact, it's likely that you could code
upward of 80% of everything you need to do with nothing more than the Dynamic Action Wizard and SQL and PL/SQL.
However, because JavaScript is the de facto standard for coding browser interactivity, it's also likely that at some
point you'll be forced to learn a bit about JavaScript. Learning JavaScript is beyond the scope of this topic. After
all, you bought this topic to learn APEX. But if you do want to learn more about JavaScript, Apress has a number of
excellent topics on the topic.
Breaking Down Dynamic Actions
Prior to APEX 4.2, dynamic actions were split into two categories: Standard and Advanced. The only real difference
between these two categories was what the related wizard let you achieve. Under the covers, both dynamic action
types were identical; and once you left the wizard, all options were available to you. APEX 4.2 has done away with this
artificial separation and now provides only one wizard to create dynamic actions.
The definition of a dynamic action can be broken down into the following components:
Identification : Defines the name of the dynamic action and its execution sequence.
When : Defines when the action will be fired. You can choose the event, the object or objects
that will participate in causing the action to fire, and any condition that applies to the event.
 
Search WWH ::




Custom Search