on 06-07-2017 8:48 AM
Hi Community,
I built a SAPUI5 application with an IconTabBar. One of the use cases is to make changes in Tab1 and then reviewing those changes in an application log shown in Tab2.
The application log is visualized with a sap.m.table. The view in Tab2 is bound to the same context as Tab1, the table inside this view binds its items via a navigation property.
When showing the Tab2 for the first time all application log data is loaded properly and displayed in the table. If I do changes afterwards on Tab1 and want to review them on Tab2 these changes are not displayed. I have to refresh the whole application via browser refresh in order to get the latest changes stored in the log in backend.
Why does the table in Tab2 not get refreshed when model data has changed? It seems the problem is due to binding with navigation property / association which gets not updated on model changes...
following some code snippets.
view binding in the view controller:
_onObjectMatched: function(oEvent) {
var sObjectId = oEvent.getParameter("arguments").objectId;
var sVersionId = oEvent.getParameter("arguments").versionId;
var sLanguage = oEvent.getParameter("arguments").language;
this.getModel().metadataLoaded().then(function() {
var sObjectPath = this.getModel().createKey("TestCaseHeaderSet", {
Case_ID: sObjectId,
Case_Version: sVersionId,
Language: sLanguage
});
this._bindView("/" + sObjectPath);
}.bind(this));
},
items binding of the table in the XML view:
<Table id="changeLogTable" noDataText="{i18n>noChangeLogEntriesFound}" items="{ path: 'TestCaseHeadertoChangeDocNav' }" growing="true" growingThreshold="20">
Any thoughts?
Many thanks
Tobias
I do a refresh on the elementbinding of the log view now after data is saved, this helps. I did not want to refresh the entire model again, since only the element binding of this specific view needs to be updated. now it works as expected.
viewName.getElementBinding().refresh(true);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can check two points,
1) model should have "twoway" binding mode
2) after update changes do, model.refresh()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
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.