Sei sulla pagina 1di 50

Chapter 5 Controlling Form Behavior and Format Using Properties, Property Classes, and the Property Palette

Oracle9i Developer: Developing Web Applications with Forms Builder

In this chapter you will:

Learn the purpose of properties and property types Learn to operate the Property Palette Create and use property classes Create and use visual attributes Control form navigation using properties Learn about important block properties Create reusable components using object groups and libraries Create and use SmartClasses Change properties during runtime

Oracle9i Developer: Developing Web Applications with Forms Builder

Properties and Property Types


A property is a setting in a program.
A typical program can have hundreds of settings that control application characteristics such as font, width of a text item, or boilerplate.
<tr> <td width="100%"><h1 align="center"><font color="#008080"> <big>Realistic Software Training</big></font></h1> <p align="center"><strong><big><big>A Totally Unique Oracle Trainer/Developer/Consultant</big></big></strong></p> </td> </tr>
Oracle9i Developer: Developing Web Applications with Forms Builder 3

Properties and Property Types


A form is also a program and has hundreds of property settings. The Data Block Wizard, Layout Editor Wizard, and the Layout Editor can be used to set properties. The former tools cannot set all form properties. However the Property Palette can. The Property Palette is a dialog box that displays the properties for the currently selected item. Settings are added to properties on the Property Palette using drop-down lists, text items, editor, and color palettes.
Oracle9i Developer: Developing Web Applications with Forms Builder 4

Properties and Property Types

Oracle9i Developer: Developing Web Applications with Forms Builder

Properties and Property Types

Oracle9i Developer: Developing Web Applications with Forms Builder

Properties and Property Types

Oracle9i Developer: Developing Web Applications with Forms Builder

Properties and Property Types

Oracle9i Developer: Developing Web Applications with Forms Builder

Properties and Property Types


It is possible to select multiple objects and open a Property Palette that displays the property values for all of the items. A value of asterisks (******) indicate the selected objects property values differ.
An actual value indicates the selected objects property values are the same.

Oracle9i Developer: Developing Web Applications with Forms Builder

Properties and Property Types


When multiple item properties are displayed in a Property Palette, two views are available:
The Intersection view displays properties that exist on each of the selected items. The Union view displays all properties whether they exist on all selected objects or not.

The Intersection/Union tool located at the top of the Property Palette can be used to toggle the two views.

Oracle9i Developer: Developing Web Applications with Forms Builder

10

Properties and Property Types

Oracle9i Developer: Developing Web Applications with Forms Builder

11

Properties and Property Types


Normally the Property Palette only shows properties for the currently selected object(s).
The properties in the Property Palette change when a new object is selected. It is possible to keep a Property Palette open with existing properties and open a second Property Palette for a new object. The Pin/Unpin tool located on the Property Palette causes a palette to stay open or to close.
Oracle9i Developer: Developing Web Applications with Forms Builder 12

Properties and Property Types

Oracle9i Developer: Developing Web Applications with Forms Builder

13

Properties and Property Types


It can be difficult to locate a property on the Property Palette.
The Find tool is used to locate the desired property.

Oracle9i Developer: Developing Web Applications with Forms Builder

14

Properties and Property Types

Oracle9i Developer: Developing Web Applications with Forms Builder

15

Creating and Using Property Classes


A property class is a form object that contains a set of developer defined properties.
Property classes are assigned to other objects superceding their existing properties. Property classes are assigned to other objects using the Subclass Information property. Property classes are excellent productivity and standardization tools.
Oracle9i Developer: Developing Web Applications with Forms Builder 16

Creating and Using Property Classes


Property classes can be created on the Object Navigator using the Create tool.
Property class properties can be viewed by opening a Property Palette for the property class. Properties can be added using the Add Property tool located on the Property Palette. The Add Property tool opens a dialog box that displays all properties available for the property class.
Oracle9i Developer: Developing Web Applications with Forms Builder 17

Creating and Using Property Classes

Oracle9i Developer: Developing Web Applications with Forms Builder

18

Creating and Using Property Classes


The Delete Property tool is used to delete properties from the property class.
You can determine that an object is using a property class on the Object Navigator by the red arrow and cross symbol that appear below the objects icon. You can determine a property whose value is supplied by a property class. A carriage return symbol will precede the property on the Property Palette.

Oracle9i Developer: Developing Web Applications with Forms Builder

19

Creating and Using Property Classes

