cancel
Showing results for 
Search instead for 
Did you mean: 

Master Detail view on second view.

emilymcox13
Participant
0 Kudos

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
				},

Accepted Solutions (0)

Answers (2)

Answers (2)

yuval_morad
Employee
Employee
0 Kudos

What is your starting app? Master details or empty UI5? did you create it with WebIDE template?

From the storyboard view (left menu)in Web IDE there is a visual option to add view to empty apps

emilymcox13
Participant
0 Kudos

its an empty UI5 application.

yuval_morad
Employee
Employee
0 Kudos

There is only on root view for an app

emilymcox13
Participant
0 Kudos

So how should I add config for master-detail view?

This is what I would have to add according to tutorial;

,
		"routing": {
			"config": {
				"routerClass": "sap.f.routing.Router",
				"viewType": "XML",
				"viewPath": "sap.ui.demo.fiori2.view",
				"controlId": "flexibleColumnLayout",
				"transition": "slide",
				"bypassed": {
				},
				"async": true
			},
			"routes": [
				{
					"pattern": ":layout:",
					"name": "master",
					"target": [
						"master",
						"detail"
					]
				},
				{
					"pattern": "detail/{product}/{layout}",
					"name": "detail",
					"target": [
						"master",
						"detail"
					]
				}
			],
			"targets": {
				"master": {
					"viewName": "Master",
					"controlAggregation": "beginColumnPages"
				},
				"detail": {
					"viewName": "Detail",
					"controlAggregation": "midColumnPages"
				}
			}
		}