on 07-13-2018 9:22 AM
Hello Experts,
I am trying to bind the data from a model which is filtered from Odata Model. I am unable to achieve it. Please help me with it.
Hi,
In view.xml:
<TileContainer id="TileId" tiles = "{NamedModel>/TileCollection}">
<StandardTile type="{NamedModel >type}" number="{NamedModel>number}" />
</TileContainer>
In controller:
var oData = Data.results(Fetch Data from OData & store that data in one variable like oData)
var oModel = new sap.ui.model.json.JSONModel();
oModel.setData(oData,"NamedModel");
By this way you can bind data to tilecontainer.
Thanks,
asha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Asha.
I was doing the same as you suggested, the only mistake I was doing is I have to just bind the model without providing the property path which you did here as tiles = "{NamedModel>/TileCollection}". I just removed TileCollection and it worked fine.
Appreciating your solution though.
Check on the options of binding a model to the control or the view - https://sapui5.hana.ondemand.com/#/topic/e5310932a71f42daa41f3a6143efca9c.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.