Creating a Checkbox
To create a checkbox:
- In the Object Navigator, click the plus icon
beside the desired block node.
Oracle Forms expands the block node and displays its subnodes.
- Click the Items node.
- Click Create in the toolbar.
A new item with a default name is inserted under the Items
node.
- Double-click the object icon next to the newly created item to display the
Property Palette.
- Under the General node, set the Item Type property
to Check Box.
- Under the Physical node, set the Canvas property
to the name of the desired canvas.
Note: To display an item at runtime, you must assign it to
a canvas.
- Create a label for the checkbox by entering the desired text in the Label
property field, found in the Functional node.
The checkbox label displays to the right of the checkbox element at runtime.
- Specify the values you want the checkbox to display as "checked"
and "unchecked" in the Value when Checked and Value when Unchecked
property fields, respectively. These properties are found in the Functional
node.
For example, if you want the checkbox to be "checked," or On, whenever
its stored value is XYZ, enter the string XYZ in the Value when Checked property
field.
- If you want a Null value to be displayed as checked, set Check Box Mapping
of Other Values to Checked.
- If you want a Null value to be displayed as unchecked, set Check Box
Mapping of Other Values to Unchecked. Otherwise, Other Values will result
in an invalid value error message.
Note: The values you enter cannot be longer than the
number of characters specified in the Maximum Length property.
- Set the Check Box Mapping of Other Values property, in the Functional
node, to specify how you want the checkbox to handle other values.
The Check Box Mapping of Other Values property determines how the checkbox
handles values that are not specified in the Value when Checked and Value
when Unchecked property fields:
- Choose Checked if you want the checkbox
to be checked when its value is set to any value other than those entered
in the Value when Checked and Value when Unchecked property fields.
- Choose Unchecked if you want the checkbox
to be unchecked when its value is any value other than those entered in
the Value when Checked and Value when Unchecked property fields.
- Choose Not Allowed if you want the checkbox
to reject any value other than those entered in the Value when Checked
and Value when Unchecked property fields as invalid. When an invalid Other
Value is fetched or assigned to the check box, the record is silently
rejected.
Note: The Check Box Mapping of Other Values property
applies only to checkbox values fetched from the database or assigned
programmatically at runtime. When end users toggle a checkbox on or off,
the value of the checkbox is either the Value when Checked or Value when
Unchecked--never an Other Value.
Related topics
About checkboxes
About checkbox values
About checkbox initial values
Specifying an initial value for a checkbox
Manipulating checkboxes at runtime