6
Copyright © 2004, Oracle.  All rights reserved.
Working with Data Blocks and Frames
6-2
Copyright © 2004, Oracle.  All rights reserved.
Objectives
After completing this lesson, you should be able to dothe following:
Identify the components of the Property Palette
Manage object properties
Create and use Visual Attributes
Control the behavior and appearance of datablocks
Control frame properties
Create blocks that do not directly correspond todatabase tables
Delete data blocks and their components
6-3
Copyright © 2004, Oracle.  All rights reserved.
Managing Object Properties
Reentrant Wizard
Data Block Wizard
Layout Wizard
Layout Editor
Property Palette
1
2
3
6-4
Copyright © 2004, Oracle.  All rights reserved.
Managing Object Properties
There are three ways to modify properties of Forms Builderobjects:
Reentrant Wizards: You can modify data block and layoutproperties through the reentrant wizards, as explained inthe previous lesson.
Layout Editor: If the object appears on a canvas, you canmodify properties by using the graphical Layout Editor.
Property Palette: You can set individual properties foreach Forms Builder object in its Property Palette.
The wizards, the Layout Editor, and the Property Palette alldepict object properties. Changes made in one tools arereflected in the others
You can use the Property Palette to control the behavior andappearance of any Forms Builder object with a greater degreeof granularity. In the Property Palette you can fine-tuneobjects that you have initially created in the wizards or theLayout Editor.
6-5
Copyright © 2004, Oracle.  All rights reserved.
D:\Data\CurrDev\BIA10g\images\0604.GIF
Displaying the Property Palette
To display the Property Palette, useone of the following methods:
Select Tools Property Palette (oruse the shortcut key).
Double-click the object icon in theObject Navigator.
Double-click the object in theLayout Editor.
Right-click the object icon inthe Object Navigator.
Right-click the object in theLayout Editor.
6-6
Copyright © 2004, Oracle.  All rights reserved.
D:\Data\CurrDev\BIA10g\images\0605a.gif
Property Palette: Features
Propertyname
Propertyvalue
Toolbar
Expand/collapse
Find field
Searchbackward
Searchforward
Help:Press [F1]to display adescription
D:\Data\CurrDev\BIA10g\images\0605b.gif
6-7
Copyright © 2004, Oracle.  All rights reserved.
D:\Data\CurrDev\BIA10g\images\0606a.gif
D:\Data\CurrDev\BIA10g\images\0606b.gif
Property Controls
Text field
LOV window
Pop-up list
More button
D:\Data\CurrDev\BIA10g\images\0606c.gif
D:\Data\CurrDev\BIA10g\images\0606d.gif
D:\Data\CurrDev\BIA10g\images\0606e.gif
6-8
Copyright © 2004, Oracle.  All rights reserved.
Property Controls
Changed
Default
Overridden
Inherited
D:\Data\CurrDev\Forms9iCourse\images\ppIcons.gif
6-9
Copyright © 2004, Oracle.  All rights reserved.
Visual Attributes
A Visual Attributeis a named set ofproperties defining:
Font
Color
Pattern
D:\Data\CurrDev\Forms9iCourse\images\va2.gif
D:\Data\CurrDev\Forms9iCourse\images\va3.gif
D:\Data\CurrDev\Forms9iCourse\images\va1.gif
6-10
Copyright © 2004, Oracle.  All rights reserved.
Visual Attributes
Visual attributes are the font, color, and pattern propertiesthat you set for form and menu objects.
A visual attribute is another object that you can create in theObject Navigator with properties such as font, color, andpattern combinations. Set the Visual Attribute Type propertyof the Visual Attribute to Title if you plan to apply it to objectssuch as frame titles, or to Prompt if it will be used forprompts. Otherwise, set Visual Attribute Type to Common,which is the default.
Every interface object in a forms application has a propertycalled Visual Attribute Group, which determines how theindividual Visual Attribute settings of an object are derived.The Visual Attribute Group property can be set to Default,NULL, or the name of a Visual Attribute object. Blocks have aCurrent Record Visual Attribute Group property that definesthe Visual Attribute to be used for the current record in theblock.
6-11
Copyright © 2004, Oracle.  All rights reserved.
D:\Data\CurrDev\BIA10g\images\0609a3.gif
How to Use Visual Attributes
1.Create a Visual Attribute.
2.Set the Visual Attributerelated property of anobject to the desired Visual Attribute.
3.Run the form to see the effect.
D:\Data\CurrDev\BIA10g\images\0609b3.gif
2
1
3
6-12
Copyright © 2004, Oracle.  All rights reserved.
Using Visual Attributes
To use a Visual Attribute, perform the following steps:
1.Create the Visual Attribute:
Select the Visual Attributes node in the ObjectNavigator
Click Create
Invoke the Property Palette for the Visual Attributeand set the desired font, color, and patternproperties
2.Set the object properties to use the new VisualAttribute:
For items and canvases, set the Visual AttributeGroup property
For blocks, set the Current Record Visual AttributeGroup property
3.Run the form to see the changes.
6-13
Copyright © 2004, Oracle.  All rights reserved.
D:\Data\CurrDev\Forms9iCourse\images\5-10a.gif
Font, Pattern, and Color Pickers
D:\Data\CurrDev\BIA10g\images\0610c.gif
D:\Data\CurrDev\BIA10g\images\0610.GIF
D:\Data\CurrDev\Forms9iCourse\images\va3.gif
6-14
Copyright © 2004, Oracle.  All rights reserved.
Controlling Data Block Behaviorand Appearance
Data Block Property Groups:
General
Navigation
Records
Database
Advanced Database
Scrollbar
Visual Attributes
Color
International
D:\Data\CurrDev\Forms9iCourse\images\5-11.GIF
6-15
Copyright © 2004, Oracle.  All rights reserved.
Navigation Properties
ORDERS
Order
Item
SameRecord
NextRecord
Previous Navigation Data Block
Next Navigation Data Block
6-16
Copyright © 2004, Oracle.  All rights reserved.
Controlling the Behavior of Data Blocks:Setting Navigation Properties
Navigation Style
Normally, when you navigate beyond the last item in a record,Forms returns you to the beginning of the same record. Withthis property you can change this behavior to navigate to thenext record or data block instead. The valid settings are:Same Record (default), Change Record, or Change DataBlock.
Note: If you want the cursor to move to the next record whenyou reach the end of the current record, set the NavigationStyle property for the block to Change Record.
Previous/Next Navigation Data Block
Normally, when you perform an operation to move to theprevious or next data block at run time, Forms moves controlto the previous or next adjacent data block in sequence.These properties enable you to name the previous or nextdata block.
6-17
Copyright © 2004, Oracle.  All rights reserved.
D:\Data\CurrDev\BIA10g\images\0613_2.GIF
Records Properties
Item
Number
of Records
Displayed
Current Record
6-18
Copyright © 2004, Oracle.  All rights reserved.
Controlling the Behavior of Data Blocks:Setting Record Properties
Current Record Visual Attribute Group: The VisualAttribute that will be used to highlight the current recordin the data block.
Query Array Size: Specifies the maximum number ofrecords that Forms should fetch from the database at onetime. A lower value in this property value means fasterresponse time; however, a larger value means fewer callsto the database for records, thereby resulting in reducedoverall processing time. When set to 0 this propertydefaults to the Number of Records Displayed.
Number of Records Buffered: Is the minimum amount ofbuffer space retained for holding queried records in thedata block. The minimum setting allowed is the value ofthe Number of Records Displayed property plus 3. Formsbuffers any additional records to a temporary disk file. Ahigher value improves processing speed, but uses morememory.
6-19
Copyright © 2004, Oracle.  All rights reserved.
D:\Data\CurrDev\BIA10g\images\0613_2.GIF
Records Properties
Vertical Record Orientation
Horizontal Record Orientation
6-20
Copyright © 2004, Oracle.  All rights reserved.
D:\Data\CurrDev\BIA10g\images\0615.GIF
Database Properties
Use properties in the Databasegroup to control:
Type of block—data orcontrol block
Query, insert, update, anddelete operations on thedata block
Data block’s data source
Query search criteria anddefault sort order
Maximum query time
Maximum number ofrecords fetched
6-21
Copyright © 2004, Oracle.  All rights reserved.
Database Properties
Controlling the Behavior of Data Blocks: Setting DatabaseProperties
In the Database group of the Property Palette, you can setnumerous properties to control interaction with the databaseserver. Some of these properties are:
Database Data Block: Set to Yes if the data block is basedon a database object and No if it is a control block.
Enforce Primary Key: Controls whether Forms checks foruniqueness before inserting or updating records in thebase table, in order to avoid committing duplicate rows inthe database. A value of Yes means that the form checksthat inserted or updated records are unique before anattempt is made to commit possible duplicate rows.
Query/Insert/Update/Delete Allowed: Control whether theassociated operations can be performed on the datablock records.
Where condition
You can select any property and press [F1] to get context-sensitive help about it.
6-22
Copyright © 2004, Oracle.  All rights reserved.
Controlling Frame Properties
6-23
Copyright © 2004, Oracle.  All rights reserved.
Displaying Multiple Property Palettes
Two Palettes for Two Items:
Two Palettes for One Item:
D:\Data\CurrDev\BIA10g\images\0621b.gif
D:\Data\CurrDev\BIA10g\images\0621a.gif
D:\Data\CurrDev\BIA10g\images\0621b.gif
6-24
Copyright © 2004, Oracle.  All rights reserved.
Copying Properties
Copy
Paste
Source objects
Destination objects
Properties
NameITEMS
Query All RecordsYes
Query AllowedYes
Insert AllowedYes
Update AllowedNo
Delete AllowedYes
Query All RecordsNo
Query AllowedYes
Insert AllowedYes
Update AllowedYes
Delete AllowedYes
Cube: Small Box, Green
Cube: Small Box, Green
Cube: Small Box, Green
Cube: Small Box, Green
Cube: Small Box, Green
6-25
Copyright © 2004, Oracle.  All rights reserved.
Copying Properties
You can copy the properties and values from the PropertyPalette to a buffer, so that they can be applied (pasted) toother objects in your design session. To copy properties,perform the following steps:
1.In the Property Palette, display and set the properties thatare to be copied. This may be from one object or acombination of objects.
To copy all property settings from the Property Palette,select Edit Select All.
To copy the selected property settings only, press andhold [Ctrl] while you click each property individually.
2.Click Copy Properties on the toolbar of the PropertyPalette.
3.From the Object Navigator select the object into whichthe properties are to be copied.
4.In the Property Palette, click Paste Properties. Theselected object receives values from all copied propertiesthat are relevant to their object types.
6-26
Copyright © 2004, Oracle.  All rights reserved.
Creating a Control Block
Click the Data Blocks node
Click the Create icon      ORSelect Edit Create.
Select the “Build a new datablock manually” option in theNew Data Block dialog box.
D:\Data\CurrDev\BIA10g\images\0626.GIF
6-27
Copyright © 2004, Oracle.  All rights reserved.
Creating Control Blocks
A control block is a block that is not associated withany database, and its items do not relate to anycolumns within any database table.
This means that Forms does not perform an automaticquery when the operator issues an Enter Query orExecute Query command, nor does it issue anautomatic Insert, Update, or Delete for the block whenthe operator saves changes to the database.
How to Create a Control Block
1.Click the Data Blocks node in the Object Navigator.
2.Click the Create icon on the toolbar, or Select Edit >Create from the menu.
3.In the New Data Block dialog box, select the “Builda new data block manually” option.
4.Open the Property Palette of the new data block andchange its name.
6-28
Copyright © 2004, Oracle.  All rights reserved.
Deleting a Data Block
Select a data block for deletion
Click the Delete icon      ORPress [Delete]
Click Yes in the alert box.
6-29
Copyright © 2004, Oracle.  All rights reserved.
Deleting Data Blocks
To delete a data block:
1.Select the data block to be deleted in the ObjectNavigator.
2.Click the Delete icon on the toolbar.orPress [Delete].
3.An alert is displayed for delete confirmation. ClickYes to delete the data block.
Note: Deleting a data block also deletes itssubordinate objects (items and triggers). If thedata block was a master or detail block in arelation, the relation is also deleted. However, theframe border and its title will remain. Delete theframe manually in the Layout Editor.