on 05-08-2017 3:23 PM
I am having a weird problem with one specific site in my SAPUI5 application where model data gets lost if i navigate back and then forward again. The view consists of two lists which are populated from the same list inside the model like this:
First List:
<List items="{
path: 'startlist>/startlistElements',
sorter: {
path: 'competitors/0/rankOfficial'
},
filters: [
{
path: 'competitors/0/isMarked',
operator: 'EQ',
value1: true
}
]
}">
Second List (same view):
<List showNoData="false" items="{
path: 'startlist>/startlistElements',
sorter: {
path: 'time'
},
filters: [
{
path: 'competitors/0/isMarked',
operator: 'EQ',
value1: false
}
]
}">
Here is an example what happens if i navigate back and forth inside the browser:
1. Initial load (everything is fine):
2. Navigate Back and Forward with the Browser (flag cannot be loaded, because the name of the image inside the model seems to be empty):
3. Navigate Back and Forward again with the Browser (now it seems to be spreading - even the names inside the model where previously only the flag was missing is missing, and the second row is also affected):
If i do this over and over more and more data gets missing until the second list only has question-marks as images (The first list in the view is NOT affected by this!). If i then repeat the process everything gets back to normal for the next load and then starts all over again.
What could cause such an issue? I am using JSON-Models to load my data from a REST-Service. I can see that all requests (also after navigating back and forward again) are non-cached requests and the data which seems to be missing is also returned from the server normally.
Thanks for any help
I have solved my own problem but i am not sure why this is the problem.
I was setting the model for the view inside the attachRequest callback:
oJSONModel.attachRequestCompleted(function(oEvent) {
this.getView().setModel(oJSONModel);
}.bind(this)
and somehow this was the problem. After calling the setter right away the problem went away..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just noticed that this also occurs when i navigate back using a router:
var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
oRouter.navTo('startlist');
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.