Skip to Content
0

How to check data is present in the view in My SapUi5 App..??

Feb 09, 2017 at 08:58 AM

31

avatar image
Former Member

my data is present in my controller as an object but its not getting displayed in my view why is that so and how to check whether data is present in the view.

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

1 Answer

Ulrich Block
Feb 09, 2017 at 09:53 AM
0

In case you bind data as model to a control or view, all dependents will inherit this model. The exception is, when you bind another model to one of the children.

In order to check, which model is currently bound, use:

console.table(this.getView().byId("yourControlId").getModel().getData());

This code will fail in case there is no model.

If you want to check from the dev console you need to use something similar to:

console.table(sap.ui.getCore().byId("__xmlview1--yourControlId").getModel().getData())
Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

When Should we use this.getView() and sap.ui.getCore()..?? Can you please explain it..

0