DynaPDF Manual - Page 58

Previous Page 57   Index   Next Page 59

Interactive Forms
Page 58 of 839
Get/SetFieldName()
// Field name
Get/SetFieldOrientation()
// Field orientation
Get/SetFieldTextAlign()
// Text alignment of a text field
Get/SetFieldToolTip()
// Tool tip or field description
Get/SetTextFieldValue()
// Text field value or default value
GetFieldEx() is the most important function to retrieve field properties. Fields can be accessed
via the global handle or via the index within the field array of the current page.
What is a Group Type?
The field type ftGroup is used for different purposes depending on how fields are organized. A
normal group field is used to create a logical hierarchy or group of fields but group fields are
also used to create a so called “Field Group”.
A normal group field is a set of fields which use a parent field of type ftGroup to achieve a
logical hierarchy, e.g. Address.Street, Address.Country, and so on. The field and group type of
the parent group field are both set to ftGroup in this case.
One important thing must be considered when accessing children of a group field: The group
field does not occur in the field array of a page; it is only available in the global AcroForm field
array. So, while GetFieldEx() returns the entire field array including group fields
GetPageFieldEx() returns never group fields! The parent group field can be accessed with the
Parent handle of the children in this case.
The second usage of a group field is to achieve a so called “Field Group”. A Field Group is an
array of fields of the same type which share the same name and value. Such fields are internally
organized into a special kind of group field which holds the field name and value, as well as
other properties which can be shared among the group.
The children of a Field Group have no name. So, if a field contains no name then you can
already assume that it is part of a Field Group because the field name is required to be present
otherwise. Children of a Field Group contain always the handle to the parent group field. The
field type of this group field is set to ftGroup as usual but the group type is set to a field type
other than ftGroup (see GetFieldGroupType()).
The unambiguous test whether a group field is an ordinary group field or a terminal field of a
Field Group is to compare the group type with the field type. If the group type is something else
than ftGroup then this is a terminal field of a Field Group.
In this case the field contains the field name of the children as well as the field value, default
value, and tooltip. The field flags, background, border and text color, border width, and the
border style are inherited from the terminal field but can be overridden by the children.
Please note that Adobe’s Designer creates mostly Field Groups also if only one child is part of
the group.
 

Previous topic: Important field properties when creating new fields, Field Properties

Next topic: How to create a Field Group?, How to change the tabulator order?