cancel
Showing results for 
Search instead for 
Did you mean: 

Want to navigate from one page to another

Former Member
0 Kudos

I want to navigate to another page after clicking a button on the first page but it shows nothing on the screen when I run in code in SAP WebIDE . It shows a light blue screen all around.

Former Member
0 Kudos

View1.controller.js :

BookMoviePage.controller.js :

component.js :

manifest.json :

Former Member
0 Kudos

Please provide the solution or provide me a link from where I can look for the routing and navigation without hash.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member484715
Contributor
0 Kudos

Are you using routing/event bus or normal navigation using sap.m.app methods. Depending on that, check where the call is being made to navigate. Maybe your view is not getting accessed properly.

Former Member
0 Kudos

I am new to SAPUI5 so I don't know much concepts. I have declared routes and targets in manifest.json and then I am trying to naviagte. If you know an easier and better way , please suggest. Thanks.

former_member484715
Contributor
0 Kudos

Okay....As you are new to SAPUI5, I would suggest you to try out normal navigation first, before trying on routing. For normal navigation consider this scenario where you, create two views, each having a button, on clicking the buttons, the views navigate to one another. To achieve that you just declare the views, assign the views to the container (sap.m.App), and then on button click (in view), get the reference of the app and view, then use the 'to' method of app, to navigate between the views. If you need detailed code, go through the SAPUI5 demokit walkthrough, they have the app as well as the code for navigation. Here is the link :

https://sapui5.hana.ondemand.com/#/sample/sap.m.tutorial.walkthrough.31/preview

https://sapui5.hana.ondemand.com/#/entity/sap.ui.core.tutorial.navigation

Hope this helps,

Regards.

vedaradhya
Participant
0 Kudos

Hi Swapnil,

As in your manifest.json file you didn't defined routing for bookpage, define it in routes as well in targets

"routing": {
		"config": {
				"routerClass": "sap.m.routing.Router",
				"viewType": "XML",
				"viewPath": "MyMovieApp.view",
				"controlId": "app",
				"controlAggregation": "pages",
				"transition":"slide"
			},
			"routes": [
				{
					"pattern": "",
					"name": "appHome",
					"target": "home"
				},
				{
					"pattern": "bookMovie",
					"name": "bookpage",
					"target": "bookMoviePage"
				}
			],
			"targets": {
				"home": {
					"viewName": "View1",
					"viewLevel": 1
				},
				"bookMoviePage": {
					"viewName": "BookMoviePage",
					"viewLevel": 2
				}
			}
		}

Regards,

Vedaradhya.

jamie_cawley
Advisor
Advisor
0 Kudos

Check the browser javascript console for an error.

Regards,

Jamie