ADK_DataSource - Designer data source
Data sources for design objects (visual or action elements) refer to the data to be processed or displayed. Data sources might be defined as relative data sources (relative to the current data source), as global data source (such as extents) or as derived data sources provided within an application by means of transient properties or OSI functions.
Most data source definitions refer to relative data sources. A relative data source refers to a property name or operation path in data_reference, which is valid for the data type provided by the parent data source, i.e. the data source for the parent element (control) .
When a control is defined in the context of a design class (ADK_Class), properties of the class can be referred to as relative data source. Actions defined in the context of a control refer to the controls data source, by default. When an action defines a relative data source, this is considered to be relative to the related control's data source.
For inheriting a relative data source, the data reference type (reference_type) has to be set to DRT_PropertyPath or property path.
Inheriting data sources means to share the data source with the parent element (control). In order to inherit from the parent element, the data reference type (reference_type) has to be set to DRT_PropertyPath or property path and the data source (data_reference) should be set to *.
Global data sources refer to an extent or extent path (access or operation path) in data_reference. Global data sources are, typically, defined for global actions, but might be defined also in the context of local field within a control. For defining global data sources, the data reference type (reference_type) has to be set to DRT_Extent or extent.
Transient data sources are typically used in order to display dialogs. there are different ways for defining transient data sources.
For defining a transient data source referring to a complex the data type, the data reference type (reference_type) has to be set to DRT_UserDefined or user-defined and the complex data type has to be defined as structure name (structure_name). In order to create and initialize a data instance, auto-initialize (auto_init) has to be set, in addition. Usually, the data source reference (data_reference) remains empty.
When opening a control referring to such a transient data source, an initialized transient instance will be created and can be updated by the user. Transient instances should not contain references.
For defining an application controlled data source, the data reference type (reference_type) has to be set to DRT_UserDefined or user-defined and the expected complex data type has to be defined in structure name (structure_name). The auto-initialize (auto_init) has to be switched off. Usually, the data source reference (data_reference) remains empty.
While running the application, the data source may be updated from the application (context class) by calling ControlContext::setProperty().
Do never define data source inheritance (data_reference = '*') for application controlled data sources, since this may damage the data source origin when setting the data source for the control.
When requesting parameters from a user within an application in order to execute a certain task, parameter values are typically defined as controls based on option values. Since option values can be initialized easily at run-time and can also be easily accessed after calling the dialog, this provides a simple way of getting user-defined parameters.
For defining option data sources, the data reference type (reference_type) has to be set to DRT_Option or option The name of the option variable has to be defined in data_reference (without enclosing %).
In order to initialize the data source with a constant value, which might be updated later on in the application, one may define a user defined data source by setting reference_type to DRT_UserDefined or user-defined with data type (structure_name) STRING and auto-initialization (auto_init = true). The value passed in data_reference will be set as initial value in the data source string instance.
In order to refer to the data source of another control in the application, a field path might be defined instead of a property path in data_reference by selecting DRT_FieldPath or field path from the drop list.. The field path describes a hierarchical field reference by means of field (not control) names in a control hierarchy. The field path might be preceded by one or more dots '.' for addressing parent controls relative to the current control.
// current control: name (in Prson control)
.address.street // street line edit in an address subcontrol
.first_name // first name in person window
// addressing the same from within the person control
address.street
first name
In order to display enumerations, the data source reference type (reference_type) has to be set to DRT_Enumerationor enumeration The property path (data_reference) contains the enumeration name, in this case. Enumerations have to be defined in the dictionary (resource database).
One may also refer to metadata (data stored in the resource database) in order to refer to selection conditions (filter) or other metadata sources.
For defining metadata sources, the data reference type (reference_type) has to be set to DRT_ResExtent or resource extent The property path (data_reference) contains the extent name or an operation path.
- reference_type - Data source reference type
- data_reference - Data reference
- structure_name - Data type
- auto_position - Automaticallo locate an instance in a collection
- is_collection - Use data source as collection
- use_copy - Use copy handle
- auto_init - Initialize data area
- sort_case_insensitive - Case insensitive sorting
- sort_descending - Descending sortorder
- sort_order - Change default sort order
- base_collection - Base collection
- access_mode - Access mode
- data_format - Data format options
- filter - Collection filter