 |
|
Oracle Database Tips by Donald Burleson |
Building
a Form Using the APEX Form Wizards
To follow along with the exercises in this
section, navigate the Conference RSVP application built in Chapter 4.
The Create Application from the Spreadsheet wizard in Chapter 4
actually built two forms in the application: one for INSERTs, and one
for UPDATEs and DELETEs. This exercise will cover building a single
page that will perform INSERTs, UPDATEs, and DELETEs.
The exercise will build an application page with
the following page components.
·
An HTML region to contain the Conference Attendee
buttons and page items.
·
Buttons
·
Page Items
·
Page Rendering process: For populating the form
·
Page Processing process: For updating the database
·
Branch
1.
Navigate to the Application home page the Conference RSVP
application and click the Create Page button.
2.
On the next page choose the Form option and click Next.
3.
On the next page, there will be several wizards that offer
guidance through the building of various types of forms. Select the
Form on a Table or Viewoption and
click Next.
4.
On the Table / View Owner page the
EASYHDB schema will be selected. Click Next.
5.
On the Table / View Name page type in
CONFERENCE_RSVP or select it using
the popup from the icon.
Then click Next.
6.
On the Page and Region Attributes page:
·
Page: 12.
·
Page Name: Edit Conference RSVP.
·
Region Title: Conference Attendee.
·
Region Template: Leave the default of Form Region.
·
Click Next.
7.
No tabs and click Next.
8.
On the Primary Key page:
·
Primary Key: ID
Observe that
there are only two selections. The form wizards used Automatic Row
processes that only support the use of two column primary keys, only
two columns can be chosen here. For tables with multiple columns in
the primary key, this is not the choice to use. For that, developers
may find themselves creating forms with the Form on a SQL Query wizard
and then creating their own buttons, processes, and branches.
·
Click Next.
9.
On the Primary Key page:
·
Choose the Existing trigger option.
When the create
application wizard imported the conference_rsvp.csv file, it created a
trigger on the table to populate the value of the primary key column.
This step reuses it.
·
Click Next.
10.
On the Columns page:
·
Select every column except for the COMPANY
column, as shown in Figure
8.1. The COMPANY
column will be added later in another exercise.
The COMPANY
column can be deselected by holding down the Control key and
clicking on it.
11.
On the Process Options page, leave all the defaults as shown in
Figure 8.2 and click Next
This is where the text displayed on
buttons can be changed. It is also to time to decide whether or not
to include a button. For example, some of today's databases are FINO
(First In, Never Out) systems, meaning data is never deleted. The
developer may therefore wish to select NO for the Show Delete Button
option.
12.
On the Branching page:
·
After Page Submit and Processing Branch to Page: 11.
·
When Cancel Button Pressed Branch to this Page: 11.
For this page,
the plan is to branch back to the report page created in Chapter 7.
That was page 11. If your report page has a different page ID, enter
that number here instead of 11.
·
Click Next.
13.
Finally, click the Finish button.
1.
Before continuing, for the purposes of this example, it may
be helpful to go back to the reports page created in Chapter 7 and
modify the following:
2.
Report Column Links: Change these so they navigate to page 12
instead of page three. It will also be necessary to change the Item
for the link from P3_ID to P12_ID. There are two links: one for the
ID column, and one for the LAST_NAME column.
3.
Create Button: Modify the button in the Optional URL
Redirect section and set the Page and Clear Cache both to 12.
The above book excerpt is from:
Easy HTML-DB
Oracle Application Express
Create
Dynamic Web Pages with OAE
ISBN 0-9761573-1-4
Michael Cunningham & Kent Crotty
http://www.rampant-books.com/book_2005_2_html_db.htm |