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:

PropertyTypeExplanationEquivalent HTML Attribute
objectNamestringThe 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
entityNamestringThe name of the business entity that the Smart Data Source will serve.smart-business-entity-name
tableRefstringThe name of the business entity table managed by this Smart Data Source instance.smart-entity-table
entityViewstringOptional attribute for setting the business entity table view (additional tables joined to the tableRef)smart-entity-view
navigationSourcestringOptional 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
initialFilterFilterDescriptor | CompositeFilterDescriptor | stringOptional 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
initialSortSortDescriptor[]Optional attribute used for setting the initial sort configuration of the data sourcesmart-sort
parentDataSourcestringOptional 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
foreignFieldsstringTo 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
partialDatasetlogicalSets whether the underlying JSDO should be treating it's data as a partial dataset.partial-dataset
filterSourcestringOptional 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
serverSideFilteringlogicalOptional attribute. If set to false, the Smart Data Source will perform client side filtering. The default value is true.smart-server-side-filtering