cancel
Showing results for 
Search instead for 
Did you mean: 

UI5 - How get data from Model in cache

former_member635635
Participant
0 Kudos

Hello experts,

Please could you help me to get data from a model?

Look, my model have data in cache but I can´t retrieve it to variable, looks my print:

I tried many differents forms to do it, but not sucess.

Thank you!

Accepted Solutions (0)

Answers (2)

Answers (2)

junwu
Active Contributor
0 Kudos

why want to manually get it?

anyway if you still want to go.....

it looks like odata model

you can do this

yourmodel.getObject("/TAKE THAT HIGHLIGHTED PART AS STRING ")

former_member635635
Participant
0 Kudos

Hello Jun Wu,

Thanks for your replay. I am trying set this model it to another view, after router navigation.

It´s not work for my: var modelteste = oModel.getObject("/ColetorItemset");

Do you have other suggestion?

Thank you!

junwu
Active Contributor
0 Kudos

oModel.getObject("/ColetorItemset") the string is not complete. the whole string in your rectangular box

you don't have to send object to other view, you should do it with bindingcontext.

Sharathmg
Active Contributor
0 Kudos

this.getOwnerComponent().getModel("yourModelName");

Use this code piece to access your model defined in manifest.Json file.

former_member635635
Participant
0 Kudos

Hi,

Thank you bu I am accessing my model, but I can´t retrieve data from this model. Looks, I have data, but how I get it to a variable?

Sharathmg
Active Contributor
0 Kudos

So, if once you have the model in a variable. Then, when you try to check in console with oModelVar.oData.ColetorItrmSet... what do you get?