Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Chapter 6
A Guide to Oracle9i
Lesson A Objectives
Learn about custom forms Create a custom form Create command buttons that use form triggers to manipulate data Use the Forms Debugger to find form logic and runtime errors Learn how form triggers work Create form navigation triggers
A Guide to Oracle9i
Custom Forms
Display the data fields from a variety of database tables Contain programs that support organizational processes Not associated with one table When creating custom forms:
Identify the processes that the form is intended to support, then identify the associated database tables. Helpful to draw interface on paper
A Guide to Oracle9i
A Guide to Oracle9i
A Guide to Oracle9i
A Guide to Oracle9i
A Guide to Oracle9i
A Guide to Oracle9i
Setting a Breakpoint
A Guide to Oracle9i
10
A Guide to Oracle9i
11
A Guide to Oracle9i
12
A Guide to Oracle9i
13
Trigger Properties
Trigger timing:
Specifies when a trigger fires Can be just before, during, or after its triggering event Before: PREAfter: POSTDuring: WHEN-, ON-, KEY-
Trigger scope
Defines where an event must occur in order for trigger to fire Includes the object to which the trigger is attached, and contained objects
A Guide to Oracle9i
14
Trigger Properties
Trigger execution hierarchy:
Defines which trigger fires when an object within a form object contains the same trigger that the form object contains Can specify custom execution hierarchy
A Guide to Oracle9i
15
Internal navigation:
Occurs as a result of internal form code that responds to external navigation operations or trigger commands
A Guide to Oracle9i
17
A Guide to Oracle9i
18
Lesson B Objectives
Learn about default system messages and how to suppress them Create alerts and messages to provide system feedback Create applications that avoid user errors Learn how to trap common runtime errors
A Guide to Oracle9i
19
A Guide to Oracle9i
20
Suppressing Messages
SYSTEM.MESSAGE_LEVEL:
Variable used to suppress error messages Set to 0, 5, 10, 15, 20, 25 to suppress all messages with severity below this level Default value is 0 Set value in PRE-FORM trigger
A Guide to Oracle9i
21
A Guide to Oracle9i
22
Alerts
Dialog box that can display a longer text message Displays one or more buttons that allow the user to select between alternatives that execute associated program statements Use when:
Message is longer than 200 characters User acknowledgement is required User choice is required
A Guide to Oracle9i
23
Displaying an Alert
In a form trigger:
DECLARE alert_button NUMBER; BEGIN alert_button := SHOW_ALERT('alert_name'); END;
A Guide to Oracle9i
24
A Guide to Oracle9i
25
A Guide to Oracle9i
26
A Guide to Oracle9i
27
A Guide to Oracle9i
28
A Guide to Oracle9i
30
A Guide to Oracle9i
31
Lesson C Objectives
Convert data blocks to control blocks Link data blocks to control blocks Create a form that has multiple canvases Create tab canvases Create stacked canvases
A Guide to Oracle9i
32
A Guide to Oracle9i
33
A Guide to Oracle9i
34
A Guide to Oracle9i
35
Multiple-form approach:
Create multiple forms with a different .fmb file for each application canvas Works well when multiple programmers collaborate to create a complex application
A Guide to Oracle9i 36
A Guide to Oracle9i
37
A Guide to Oracle9i
38
Lies on top of a content canvas within the form window. Tab page:
An object representing a surface that displays form items Has a tab label identifier at the top
A Guide to Oracle9i 39
A Guide to Oracle9i
40
A Guide to Oracle9i
41
A Guide to Oracle9i
43
Summary
Control blocks are created manually and do not represent data from only one table Control blocks can be created from data blocks to make coding easier Forms Debugger is used to find runtime errors in forms User errors should be avoided by limiting opportunities for error User feedback is presented in message line and alert boxes A form may contain more than one canvas; canvases can be organized using tabs or shown and hidden programmatically
A Guide to Oracle9i 44