Datasource Expression can be used to access attribute values from a datasource's data.

Commonly Used Syntax
#{DatasourceName.attributeName}

The DatasouceName above is case sensitive and the attributeName is not case sensitive. Any of the following expressions can be used to retrive the "Employee Name" attribute value from the Employee datasource

#{Employee.Employee Name}
#{Employee.employeeName}
#{Employee. Emp loyee Na me }

All the above are same as #{Employee.employeename}

Advanced Syntax
#{DatasourceName:itemId.attributeName.function}

Where function could be one of multi, all
selectedrows.count, sum, max, min, avg, count
#{Employee:empId.multi} will return all the selected empId attribute values from a grid with multiselection enabled with Employee datasource with ; delimitor e.g. 100;104;105
#{Employee:empId.all} will return all the empId attribute values from Employee datasource with ; delimitor e.g. 100;104;105
#{Employee:empId.selectedrows.count} will return number of rows selected in the grid with multiselection enabled
#{OrderLine:someAttr.count} will return the number of visible rows in the grid with OrderLine datasource
#{OrderLine:qty.sum} will return sum of all qty attribute value from OrderLine datasource
#{OrderLine:all} will return RPCModelData of the current row of OrderLine datasource

When you use the same datasource for multiple Grids or Charts, then you can provide the itemId to retrive the data from a specific datasource instance.
#{Employee:gridOne.salary.sum} will return the sum of salary from all the rows of the grid with item id "gridOne".
#{Employee:gridOne.empNumber} will return the empNumber from the current row of the grid with item Id "gridOne"

Note: Unlike Grid & Charts, if the same datasource is assigned to multiple single row item types e.g. FormPanel, ContentPanel, LayoutContainer etc., there will be only one instance of the datasource created by the platform.  i.e. a single instance of the datasource is shared by all FormPanel having the same datasource specified. Hence you cannot access a FormPanel's datasource by providing the item Id in the above expression.
Also, if a datasource is specified for a Grid and then to a FormPanel after the Grid in the page tree hierarchy. Then the FormPanel will share the Grid's datasource instance, thereby providing the detail row functionality. i.e. the FormPanel will display the active row selected in the Grid.

Location

101 California Street, Suite 2710
San Francisco, CA 94111


440 N. Wolfe Rd.
Sunnyvale, CA 94085


Office 11, 5th Floor, Building 9,
Mindspace IT Park
Hyderabad 500081

p: +1 (844) AT CloudIO (844-282-5683)
f: +1 (650) 300-5247 | e: sales@cloudio.io
© 2009, 2017 CloudIO Inc. | Terms of Use | Privacy Policy