Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3019

Not getting OData in the view when triggering the call in Component.js

$
0
0

Hi,

 

In the Component.js I trigger an OData call and bind the response to the component.

 

I can see the model in the view (view.getModel() - mOdata) but there is no binding context (view.getBindingContext() - undefined).

 

The the view bound elements are not getting the data bound:

 

e.g. in Icon Tab Filter:

 

<IconTabFilter showAll="true" count="{NumberOfItems}" text="{NumberOfItemsDescription}" key="All" />

 

If I do it in the controller and I bind the result in the view it works, I have both.

 

Controller:

 

this.getView().bindElement("/ScenarioSet('" + scenarioId + "')");

 

Component.js - init()

 

// Read
oModel.read(    "/ScenarioSet('" + scenarioId + "')", {  success: function(oDataStep, oResponse) {  // Set the Scenario  oModel.setProperty("/ScenarioSet('" + scenarioId + "')", oDataStep);            }    }
);
this.setModel(oModel);

 

How do I make it work like if it was in the controller?

 

Thanks!

 

Regards,

Serge.


Viewing all articles
Browse latest Browse all 3019

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>