0
votes

When testing the SplitApp demo app provided with the 1.18.5 SAPUI5 SDK there seems to be a conflict between the routing and model binding. If you navigate to a detail page and then refresh the browser window the data binding fails. This would be the same as if you bookmarked the app on a specific view.

Just wondering if anyone knows why this is? Is it a conflict with routing and data binding? My debugging is not showing anything up yet only that the model is empty when the detail view loads.

This app uses the new Component-based router where you define your routes in the component metadata.

I've also written a small test app here js1972/test · GitHub (branch "routes") which does similar and has the same issue.

2
I installed your code and got the same issue, swapped the fake sinon service for services.odata.org/V3/Northwind/Northwind.svc and both refresh and bookmarking works wellJasper_07
Hi John, thats an interesting finding. I've just done the same and it does work when using the remote northwind service. There is a delay where I initially see no_data, then it populates (async and all that). So looks like an issue with local data in the Model only. The UI5 SDK demo apps use local data sources so they fail as well.Jason Scott

2 Answers

0
votes

the following bookmark works with the fake service ../test-routes/#/detail/Categories(2)

../test-routes/#/detail/Categories(3) doesnt

request.onSend in ODataModelFakeService.js doesnt cater for all scenarios

an alternative maybe to use sap.ui.core.util.MockServer with a cutdown metadata.xml and json files for the Category and Product entities

0
votes

I've ran into the same issue and just want to share my findings and solution:

The detail view waits until the list in the master view is loaded. If the service you are using is quite slow the list has already finsihed loading, but the model has not finished loading and thus the detail view returns an error. To fix this I've attached an "requestCompleted"-event to the model and created a jQuery.Deferred object for the model. The master then waits for the resolve of the model.

oModel.attachEvent("requestCompleted", 
 			function() {
 						this.oModelFinishedDeferred.resolve();
 						this.getEventBus().publish("Model",
 						"ModelFinished");}
			, this);