Databases Reference
In-Depth Information
Chapter 8
Programmatic Elements
This chapter covers the programmatic elements that can provide both simple and complex features to the APEX
framework. APEX provides simple declarative features with wizards to guide you. Because of its integration with
the database, APEX can also use the full power of the PL/SQL engine inside the Oracle database. Now, with the
implementation of APEX 4, even JavaScript interactivity has been made declarative and extendable in the framework.
Conditions
Throughout the building of the Help Desk application, there are times when you want to take advantage of the
conditional logic available with APEX components. Rather than try to understand every type of condition (there are
60 in the list of condition types), you should focus mainly on grasping the concept of a condition.
The condition feature provides a place where logic can turn on or off the particular piece of APEX technology.
Before action is taken to display or execute a particular APEX component, the condition applied to that component is
evaluated for a TRUE or positive result.
The logic options available to develop a condition are very broad. The condition type defines the particular
mechanics used to evaluate the condition using parameters as appropriate. Simple page-item comparisons are the
easiest to explain. For example, a process may only need to be run if a particular page item has a value. In the case of
sending an e-mail, an attempt to send a message should be made only if an e-mail address is given. From that simple
start, conditions can become as complex as you need them to be. In advanced cases, conditions can also include
browser and web server options.
Take time to review the condition types that are available and become familiar with their usage. It isn't as
important to understand the technical implementation or syntax of each item as much as what options make up
a single condition. This familiarity will be helpful when you start defining APEX components and understanding
considerations for a flexible and modular application design.
Required Values
Requiring a value is a common need, and APEX 4.0 and above supports required values through what is essentially
a NOT NULL flag at the page-item level. You don't need to create a full-blown validation (discussed next) to make an
item required. You simply make a choice from a drop-down list.
Continuing the Help Desk application, let's implement a Value Required validation on the Subject field:
1.
Edit Page 210 of the application.
2.
Edit the P210_DESCR page item.
 
Search WWH ::




Custom Search