of an employee with any job other than
salesman. In the form, you can see that
the Comm field is disabled. To enable the
Comm field, change the Job field’s value
DEFINING AN ADVANCED DYNAMIC
Now modify the Employee application to
retrieve a department’s location as soon as
the Department field is updated. The application will use Ajax to retrieve the value
asynchronously without needing to submit
the entire page to the server.
To create the advanced dynamic action,
follow these steps:
1. Edit Page 2 button at the
bottom of the form page.
2. Items and select Create Page
Item, as shown in Figure 1.
3. Display Only, enter P2_LOCATION
for Item Name, click Next, click Next, click
Next, and click Create Item.
4. P2_DEPTNO, and select
Create Dynamic Action.
5. Advanced, enter Get Department
Location for Name, and click Next.
As you can see in Figure 2, you can
choose among many types of events
when you implement an advanced
dynamic action. Select Change (the
default). Leave the Condition field value
as - No Condition -, because you want the
change event to always fire.
6. Next, and select Component -> Set
Value for Action.
7. Settings region, which now
appears, select SQL Statement for Set
8. SQL Statement, enter select LOC
from DEPT where DEPTNO = :P2_
DEPTNO. For Page Items to Submit, enter
P2_DEPTNO. Click Next.
9. Selection Type, choose Item(s).
In the list of items that then appears,
Figure 2: Selecting the event type for a dynamic action
Figure 3: Change the department, see the result
double-click P2_LOCATION, and then
Now when you run the application and
change the value for any employee’s department, you’ll see that the location is updated
immediately, as shown in Figure 3.
David Peake (david
is a principal product
manager in Oracle’s
division. He has been
with Oracle since 1993.
Oracle Application Express
Oracle Database 11g Release 2
Dynamic actions in Oracle Application
Express 4.0 enable developers to meet the
demand for client-side functionality, where
the application responds as soon as a value is
changed or the user leaves a field. Dynamic
actions are designed to make implementing
such functionality declarative, which gives
developers the potential to rapidly incorporate rich Web 2.0 user interactivity into
their applications without writing any Ajax
scripting code. By defining client-side
behavior on declarative property pages, you
speed development, simplify debugging, and
reduce maintenance requirements.
READ more Browser-Based
LEARN more about Oracle Application
REQUES T an Oracle Application Express 4.0
VISIT the Oracle Application Express