Skip to Content
0

Want to navigate from one page to another

Oct 06, 2017 at 10:21 AM

72

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
Former Member

View1.controller.js :

BookMoviePage.controller.js :

component.js :

manifest.json :

view1.png (11.8 kB)
bookmoviepage.png (18.6 kB)
component.png (15.6 kB)
manifest.png (17.7 kB)
0
Former Member

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

0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Jamie Cawley
Oct 06, 2017 at 12:48 PM
0

Check the browser javascript console for an error.

Regards,

Jamie

Share
10 |10000 characters needed characters left characters exceeded
Vedaradhya Agrahar Oct 09, 2017 at 06:40 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Arjun Biswas Oct 10, 2017 at 08:54 AM
0

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.

0

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.

0