a month ago - last edited a month ago
Hello experts!
I made some simple movie website using ToolPage layout like below.
view/App.view.xml
<mvc:View controllerName="my_namespace.controller.App"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="sap.m"
xmlns:mvc="sap.ui.core.mvc"
xmlns:tnt="sap.tnt"
xmlns:core="sap.ui.core">
<App id="app">
<tnt:ToolPage id="toolPage">
<tnt:header>
<core:Fragment fragmentName="my_namespace.view.Header" />
</tnt:header>
<tnt:subHeader>
<core:Fragment fragmentName="my_namespace.view.subHeader" />
</tnt:subHeader>
<tnt:mainContents>
<NavContainer id="toolPageNavContainer">
<pages></pages>
</NavContainer>
</tnt:mainContents>
</tnt:ToolPage>
</App>
</mvc:View>
And I want to fix my header in every page and only switch mainContents using routing. So I wrote routing config in manifest.json file.
manifest.json
{
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"type": "View",
"viewType": "XML",
"async": true,
"viewPath": "my_namespace.view",
"controlId": "toolPageNavContainer",
"controlAggregation": "pages",
"transition": "fade"
},
"routes": [
{
"pattern": "",
"name": "home",
"target": "movieList"
},
{
"pattern": "movie/{movieId}",
"name": "detail",
"target": "movieDetail"
},
{
"pattern": "profile",
"name": "profile",
"target": "profile"
}
],
"targets": {
"movieList": {
"viewName": "MovieList",
"viewId": "movieListView"
},
"movieDetail": {
"viewName": "MovieDetail",
"viewId": "movieDetailView"
},
"profile": {
"viewName": "Profile",
"viewId": "profileView"
}
}
},
"rootView": {
"viewName": "my_namespace.view.App",
"type": "XML",
"async": true,
"id": "app"
}
}
The problem is when I refresh browser in my "movieDetail" page and navTo "home" page which targets MovieList.view.xml, the MovieList view shows up fine, but the MovieList.controller.js file doesn't load. However, it works fine in reverse.
And weird thing is when I refresh browser in my Profile page and navTo home page everything works fine.
How can this be possible? I already check every namespace of View and Controller files, but cannot find anything wrong.
I start this project using BAS Multitarget Application Template and attach application information. If you need more source code or some information please tag me. I will reply ASAP.
If you have encountered the same issue or have any idea what might be going wrong, please advise.
Thanks.
User | Count |
---|---|
82 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.