Smart DataSource
Data Source definitions should be provided in the "dataSources" object, at the root level of the Smart Form JSON layout. Example:
{ "dataSources": { "customerDatasource": { "objectName": "customerDataSource", "entityName": "Consultingwerk.SmartComponentsDemo.OERA.Sports2000.CustomerBusinessEntity", "tableRef": "eCustomer", "entityView": "eSalesrep" }, "orderDatasource": { "objectName": "orderDataSource", "entityName": "Consultingwerk.SmartComponentsDemo.OERA.Sports2000.OrderBusinessEntity", "tableRef": "eOrder", "entityView": "eCustomer", "parentDataSource": "customerDataSource", "foreignFields": "CustNum,CustNum" } } }
Each key of the "dataSources" object represents the instance name of a Smart Data Source, and points to it's definition.
JSON Properties list and explanations:
Property | Type | Explanation | Equivalent HTML Attribute |
---|---|---|---|
objectName | string | The object name of the Smart Data Source. It is a unique identifier used to register the data source with the Data Source Registry. Other components will use this identifier to reference the Smart Data Source. | smart-object-name |
entityName | string | The name of the business entity that the Smart Data Source will serve. | smart-business-entity-name |
tableRef | string | The name of the business entity table managed by this Smart Data Source instance. | smart-entity-table |
entityView | string | Optional attribute for setting the business entity table view (additional tables joined to the tableRef) | smart-entity-view |
navigationSource | string | Optional attribute that takes the smart-object-name of a Smart Toolbar as a value. If set, the data source will adjust it's selection when the specified toolbar's navigation buttons are clicked. | smart-navigation-source |
initialFilter | FilterDescriptor | CompositeFilterDescriptor | string | Optional attribute used for setting the data source's initial filter. If set, all subsequent filters will be appended to the filter configured using this attribute. | smart-filter |
initialSort | SortDescriptor[] | Optional attribute used for setting the initial sort configuration of the data source | smart-sort |
parentDataSource | string | Optional attribute that specifies the parent data source. If set, the data source will subscribe to to the parent data source and filter according to it's selection. To be used alongside the "foreignFields" attribute. | smart-data-source |
foreignFields | string | To be used alongside the parentDatasource attribute. It is used to specify the foreign key relation between the parent and the child data sources. | smart-foreign-fields |
partialDataset | logical | Sets whether the underlying JSDO should be treating it's data as a partial dataset. | partial-dataset |
filterSource | string | Optional attribute that takes the smart-object-name of a Smart Filter as a value. If set, the data source will append filters generated by the Smart Filter when it's filter button is clicked. | smart-filter-source |
serverSideFiltering | logical | Optional attribute. If set to false, the Smart Data Source will perform client side filtering. The default value is true. | smart-server-side-filtering |