Data Service Events
The concept of adding data services and creating bindings is an important part of creating ThingWorx mashups. The visualization widgets that you add to a mashup do not contain data, and you must bind data from data services. After you bind data to a data service on your mashup, you can bind events from other services, functions, and widgets to execute it. Data services contain their own events that you can bind to execute other services within the mashup.
Consider a mashup with two grid widgets. The first grid displays a list of orders and the second grid displays a list of additional details for the selected order. When you select an order in the first grid, the selected data row is changed, and a call to update the order details is executed using the SelectedRowsChanged event of the data service.
When you select a data service on the Data panel, its events and properties are displayed on the Data Properties panel. The following table lists default events for data services:
Service Event
Description
ServiceInvokeCompleted
Triggers after a service is executed. For example, you can update data on a server by invoking a service. The ServiceInvokeCompleted event triggers when that data is updated. You can bind this event to another service and retrieve the updated data back to another widget.
AllDataChanged
Triggers when the service returns a data set and the data set is updated.
SelectedRowsChanged
Triggers when the selected data row is changed. For example, you can bind this event to a service that updates data when an item is selected in a Dropdown widget.
On the canvas, click the arrow next to the widget to open the context menu. The widget events are listed. The following image shows the open context menu and widget events for the Textfield widget:
To create a binding, drag an event from this list to a service on the Data panel.
Widget Events
Was this helpful?