Streaming Client Components - imona/tutorial GitHub Wiki

ImonaCloud Platform uses LightStreamer Server to update prices for clients in ImonaTrade Environment.

4 types of components are used to subscribe to stream and show changing price values simultaneously with LightStreamer adapter.

3 parameters are used for all components to specify the attributes for the value to be streamed, that are;

data-grid: data grid to be subscribed, i.e. "stocks"
data-item: item to be subscribed, i.e. "GARAN", "AKBNK"
data-field: type of field to be subscribed, i.e. "ask", "bid"

Streaming Cell

In order to create the streaming cell for rich table, following code should be used:

var streamingCell = createStreamingCell("stocks", "GARAN", "ask");

Streaming Button Cell

In order to create the streaming button cell that is click listener addable for rich table, following code should be used:

var streamingButtonCell = createStreamingButtonCell("stocks", "GARAN", "ask", "green");

Streaming Label Field

In order to create the streaming label field for entity form, following code should be used after adding to component to layout:

var streamingLabelField = getComponent("streamingLabelField");
streamingLabelField.dataGrid = "stocks";
streamingLabelField.dataItem = "GARAN";
streamingLabelField.dataField = "ask";
streamingLabelField.color = "blue";

Streaming Button Field

In order to create the streaming button field that is click listener addable for entity form, following code should be used after adding to component to layout:

var streamingButtonField = getComponent("streamingButtonField");
streamingButtonField.dataGrid = "stocks";
streamingButtonField.dataItem = "GARAN";
streamingButtonField.dataField = "ask";
streamingButtonField.color = "blue";

To start subscribing to stream you should use this command:
subscribeToStream(String dataGrid);