Developer

Complex Table Tree

The complex table tree field edit type displays the records of a complex table in a tree control, providing a parent-child relationship to the records. Each node in the tree control represents a complex table record. This edit type displays a field on the detail screen with an ellipses button. When this button is clicked the screen containing the tree control is displayed. Definable behaviors include the table indexes to be treated as the parent and child indexes, the starting point of the records, the number of levels below the start point to display, and the complex table field values to display from each record in each node of the tree control.

The complex table tree field edit type allows for the creation of parent-child relationships that do not exist in the complex table’s structure. Part of the definition of a field of this type is the selection of two indexes in the complex table, both of which are top-level indexes. One will be used as the parent index and the other the child. This relationship will only exist while the tree control screen is displayed.

Complex Table Tree Attributes

Following are the attributes specific to the complex table tree field edit type. These attributes are in addition to the common field attributes:
  • Complex Table: This attribute references the complex table whose records will be displayed in the tree control screen.
  • Parent Index: This attribute references the index within the complex table to use as the parent index. Records will be organized in the tree control according to their common parent based on this index. Each node will contain child nodes with the same value in the field for which this index is defined.
  • Child Index: This attribute references the index within the complex table to use as the child index. Each record with a unique value in the field upon which this index was created will be listed in the tree control under the parent record.
  • Search Index: This attribute can be set to restrict the index used to search the complex table. If an index is selected for this attribute, the user will only be able to search the complex table using that index. By default, all top-level indexes on string fields can be used to search the records.
  • Parent Root: This attribute can be set to a value found in the complex table field for which the selected Parent Index is defined. Any records with the Parent Root value in this field will be treated as the top-level parent records by the complex table tree field. The resulting behavior will be that these records will be listed as the root nodes in the tree control.
  • Display Field: This attribute references a complex table field whose value will be displayed for each node in the tree control. This same value will also be the one returned to the field for display on the detail screen containing the complex table tree field definition. If this value is not set, the default is to display the field for which the complex table’s primary index was defined. The Display Format attribute to this screen field edit type can also affect the appearance of the nodes in the tree control.
  • Return Field: This attribute specifies the complex table field to return for the selected record for the purpose of setting the property targeted by the screen field. By default, the complex table field for which the primary index was defined is the value returned.
  • Display Type: This attribute can specify how each node in the tree control will be displayed. The default is to display the table field value from the Display Field attribute for the record each node represents. The other alternatives are to display not only the value for that record, but also the values of each ancestor to that record. This can be in either a parent-to-child order (Root to Selected Item), or in a child-to-parent order (Selected Item to Root). The value from each record displayed in the node can be separated in the display using the Connect Items With attribute (discussed below). The Display Field attribute contains the field value displayed for each record.
  • Display Format: This attribute can contain format strings to format the display of the selected record in the detail screen field. To access the values of the selected record, use the format string syntax of %fieldName where fieldName is the name of the complex table field whose value is to be displayed.
  • Tree Format: This attribute can contain format strings to format the display of the nodes in the tree control. Using these format strings, you can display additional complex table fields for each record in its respective node. This will be in addition to the value selected in the display field attribute. To reference a complex table field, the syntax is %fieldName where fieldName is the name of the complex table field.
  • Connect Items With: This attribute can contain a character that will be placed in between each of the values displayed in a single node. This attribute is only available if the Display Type is set to either Root to Selected Item, or Selected Item to Root. The character(s) contained in the Connect Items With attribute will be placed between the values for each record in the hierarchy within a single node of the tree control.
  • Word Wrap: This attribute, when set to true, will wrap the text of the nodes to the next line, if it spans beyond the viewable area of the screen. The default is to not wrap the node values, requiring the user to horizontally scroll the tree control for longer values.
  • Sort: This attribute controls how child nodes are sorted in relation to nodes that begin with a hyphen. In many cases, a complex table will contain a default record, such as “--None--”. The Sort attribute can specify that such records are sorted either before or after the other nodes. The default setting will place these items wherever they may be sorted according to the locale settings of the client device.
  • Depth: This attribute can specify how many levels of the hierarchy within the complex table you to display in the tree control. The number of levels refers to the number of descendents to display below the root node. This value is relative to the Parent Root, if one is specified. Note that this value does not specify the actual level, but rather the number of levels counting from the Parent Root.
  • Search: If this attribute is enabled the search controls in the complex table tree screen will be hidden.
  • Scanning: This attribute can enable barcode scan searches of the complex table records within the tree control. The complex table will be searched using the specified Child Index for the value scanned in. The first matching record will be selected in the tree control. This attribute only affects complex table tree fields defined for detail screens used by a scanner platform and displayed on a device equipped with a barcode scanner.