6. Working with Arrays, Table Fields, and Collections : Table Fields : Table Field Components : Prototype Field
 
Share this page                  
Prototype Field
The prototype field is not an actual physical area on a table field, but rather a template for all the fields in the column. You can access this field in the Frame Editor by choosing the first row of the table field. You can access this template in 4GL through the ProtoField attribute of the ColumnField object. The ProtoField attribute's data type is FormField.
The FormField object is high in the system class hierarchy. Most of its useful attributes are associated with actual field objects, such as entry field or list field, that are subclasses of the FormField object. Therefore, you must cast references to the ProtoField attribute to the appropriate field type. The syntax is:
fieldtype(field(tablefield[*].column).ProtoField).attribute = value
fieldtype
Specifies the class of the column's fields
attribute
Specifies any appropriate attribute of that class.
For more information about casting, see How You Can Work with Attributes (see How You Can Work with Attributes).
When you change a ProtoField attribute, the change appears in all the cells in the column. The following statement causes all of the values in the custname column (a column of entry fields in the table field custtable) to appear in boldface:
entryfield(field(custtable[*].custname).protofield)
  isbold = TRUE;
You can hide a table field column by setting the bias of its protofield to FB_INVISIBLE:
entryfield(field(tf[*].name).protofield).CurBias = FB_INVISIBLE;