A script-enabled browser is required for this page to function properly.

SET_FORM_PROPERTY Built-in

Description

Sets a property of the given form.

Syntax

SET_FORM_PROPERTY
(formmodule_id FormModule,
property
NUMBER,
value
NUMBER);

SET_FORM_PROPERTY
(formmodule_name VARCHAR2,
property
NUMBER,
value
NUMBER);

Built-in Type unrestricted procedure

Enter Query Mode yes

Parameters

formmodule_id 
 
Specifies the unique ID that Oracle Forms assigns to the form when created. The data type of the ID is FormModule.
 
formmodule_name 
 
Specifies the name of the form module that you gave the form when creating it. The data type of the name is VARCHAR2.
 
property 
 
Specifies the property you want to set for the form:

CURRENT_RECORD_ATTRIBUTE Specify the VARCHAR2 name of a named visual attribute to be associated with the given form. If the named visual attribute does not exist, you will get an error message.

CURRENT_ROW_BACKGROUND_COLOR The color of the object's background region.

CURRENT_ROW_FILL_PATTERN The pattern to be used for the object's fill region. Patterns are rendered in the two colors specified by Background Color and Foreground Color.

CURRENT_ROW_FONT_NAME The font family, or typeface, that should be used for text in the object. The list of fonts available is system-dependent.

CURRENT_ROW_FONT_SIZE The size of the font, specified in points.

CURRENT_ROW_FONT_SPACING The width of the font, that is, the amount of space between characters (kerning).

CURRENT_ROW_FONT_STYLE The style of the font.

CURRENT_ROW_FONT_WEIGHT The weight of the font.

CURRENT_ROW_FOREGROUND_COLOR The color of the object's foreground region. For items, the Foreground Color attribute defines the color of text displayed in the item.

CURSOR_MODE Specifies the cursor state Oracle Forms should attempt to define. Primarily used when connecting to non-ORACLE data sources. Valid values are OPEN_AT_COMMIT and CLOSE_AT_COMMIT.

DEFER_REQUIRED_ENFORCEMENT Specifies whether enforcement of required fields has been deferred from item validation to record validation. Valid values are PROPERTY_TRUE, PROPERTY_4_5, and PROPERTY_FALSE.

DIRECTION Specifies the layout direction for bidirectional objects. Valid values are DIRECTION_DEFAULT, RIGHT_TO_LEFT, LEFT_TO_RIGHT.

FIRST_NAVIGATION_BLOCK Returns the name of the block into which Oracle Forms attempts to navigate at form startup. By default, the first navigation block is the first block defined in the Object Navigator; however, the FIRST_NAVIGATION_BLOCK block property can be set to specify a different block as the first block at form startup.

SAVEPOINT_MODE Specifies whether Oracle Forms is to issue savepoints. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.

VALIDATION Specifies whether Oracle Forms is to perform default validation. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.

VALIDATION_UNIT Specifies the scope of validation for the form. Valid values are DEFAULT_SCOPE, BLOCK_SCOPE, RECORD_SCOPE, and ITEM_SCOPE.

value 

The following constants can be passed as arguments to the property values described earlier:

BLOCK_SCOPE Specify when you want Oracle Forms to validate data only at the block level. This means, for instance, that Oracle Forms validates all the records in a block when a navigation event forces validation by leaving the block.

DEFAULT_SCOPE Sets the Validation Unit form module property to the default setting. On GUI window managers, the default validation unit is ITEM.

FORM_SCOPE Specify when you want validation to occur at the form level only.

ITEM_SCOPE. Specify when you want Oracle Forms to validate at the item level. This means, for instance, that Oracle Forms validates each changed item upon navigating out of an item as a result of a navigation event.

CLOSE_AT_COMMIT Specify when you do not want cursors to remain open across database commits; for example, when a form is running against a non-ORACLE database.

OPEN_AT_COMMIT Specify when you want cursors to remain open across database commits. This is the normal setting when running against ORACLE.

PROPERTY_TRUE Specifies that the property is to be set to the TRUE state.

PROPERTY_FALSE Specifies that the property is to be set to the FALSE state.

RECORD_SCOPE Specify when you want Oracle Forms to validate at the record level. This means that Oracle Forms validates each changed record when, for instance, it leaves the record.

SET_FORM_PROPERTY Examples

Example 1

/*

** Built-in: SET_FORM_PROPERTY
** Example: Set the Cursor Mode property in the current form
** to CLOSE_AT_COMMIT and changes the form
** Validation unit to the Block level.
*/
DECLARE
fm_id FormModule;
BEGIN
fm_id := Find_Form(:System.Current_Form);
Set_Form_Property(fm_id,CURSOR_MODE,CLOSE_AT_COMMIT);
Set_Form_Property(fm_id,VALIDATION_UNIT,BLOCK_SCOPE);
END;

Example 2

/*

** Built-in: SET_FORM_PROPERTY
** Example: Setup form and block properties required to run
** against a particular non-Oracle datasource.
** Procedure accepts the appropriate numerical
** constants like DELAYED as arguments.
**
** Usage: Setup_Non_Oracle(PROPERTY_FALSE,
** CLOSE_AT_COMMIT,
** UPDATEABLE_PRIMARY_KEY,
** DELAYED);
*/
PROCEDURE Setup_Non_Oracle( the_savepoint_mode NUMBER,
the_cursor_mode NUMBER,
the_key_mode NUMBER,
the_locking_mode NUMBER ) IS
fm_id FormModule;
bk_id Block;
bk_name VARCHAR2(40);
BEGIN
/* ** Validate the settings of the parameters ** */
IF the_savepoint_mode NOT IN (PROPERTY_TRUE,PROPERTY_FALSE) THEN
Message('Invalid setting for Savepoint Mode.');
RAISE Form_Trigger_Failure;
END IF;
IF the_cursor_mode NOT IN (CLOSE_AT_COMMIT,OPEN_AT_COMMIT) THEN
Message('Invalid setting for Cursor Mode.');
RAISE Form_Trigger_Failure;
END IF;
IF the_key_mode NOT IN (UNIQUE_KEY,UPDATEABLE_PRIMARY_KEY,
NON_UPDATEABLE_PRIMARY_KEY) THEN
Message('Invalid setting for Key Mode.');
RAISE Form_Trigger_Failure;
END IF;
IF the_locking_mode NOT IN (IMMEDIATE,DELAYED) THEN
Message('Invalid setting for Locking Mode.');
RAISE Form_Trigger_Failure;
END IF;
/*
** Get the id of the current form
*/
fm_id := Find_Form(:System.Current_Form);
/*
** Set the two form-level properties
*/
Set_Form_Property(fm_id, SAVEPOINT_MODE, the_savepoint_mode);
Set_Form_Property(fm_id, CURSOR_MODE, the_cursor_mode);
/*
** Set the block properties for each block in the form
*/
bk_name := Get_Form_Property(fm_id,FIRST_BLOCK);
WHILE bk_name IS NOT NULL LOOP
bk_id := Find_Block(bk_name);

Set_Block_Property(bk_id,LOCKING_MODE,the_locking_mode);

Set_Block_Property(bk_id,KEY_MODE,the_key_mode);
IF the_key_mode IN (UPDATEABLE_PRIMARY_KEY,
NON_UPDATEABLE_PRIMARY_KEY) THEN
Set_Block_Property(bk_id,PRIMARY_KEY,PROPERTY_TRUE);
END IF;

bk_name := Get_Block_Property(bk_id, NEXTBLOCK);
END LOOP;
END;


GET_FORM_PROPERTY Built-in