[精]Oracle APEX 5.0 新手教程(三) 动态控制

本文是Oracle APEX 5.0新手教程系列的第三部分,主要讲解如何在应用中实现动态控制,帮助初学者掌握这一关键功能。
摘要由CSDN通过智能技术生成
Oracle APEX Dynamic Action Tutorial
http://blog.csdn.net/sunansheng/article/details/50408974

1- Introduction

This document is based on:
  • Oracle APEX 5

2- Preparing for example

You need to add BONUS column to EMP table if it does not already exist:
?
1
2
-- 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
List of Values:
  • 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
List of Values
  • Type: SQL Query
  • SQL Query: Select Dname,Deptno From Dept
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值