Oracle APEX Dynamic Action Tutorial
http://blog.csdn.net/sunansheng/article/details/50408974
-
This document is based on:
-
-
Oracle APEX 5
-
-
You need to add BONUS column to EMP table if it does not already exist:
-
12
-- Add/modify columns
alter
table
EMP
add
BONUS number;
-
Create a blank page with the page number is 300.
-
-
-
-
Create a Region contains the parameters.
-
-
- !
-
-
-
Set properties:
-
Identification:
- Name: P300_PARAM_EMPNO
- Type: Select List
List of Values:- Type: SQL Query
- SQL Query: Select Ename, Empno From Emp
-
-
Next, create new Region.
-
-
Enter:
-
Identification:
- Title: Emp Form Region
- Type: Static Content
-
-
Create a few items for this Region:
-
-
-
Set the properties for Items:
-
No Item Label Source
(Type= Database Column)1 P300_EMPNO Empno EMPNO 2 P300_ENAME Ename ENAME 3 P300_JOB Job JOB 4 P300_MGR Manager MGR 5 P300_HIREDATE Hiredate HIREDATE 6 P300_SAL Salary SAL 7 P300_COMM Commission COMM 8 P300_BONUS Bonus BONUS 9 P300_DEPTNO Deptno DEPTNO -
-
Before the website is renderred, data should be assigned to the item, you need to create a Process in Pre-Rendering/After Header to do this.
-
-
-
Enter:
-
Identification:
- Name: Fetch EMP Row
- Type: Automatic Row Fetch
Setting:- Table Name: EMP
- Primary Key Column: EMPNO
- Primary Key Item: P300_EMPNO
-
-
The value of P300_EMPNO is pass from outside, "Fetch EMP Row" Process will query EMP table with EMPNO = :P300_EMPNO at a time before the page is renderred, and assign values to the other items.
-
When you run this page, it has no data, the causes are :P300_EMPNO null (no value passed to it from outside).
-
-
Change properties for items:
-
P300_JOB
-
Identification:
- Name: P300_JOB
- Type: Select List
- Type: Static Values
- Static values:STATIC:CLERK;CLERK,SALESMAN;SALESMAN,PRESIDENT;PRESIDENT,MANAGER;MANAGER,ANALYST;ANALYST
-
-
P300_MGR:
-
Identification
- Name: P300_MGR
- Type: Select List
List of Values- Type: SQL Query
- SQL Query: Select ename d, empno r from emp where job in ('MANAGER', 'PRESIDENT')
-
-
P300_HIREDATE
-
Identification
- Name: P300_HIREDATE
- Type: Date Picker
-
-
P300_DEPTNO
-
Identification
- Name: P300_DEPTNO
- Type: Select List
- Type: SQL Query
- SQL Query: Select Dname,Deptno From Dept