Use data sources to separate the user interface from the application data and to remove the dependencies between a Kanzi Studio project and the application code which define the Kanzi application. More...
Public Member Functions | |
| void | close () |
| Immediately releases the ownership of the backing native object, as opposed to deferring to garbage collection. | |
| DataObject | getData () |
| Retrieves the root object of the underlying data tree. More... | |
| DataContext | lookupDataContext (String relativePath) |
| Performs object look-up by path. More... | |
Public Member Functions inherited from DataContext | |
| ModifiedSubscriptionToken | addModifiedNotificationHandler (ModifiedSubscriptionFunction modifiedHandlerFunction) |
| Allows to subscribe to modifications in this data context. More... | |
| DataObject | getData () |
| Retrieves the root object of the underlying data tree. More... | |
| DataContext | lookupDataContext (String relativePath) |
| Performs object look up by path. More... | |
| void | notifyModified () |
| Triggers modification procedure in this data context, which invokes the subscriptions. | |
| void | removeModifiedNotificationHandler (DataContext.ModifiedSubscriptionToken token) |
| Removes a modification subscription. More... | |
Public Member Functions inherited from Resource | |
| String | getName () |
| Gets the resource name. More... | |
| String | getUrl () |
| Gets the resource URL. More... | |
| void | setKeepAlive (boolean keepAlive) |
| Sets the keep alive flag. More... | |
Public Member Functions inherited from KanziObject | |
| boolean | equals (Object object) |
| Domain | getDomain () |
| Returns the domain the object belongs to. More... | |
| Metaclass | getDynamicMetaclass () |
| Returns the metaclass of the dynamic type of the object. More... | |
| boolean | isStale () |
| Test if the object is stale i.e. More... | |
| void | releaseOwnership () |
| Release ownership of the backing native object from this object. More... | |
| void | removeLocalValue (PropertyType propertyType) |
| Removes the local value associated with the property. More... | |
| boolean | takeOwnership () |
| Take ownership of the backing native object in this object. More... | |
Static Public Member Functions | |
| static Metaclass | getStaticMetaclass () |
| Returns the metaclass of this class. More... | |
Static Public Member Functions inherited from DataContext | |
| static Metaclass | getStaticMetaclass () |
| Returns the metaclass of this class. More... | |
Static Public Member Functions inherited from KanziObject | |
| static Metaclass | getStaticMetaclass () |
| Returns the metaclass of this class. More... | |
Protected Member Functions | |
| DataSource (Domain domain, String name, Metaclass metaclass) | |
| Creates a DataSource. More... | |
| void | onLoaded () |
| Override function called after #loadFromKZB. | |
Additional Inherited Members | |
Public Attributes inherited from DataContext | |
| AbstractMetaclass | DataContextMetaclass = new AbstractMetaclass("Kanzi.DataContext") |
| DynamicPropertyType< Resource > | DataContextProperty |
| DynamicPropertyType< Resource > | ItemsSourceProperty |
Public Attributes inherited from DataSource | |
| AbstractMetaclass | DataSourceMetaclass = new AbstractMetaclass("Kanzi.DataSource") |
Use data sources to separate the user interface from the application data and to remove the dependencies between a Kanzi Studio project and the application code which define the Kanzi application.
Kanzi allows you to define the format and structure of your data source by defining a Kanzi Engine data source plugin.
When you use a data source in a Kanzi application you bind the values of properties and property fields to data that comes from a data source. This binding establishes a connection between a node or a resource and the application data. When data in the data source changes, the nodes and resources which are bound to the data reflect the change in the data.
To set a node to use a data source, use the DataContext.DataContext property. When you set the Data Context property for a node, all its child nodes inherit the value of the Data Context property. After you set a node to use a data source, you can use bindings to access the data.
|
protected |
Creates a DataSource.
| domain | UI Domain where this DataSource belongs |
| name | Name of the Data Source |
| metaclass | Metaclass data for this DataSource |
| DataObject getData | ( | ) |
Retrieves the root object of the underlying data tree.
|
static |
Returns the metaclass of this class.
| DataContext lookupDataContext | ( | String | relativePath | ) |
Performs object look-up by path.
| relativePath | Path of the object where to look at, separated by '.'. |