Title: Controlling Form Behavior and Format Using Properties, Property Classes, and the Property Palette
1Chapter 5 Controlling Form Behavior and Format
Using Properties, Property Classes, and the
Property Palette
2- 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
3Properties 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.
4Properties 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.
5Properties and Property Types
6Properties and Property Types
7Properties and Property Types
8Properties and Property Types
9Properties 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.
10Properties 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.
11Properties and Property Types
12Properties 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.
13Properties and Property Types
14Properties 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.
15Properties and Property Types
16Creating 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.
17Creating 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.
18Creating and Using Property Classes
19Creating 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.
20Creating and Using Property Classes
21Creating 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.
22Creating 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.
23Creating and Using Visual Attributes
24Creating 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
25Creating 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.
26Controlling 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.
27Controlling Form Navigation Using Properties
28Controlling 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.
29Controlling 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.
30Controlling 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.
31Important 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.
32Creating 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
33Creating 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.
34Creating Reusable Components Using Object Groups
and Libraries
35Creating 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.
36Creating 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.
37Creating 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.
38Creating 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.
39Creating Reusable Components Using Object Groups
and Libraries
40Creating 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.
41Creating 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.
42Creating and Using SmartClasses
43Creating 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.
44Creating and Using SmartClasses
45Changing 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.
46Changing 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.
47Changing Properties at Runtime
48Changing 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.
49Where 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
50Where 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