Skip to Content
0
Oct 20, 2020 at 08:08 AM

Master Detail view on second view.

48 Views

I am working on an application which has View1 on clicking a button it navigates to View2, which is supposed to be Master-Detail View. I am following this tutorial.

This is what my views folder looks like (just to be more clear); [App, View1, View2, Master, Detail ]

The problem is that I have to add rooting config in manifest for Master-detail view, which is already set for App. Is it possible to somehow add multiple config?

Manifest.json

"sap.ui5": {
		"rootView": {
			"viewName": "QuickStart.Ui5.view.app",
			"type": "XML"
		},
		...
	
		"routing": {
			"config": {
				"routerClass": "sap.m.routing.Router",
				"viewType": "XML",
				"async": true,
				"viewPath": "QuickStart.Ui5.view",
				"controlAggregation": "pages",
				"controlId": "idAppControl"
			},
			"routes": [
				{
					"name": "TargetView1",
					"pattern": "",
					"view": "View1",
					"viewType": "XML",
					"targetControl": "idAppControl",
					"targetAggregation": "content",
					"clearTarget": true,
					"target": [
						"TargetView1"
					]
				},
				{
					"name": "Target_View2",
					"pattern": "View2",
					"target": [
						"Target_View2"
					]
				},
				{
					"pattern": ":layout:",
					"name": "master",
					"target": [
						"master"
					]
				},
				{
					"pattern": "detail/{product}/{layout}",
					"name": "detail",
					"target": [
						"master",
						"detail"
					]
				}
			],
			"targets": {
				"TargetView1": {
					"viewType": "XML",
					"transition": "slide",
					"clearAggregation": true,
					"viewId": "View1",
					"viewName": "View1"
				},
				"Target_View2": {
					"viewType": "XML",
					"transition": "show",
					"clearControlAggregation": false,
					"viewName": "View2",
					"viewLevel": 2
				},