Skip to Content

UI5 Subrouting alternative??

Good evening Colleagues,

I just wanted to create a Splitapp with routing. But I can only find tutorials that use "subroutes" in the manifest.json file. But I am on version 1.7 and subroutes are depracted since 1.28.

Do you know how to solve the problem?

Best regards
Christian

PS: Below is my manifest.json file with subrouting.

{
	"_version": "1.7.0",
	"sap.app": {
		"id": "com.splitapp",
		"type": "application",
		"i18n": "i18n/i18n.properties",
		"applicationVersion": {
			"version": "1.0.0"
		},
		"title": "{{appTitle}}",
		"description": "{{appDescription}}",
		"sourceTemplate": {
			"id": "ui5template.basicSAPUI5ApplicationProject",
			"version": "1.40.12"
		}
	},


	"sap.ui": {
		"technology": "UI5",
		"icons": {
			"icon": "",
			"favIcon": "",
			"phone": "",
			"phone@2": "",
			"tablet": "",
			"tablet@2": ""
		},
		"deviceTypes": {
			"desktop": true,
			"tablet": true,
			"phone": true
		},
		"supportedThemes": [
			"sap_hcb",
			"sap_belize"


		]
	},


	"sap.ui5": {
		"rootView": {
			"viewName": "com.splitapp.view.app",
			"type": "XML"
		},
		"dependencies": {
			"minUI5Version": "1.30.0",
			"libs": {
				"sap.ui.core": {},
				"sap.m": {},
				"sap.ui.layout": {},
				"sap.ushell": {},
				"sap.collaboration": {},
				"sap.ui.comp": {},
				"sap.uxap": {}
			}
		},
		
		"routing" : {
			"config" : {
				"viewType" : "XML",
				"viewPath": "com.splitapp.view",
				"targetAggregation": "detailPages",
				"clearTarget" : false
				
			},
			"routes" : [{
				"pattern" : "",
				"name": "Master",
				"view": "Master",
				"targetAggregation": "masterPages",
				"targetControl": "splitapp",
				
				"subroutes": [{
					"pattern": "",
					"name": "Detail",
					"view": "Detail",
					"targetAggregation": "detailPages"
				}]
			}]
		},
		"contentDensities": {
			"compact": true,
			"cozy": true
		},
		"models": {
			"i18n": {
				"type": "sap.ui.model.resource.ResourceModel",
				"settings": {
					"bundleName": "com.splitappSplit.i18n.i18n"
				}
			}
		},
		"resources": {
			"css": [{
				"uri": "css/style.css"
			}]
		}
	}
}
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 09, 2017 at 03:35 AM

    Hi Christian,

    Subroute has been replaced with Targets. To know more about targets, please visit:

    https://sapui5.hana.ondemand.com/#/topic/1b6dcd39a6a74f528b27ddb22f15af0d

    Below is one sample routing configuration using targets for splitapp:

    "routing": {
    			"config": {
    				"routerClass": "sap.m.routing.Router",
    				"viewType": "XML",
    				"viewPath": "sap.ui.demo.masterdetail.view",
    				"controlId": "idSplitAppControl",
    				"async": true
    			},
    
    
    			"routes": [
    				{
    					"pattern": "",
    					"name": "splitapp",
    					"target": ["master", "detail"]
    				}
    			],
    
    
    			"targets": {
    				"master": {
    					"viewName": "Master",
    					"viewLevel": 1,
    					"viewId": "master",
    					"controlAggregation": "masterPages"
    				},
    				"detail": {
    					"viewName": "Detail",
    					"viewId": "detail",
    					"viewLevel": 2,
                                            "controlAggregation": "detailPages"
    				}
    			}
    		}
    

    Regards,

    Rahul

    Add comment
    10|10000 characters needed characters exceeded