ControlContext :: addRegion - Add/Create Region
The function returns a region identifier (number), which may be used for performing further region operations by calling an appropriate region constructor. After changing a list definition by adding columns or regions, the region has to be refreshed by calling Region::refresh().
The region identifier is either the resource identity for the region definition (in case the region has been created from an external resource defined in a resource database) or the internal column identifier returned from the ControlContext::addRegion() function.
Implementation details
Regions for a list or tree control might be created from within the application. New regions are appended at the end of the sub-region list of the parent region. Sub regions can be added to a region also by calling Region::addRegion().
The function adds a region for displaying data from the data source passed in sAccessPath. 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 region label, an appropriate text might be passed in sLabel.
- sAccessPath - Data access path
- bCollection
- Data source refers to a collection
A referenced data source or path refers to a collection (true), which might also be a single reference.
- bAutoSelect
- Position instance automatically
In order to select the first instance in a collection, this option needs to be set to true. When passing false, the selection in the data source property remains unchanged.
- 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.