on ‎2016 Jan 14 2:16 PM
Hi,
I observed the following behaviour: I created a navigation path and a number of models to be used in my App. The models are created in Component.js means centrally. I can easily access them from my MainView by this.getModel(). In the target View I am processing the model content. To access it there, I run
| var oModelAnchor = sap.ui.getCore().byId(cModelAnchorViewID); | ||
| var oModelL = oModelAnchor.getModel(cModelName); |
cModelAnchorViewID is the view ID of the main View and cModelName is containing the name of the model. Modeltype is JSON the viewtypes are XML and javascript. Code works fine as long as I use the implemented sapui5 navigation functionality.
As soon as I am refreshing the page, when I am on the target view by using the browser refresh button, the runtime context changes. My anchor view is not longer accessible and the first line of code is returning undefined. To work around the problem I declared the model locally to this view.
Any ideas why this happens? Obviously this behaviour is having significiant impact on how to implement value handling along navigation paths.
thanks for feedback.
WPdat
Request clarification before answering.
hi,
I had the same problem in my fiori launchpad because of change of id of the views when refreshing.What i did was i get the view id in onInit() method and used it.This solved my problem
hope this helps
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.