Oracle9i Developer: Developing Web Applications with Forms Builder

20

Creating and Using Visual Attributes


Visual attributes are a form object similar to a property class.
Visual attributes only contain font and color properties. Visual attributes are used to format data block items, canvases, windows, alerts, and LOVs.

Oracle9i Developer: Developing Web Applications with Forms Builder

21

Creating and Using Visual Attributes


There are three types of visual attributes:
Common - Used to format most items Title - Used to format the frame title Prompt - Used to format data block item prompts Visual attributes are created on the Object Navigator using the Create tool. Visual attribute properties are modified using the Property Palette.
Oracle9i Developer: Developing Web Applications with Forms Builder 22

Creating and Using Visual Attributes

Oracle9i Developer: Developing Web Applications with Forms Builder

23

Creating and Using Visual Attributes


Visual attributes are assigned to the object using one of the following properties:
Current Record Visual Attribute Group (data block, data block item) Visual Attribute Group Prompt Visual Attribute Group Frame Title Visual Attribute Group

Oracle9i Developer: Developing Web Applications with Forms Builder

24

Creating and Using Visual Attributes


The Current Record Visual Attribute Group properties on the data block and data block item objects use the visual attributes to format the currently selected record. Current Record Visual Attribute Group properties are excellent tools to identify the current record when the form contains multiple tabular data blocks.

Oracle9i Developer: Developing Web Applications with Forms Builder

25

Controlling Form Navigation Using Properties


By default, block and data block item navigation is determined by the order the objects are displayed in the Object Navigator. The form, data block, and data block item objects have properties that override and further control the default navigation.

Oracle9i Developer: Developing Web Applications with Forms Builder

26

Controlling Form Navigation Using Properties

Oracle9i Developer: Developing Web Applications with Forms Builder

27

Controlling Form Navigation Using Properties


Data blocks have a Navigation Style property that determines where the input focus navigates to when the operator tabs from the last item in a record. Settings are: Same Record Change Record Change Data Block Data blocks also have a Previous Navigation Data Block and Next Navigation Data Block property that override the default navigation on the Object Navigator.
Oracle9i Developer: Developing Web Applications with Forms Builder 28

Controlling Form Navigation Using Properties


Data block items have a Previous Navigation Item and Next Navigation Item property that override the default navigation set on the Object Navigator. Data block items have a Keyboard Navigable property that prevents the operator from tabbing into an item.
Data block items also have a Query Allowed property that prevents the operator from tabbing into a data block item when the data block is in the Query mode.

Oracle9i Developer: Developing Web Applications with Forms Builder

29

Controlling Form Navigation Using Properties


Form objects have a Mouse Navigable property that determines which object can receive the input focus using the mouse. Settings include: Form Data block Record Item

Form is the default setting.

Oracle9i Developer: Developing Web Applications with Forms Builder

30

Important Data Block Properties


Data blocks have several important properties. Number of Records Displayed controls the amount of records visible to the operator at a given time. The WHERE clause property allows the developer to limit the records displayed on the data block. The Database Block property determines whether the data block is a control block. The Query Allowed, Insert Allowed, Update Allowed, and Delete Allowed properties can suppress SQL statements issued by the data block.
Oracle9i Developer: Developing Web Applications with Forms Builder 31

Creating Reusable Components Using Object Groups and Libraries


Standard reusable form components can increase developer productivity.
Forms Builder has two objects that can be used to standardize form components: Object Group Object Library

Oracle9i Developer: Developing Web Applications with Forms Builder

32

Creating Reusable Components Using Object Groups and Libraries


An object group is a form component that contains a set of form components.
When an object group is copied into another form its components are moved to the appropriate object in the form. Object groups eliminate the labor of copying many objects into a form.

Oracle9i Developer: Developing Web Applications with Forms Builder

33

Creating Reusable Components Using Object Groups and Libraries

Oracle9i Developer: Developing Web Applications with Forms Builder

34

Creating Reusable Components Using Object Groups and Libraries


A good use of an object group is to have default components such as the content canvas, visual attributes, property classes, windows, and triggers. The object group can be used to set up the form and get a quick start.
Object groups are created on the Object Navigator using the Create tool. Objects are added to the group by dragging them from the form into the object group.
Oracle9i Developer: Developing Web Applications with Forms Builder 35

Creating Reusable Components Using Object Groups and Libraries


