Page 360
Table 14.4 Continued
Property Name | Item Used For | Descriptions |
VBX Control Name | V | Contains the form name of the VBX control. |
VBX Control Value Prop. | V | Determines the value property of a VBX control. |
Vertical Scroll Bar | I, T | Tells Forms that the item is to have a vertical scroll bar. |
Visual Attribute Name | C, D, I, B, R, L, T, V, O, U CT | The name of the visual attribute that supplies the values for the various font and back ground properties. |
White on Black | C, D, I, B, R, L, T, V, O, U CT | Specifies that the object is to appear on a monochrome bitmap display device as white a black background. |
Width | C, D, I, B, L, T, V, O, U, CT | The width of the item. |
Wrap Style | T | Determines the type of word wrap multi-line items will use. Valid values are: word, character,or none. |
X Position | C, D, I, B, L, T, V, O, U, CT | The horizontal position of the item's top-left corner. |
Y Position | C, D, I, B, L, T, V, O, U,CT | The vertical position of the item's top-left corner. |
The multi-line item property enables a text item to contain multiple lines of data. The text items we have seen thus far were single-line items. This means the characters were displayed in a single row within the item. Some data fields such as comments would be more favorably presented by displaying the data in a multi-line format. This can be accomplished by setting the multi-line property to true. This will allow the item to be used similar to a text editor. The item will accept tab character and carriage returns.
The Wrap property is also used in conjunction with the multi-line property. There are three wrap settings: word, character, and none. Word breaks the text following the last complete word, character breaks the text at the last visible character, and none causes Forms not to break the text. Figure 14.17 shows a single-line text item and several multi-line text items using various Wrap settings. In the middle and top-left examples the data expression is contained on one line. Parts of the expression cannot be seen. The user may view the unseen text by selecting the item and using the right arrow. The text items also behave differently. In the top example, even if a carriage return is issued, the data stays on one line. In the middle-left example, a carriage return character causes the next word to appear on the next line.
Page 361
FIG. 14.17
Examples of multi-line
text items and various
wrap settings.
TIP |
I have developed many systems where the user requested an area to enter in free-format comments. In order to support this request, I often create a 2,000 length varchar2 column in each table. I then use the Multi-Line and Wrap property settings to populate the field. The 2,000 character size offers the user plenty of space to record information. The varchar2 data type ensures the item will use only the amount of space needed to save actual data. The Multi-Line and Wrap properties ensure that the text item behaves like a word processor. |
There are a number of text item properties that are useful to the developer.
The Range Low Value and Range High Value PropertiesTwo of these item properties are the Range Low Value and Range Low Value, which act as edits. Forms will issue an error message and prevent the user from navigating from the field when the entered value is outside the ranges.
The Format Mask PropertyThe Format Mask property ensures that the data in a text item is formatted in a particular manner. The property is excellent for dates, Social Security numbers, or phone numbers. Many companies are concerned about the year 2000 dates. The Oracle7 database is year-2000 compliant, but the default date format does not show the century. It is possible to enter a date with the wrong century. Some of these companies decided to change the format of all dates contained on Forms to show the century. In order to achieve this, the Format Mask property for each of the form dates was given a property of `dd-mon-yyyy' or `dd-mon-rrrr.' Figure 14.18 shows the use of the format mask. The purchase date of the middle block has had the format changed.
Page 362
FIG. 14.18
The purchase date
format changed to
include the century
using the Format Mask
property.
The Case Restriction Property The Case Restriction property controls the case of the text. In Part II, you saw that Oracle is case sensitive, which means that a value of `a' does not mean `A.' For this reason, I have a rule that all text items in my forms have this property set to upper. This ensures that the data entered into the system is uppercase. Users of the data outside the form know they need to use uppercase expressions in their queries.
The Query Only Property The Query Only property determines whether the text item can be entered during the query mode. By default all form text items can be queried. In some cases it is not advisable to use the text item as a query field. For instance, the item may be an nonindexed column in a large table. Querying this item may cause unacceptable response time. In addition, some text items are almost never queried. I believe it increases user friendliness by allowing the user to avoid tabbing through these fields to reach another field.
The Insert Allowed Property The Insert Allowed property controls the form's ability to input a value into the item during the input mode. The Update Allowed property determines whether the user can update the item during the input mode. The Navigable property prevents the user from tabbing into the fields during the input or update mode. These properties are very important in controlling data input. There are times when the developer will not want values updated or inserted. Generally, it is bad practice to allow a user to change the primary key. It will destroy the relationships between tables and could possibly create orphan records in the related table. In another example, some forms have generated values that have meaning. A transformer number would be an example of this type of item. The developer would not want a user to enter a free format value into such an item. The value may not conform to the generated value.
The Case Insensitive Query Property Occasionally, I have had trouble with detail blocks joined to the master block by using character fields. In these situations, the detail block would not display the records for the corresponding master block. The problem occurs when one of the tables has uppercase characters and the other table does not. Setting theCase Insensitive query