company logo

ControlContext :: addColumn - Add column to control

The function adds a column for displaying data from the data source passed in sAccessPath to all regions defined for the control (recursively). When the data source is a collection, bCollection has to be set to true . The type of data reference is passed in eDataReferenceType .

In order to display a column label, an appropriate text might be passed in sLabel .

After changing a list definition by adding columns or regions, the tree, list or table has to be refreshed by calling refresh() .

Return value:  Column identifier ( int64  )

The column identifier is either the resource identity for the column definition (in case the column has been created from an external resource) or the internal column identifier returned from the ControlContext::addColumn() function.

Implementation details

  1. Add column with control definition
    int64 ControlContext  :: addColumn ( odaba::String &sAccessPath, odaba::String &sLabel, odabagui::DataReferenceTypes eDataReferenceType, int32 iHeight, int32 iWidth, odaba::String &sControl )

    The function creates a column with fixed column width as being passed in iWidth . When the height passed in iHeight exceeds the maximum height of the other columns, the height becomes the new height of the column or table header. The control name allows providing additional header display options. When size and/or width is 0, values from control definition are used.

    The control name may be passed as simple name. In this case, the control has to be defined in the design class for the data type defined in the data source property handle for the region. In order to refer to a control defined in a different class, a scoped name has to be passed (e.g. "VOID::verticalColumn").

    • sAccessPath - Data access path
    • sLabel - Control label

      The label (caption) is passed as string.

    • eDataReferenceType - Type of data reference

      The reference type allows choosing between different ways of accessing a data source.

    • iHeight - Hight of rectangle
    • iWidth - Width of a rectangle
    • sControl - Control name

      The control name is the name of the control resource as being defined within the parent control.

      "city"         // search city control in current control

      "..city"       // search city control in parent-parent-control

      "address.city" // search city control in subordinated address form

  2. to list
  3. Add column with dynamic size
    int64 ControlContext  :: addColumn ( odaba::String &sAccessPath, odaba::String &sLabel, odabagui::DataReferenceTypes eDataReferenceType )

    The function creates a column with dynamic size, i.e. the column width is determined by the system.

    • sAccessPath - Data access path
    • sLabel - Control label

      The label (caption) is passed as string.

    • eDataReferenceType - Type of data reference

      The reference type allows choosing between different ways of accessing a data source.

  4. to list
  5. Add column with fixed size
    int64 ControlContext  :: addColumn ( odaba::String &sAccessPath, odaba::String &sLabel, odabagui::DataReferenceTypes eDataReferenceType, int32 iHeight, int32 iWidth )

    The function creates a column with fixed column width as being passed in iWidth . When the height passed in iHeight exceeds the maximum height of the other columns, the height becomes the new height of the column or table header.

    • sAccessPath - Data access path
    • sLabel - Control label

      The label (caption) is passed as string.

    • eDataReferenceType - Type of data reference

      The reference type allows choosing between different ways of accessing a data source.

    • iHeight - Hight of rectangle
    • iWidth - Width of a rectangle
  6. to list