An object library is an external module that can contain any form component.
Since the objects are stored outside a form there is a smaller chance that the standard object was modified by a developer. Object libraries are created on the Object Navigator. Double-clicking the object library opens the Object Library dialog box.
Oracle9i Developer: Developing Web Applications with Forms Builder 36

Creating Reusable Components Using Object Groups and Libraries


Objects are moved into the object library by dragging them from the form into the dialog box.
Objects are moved into the form by dragging them from the dialog box into the form. Object libraries have tabs which are used to group common objects.

Oracle9i Developer: Developing Web Applications with Forms Builder

37

Creating Reusable Components Using Object Groups and Libraries


Object libraries have a file extension of .olb.
Stndrd20.olb is an Oracle Form Builder 6i demo object library. Ofgstnd1.olb is an Oracle Forms Builder 9i demo object library.

Object libraries are created on the Object Navigator using the Create tool.

Oracle9i Developer: Developing Web Applications with Forms Builder

38

Creating Reusable Components Using Object Groups and Libraries

Oracle9i Developer: Developing Web Applications with Forms Builder

39

Creating Reusable Components Using Object Groups and Libraries


Existing object libraries can be brought into the IDE using the File/Open menu selection.
Once an object library has been loaded into the IDE it will automatically reload each time Forms Builder is opened. Object libraries can be removed from the IDE by selecting the library and pressing the Delete key.

Oracle9i Developer: Developing Web Applications with Forms Builder

40

Creating and Using SmartClasses


Selecting an object node and pressing the right mouse opens a popup menu.
One of the options on the popup menu is SmartClasses. SmartClasses is a submenu that displays objects that can be copied into the object class. The set of SmartClasses objects change dependant upon the object class selected.
Oracle9i Developer: Developing Web Applications with Forms Builder 41

Creating and Using SmartClasses

Oracle9i Developer: Developing Web Applications with Forms Builder

42

Creating and Using SmartClasses


Oracle has developed a set of objects that will appear in the SmartClasses menu.
You can add your own objects by designating an object in an object library as a member of the SmartClasses. The Edit/SmartClass menu option is used to designate an object library object a member of the SmartClasses.

Oracle9i Developer: Developing Web Applications with Forms Builder

43

Creating and Using SmartClasses

Oracle9i Developer: Developing Web Applications with Forms Builder

44

Changing Properties at Runtime


Properties are normally set using the Property Palette or other Forms Builder tools.
Properties can also be set at runtime using a built-in subprogram. A built-in subprogram is an Oracle developed procedure or function that performs a specific task. Every object has a built-in subprogram that can be used in a PL/SQL script to modify the objects properties.
Oracle9i Developer: Developing Web Applications with Forms Builder 45

Changing Properties at Runtime


The built-ins do not modify all of the items properties. Visual properties such as text item height and width are not modifiable. It is very common to modify data block and data block item properties. The Set_block_property, Set_block_item_property, and Set_block_item_instance_property are commonly used built-ins that are representative of the built-in class. The built-ins are procedures and have argument lists.
Oracle9i Developer: Developing Web Applications with Forms Builder 46

Changing Properties at Runtime


SET_BLOCK_PROPERTY(emp, order_by, fk_department, last_name desc); SET_BLOCK_PROPERTY(emp, insert_allowed, property_false); SET_BLOCK_PROPERTY(emp, default_where, last_name = :global.lname);

Oracle9i Developer: Developing Web Applications with Forms Builder

47

Changing Properties at Runtime


The Set_block_item_property and Set_block_item_instance properties are similar but have a small difference. The Set_block_item_property built-in modifies the property for every occurrence of the item in the data block. The Set_block_item_instance_property built-in modifies the property for select records only. You must identify the row when using this built-in.
Oracle9i Developer: Developing Web Applications with Forms Builder 48

Where You Are and Where Youre Going


You have seen: That a major part of developing a form is setting properties on the Property Palette The functionality of a number of different properties that affect the data block, data block item, and form How to create visual attributes, property classes, object groups, and object libraries How to set properties during runtime

Oracle9i Developer: Developing Web Applications with Forms Builder

49

Where You Are and Where Youre Going


In the next chapter you will see: How to use the PL/SQL editor, the fourth development tool How to create triggers that execute PL/SQL statements How to add you own logic to the form using these tools

Oracle9i Developer: Developing Web Applications with Forms Builder

50

Potrebbero piacerti anche