cancel
Showing results for 
Search instead for 
Did you mean: 

Bind filtered Model to TileContainer.

Gautam_M
Participant
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

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

Gautam_M
Participant
0 Kudos

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.

Answers (1)

Answers (1)

Sharathmg
Active Contributor
0 Kudos

Check on the options of binding a model to the control or the view - https://sapui5.hana.ondemand.com/#/topic/e5310932a71f42daa41f3a6143efca9c.html