Reputation: 43
I created a project, and a home screen is a masterpages, a first screen is authentication and does not require sidebar
manifest.json:
{
"_version": "1.1.0",
"start_url": "index.html",
"sap.app": {
"_version": "1.2.0",
"id": "generate.app",
"type": "application",
"i18n": "i18n/i18n.properties",
"title": "{{appTitle}}",
"description": "{{appDescription}}",
"applicationVersion": {
"version": "1.0.0"
},
"ach": "ach",
"resources": "resources.json",
"dataSources": {
"main": {
"uri": "/here/goes/your/serviceurl/",
"type": "OData",
"settings": {
"defaultUpdateMethod": "PUT",
"odataVersion": "2.0",
"localUri": "localService/metadata.xml"
}
}
},
"sourceTemplate": {
"id": "sap.ui.ui5-template-plugin.2masterdetail",
"version": "1.32.5"
},
"crossNavigation": {
"inbounds": {}
}
},
"sap.ui": {
"_version": "1.2.0",
"technology": "UI5",
"icons": {
"icon": "sap-icon://detail-view",
"favIcon": "",
"phone": "",
"phone@2": "",
"tablet": "",
"tablet@2": ""
},
"deviceTypes": {
"desktop": true,
"tablet": true,
"phone": true
},
"supportedThemes": []
},
"sap.ui5": {
"_version": "1.1.0",
"rootView": {
"viewName": "generated.app.view.App",
"type": "XML",
"id": "app"
},
"dependencies": {
"minUI5Version": "1.32.0",
"libs": {
"sap.ui.core": {},
"sap.m": {}
}
},
"contentDensities": {
"compact": true,
"cozy": true
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"uri": "i18n/i18n.properties"
},
"": {
"dataSource": "main",
"type": "sap.ui.model.odata.v2.ODataModel",
"settings": {
"loadMetadataAsync": false,
"json": true,
"bJSON": true,
"defaultBindingMode": "TwoWay",
"useBatch": true,
"refreshAfterChange": false,
"disableHeadRequestForToken": true
}
}
},
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"viewType": "XML",
"viewPath": "generated.app.view",
"controlId": "idAppControl",
"controlAggregation": "detailPages",
"bypassed": {
"target": ["login"]
}
},
"routes": [{
"pattern": "login",
"name": "login",
"target": ["login"]
}, {
"pattern": "tiles",
"name": "tiles",
"target": ["tiles"]
}, {
"name": "listainvestimento",
"pattern": "listainvestimento",
"titleTarget": "",
"greedy": false,
"target": ["detalheinvestimento", "listainvestimento"]
}, {
"name": "detalheinvestimento",
"pattern": "listainvestimento/detalheinvestimento",
"titleTarget": "",
"greedy": false,
"target": ["listainvestimento", "detalheinvestimento"]
}, {
"pattern": "listacontrato",
"name": "listacontrato",
"target": ["detalhecontrato", "listacontrato"]
}, {
"pattern": "listacontrato/detalhecontrato/:context:",
"name": "detalhecontrato",
"target": ["listacontrato", "detalhecontrato"]
}],
"targets": {
"login": {
"controlAggregation": "detailPages",
"viewName": "login",
"viewId": "login",
"viewLevel": 1
},
"tiles": {
"controlAggregation": "detailPages",
"viewName": "tiles",
"viewId": "tiles",
"viewLevel": 1
},
"listainvestimento": {
"controlAggregation": "masterPages",
"viewName": "listainvestimento",
"viewId": "listainvestimento",
"viewLevel": 1
},
"listacontrato": {
"controlAggregation": "masterPages",
"viewName": "listacontrato",
"viewId": "listacontrato",
"viewLevel": 1
},
"novoinvestimento": {
"controlAggregation": "detailPages",
"viewName": "novoinvestimento",
"viewId": "novoinvestimento",
"viewLevel": 2
},
"detalheinvestimento": {
"controlAggregation": "detailPages",
"viewName": "detalheinvestimento",
"viewId": "detalheinvestimento",
"viewLevel": 2
},
"detalhecontrato": {
"controlAggregation": "detailPages",
"viewName": "detalhecontrato",
"viewId": "detalhecontrato",
"viewLevel": 2
},
"novocontrato": {
"controlAggregation": "detailPages",
"viewName": "novocontrato",
"viewId": "novocontrato",
"viewLevel": 2
}
}
}
},
"sap.fiori": {
"_version": "1.1.0",
"registrationIds": [],
"archeType": "transactional"
}
}
In the control of the login page, I have this code:
try{
sap.ui.getCore().byId("App").setMode(sap.m.SplitAppMode.HideMode);
}
catch(e){
}
but the sap.ui.getCore().byId("App")
= undefined
Upvotes: 1
Views: 1806
Reputation: 90
Please try this code in your login page controller onInit
:
this.getOwnerComponent().getAggregation("rootControl").byId("idAppControl")
Upvotes: 0
Reputation: 11
Add: "fullWidth": true
to "sap.ui":
"sap.ui": {
"technology": "UI5",
"icons": {
"icon": "sap-icon://detail-view",
"favIcon": "",
"phone": "",
"phone@2": "",
"tablet": "",
"tablet@2": ""
},
"deviceTypes": {
"desktop": true,
"tablet": true,
"phone": true
},
"supportedThemes": ["sap_belize", "sap_hcb", "sap_bluecrystal"],
"fullWidth": true
},
Upvotes: 1
Reputation: 90
In the routing configuration i can see the app id as idAppControl , so try sap.ui.getCore().byId("idAppControl");
Upvotes: 0