Skip to Content
0

auto refresh of viz chart data using odata model not working

Aug 24, 2017 at 10:31 AM

171

avatar image
Former Member

Hi All,

I have created a line graph with sapui5 by fetching data from a table “T_IOT_71BF4C35C86ACDB8FC33” in sap hana trail instance .

I used odata model for bindings ,but when ever i am inserting a new row in a table manually then bindings are not refreshing automatically.But if i refresh them manually using “refresh” method of odata model newly created row is reflecting in graph.

Please find code below

var url = “/destinations/tools/com.sap.iotservices.mms/v1/api/http/app.svc”;

var oModel = new sap.ui.model.odata.ODataModel(url);

oModel.setDefaultBindingMode(“TwoWay”); oModel.setRefreshAfterChange(true);

this.getView().setModel(oModel);

var oVizFrame = this.getView().byId(‘idVizFrame’);

var oDataset = new sap.viz.ui5.data.FlattenedDataset({ dimensions: [{ name: ‘G_CREATED’, value: { path: ‘G_CREATED’, formatter: this.formatDate }
}],
measures: [{ name: ‘C_VALUE’, value: ‘{C_VALUE}’ }],
data: { path: “/T_IOT_71BF4C35C86ACDB8FC33” } });

oVizFrame.setDataset(oDataset);

oVizFrame.setVizType(‘line’);

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers