Related:
What is the meaning of 'controlAggregation' in the SAPUI5 routing configuration?
Routing Configuration Documentation
ResponsiveSplitter sample
My configuration:
// App.view.xml
<l:ResponsiveSplitter>
<l:PaneContainer id="idAppControl">
</l:PaneContainer>
</l:ResponsiveSplitter>
// Master/Detail.view.xml
<l:SplitPane>
<Panel headerText="some text"></Panel>
</l:SplitPane>
// manifest.json
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"viewType": "XML",
"viewPath": "mynamespace.view",
"controlId": "idAppControl",
"bypassed": {
"target": [
"master",
"notFound"
]
},
"async": true
},
"routes": [
{
"pattern": "/:?query:",
"name": "master",
"target": [
"master"
]
},
{
"pattern": "ControlSet/{objectId}",
"name": "entity",
"target": [
"master",
"object"
]
}
],
"targets": {
"master": {
"viewName": "Master",
"viewId": "master",
"controlAggregation": "panes"
},
"object": {
"viewName": "Detail",
"viewId": "detail",
"controlAggregation": "panes"
},
"notFound": {
"viewName": "NotFound",
"viewId": "notFound",
"controlAggregation": "panes"
}
}
}
The aggregation relationship of ResponsiveSplitter is:
ResponsiveSplitter -> rootPaneContainer(Aggregations) -> PaneContainer -> panes(Aggregations) -> SplitPane
ResponsiveSplitter -> PaneContainer (one to one relationship)
PaneContainer -> SplitPane (one to many relationship)
But I get an error:
Error: "Element sap.ui.layout.SplitPane#__pane0" is not valid for aggregation "content" of Element sap.ui.core.mvc.XMLView#application-Monitor-display-component---master
Thanks to #Erch's suggestions, I use FlexibleColumnLayout instead, route config:
"routing": {
"config": {
"routerClass": "sap.f.routing.Router",
"viewType": "XML",
"viewPath": "monitor.view",
"controlId": "fcl",
"transition": "slide",
"bypassed": {
},
"async": true
},
"routes": [
{
"pattern": ":layout:",
"name": "master",
"target": [
"master",
"detail"
]
},
{
"pattern": "detail/{objectId}/{layout}",
"name": "detail",
"target": [
"master",
"detail"
]
}
],
"targets": {
"master": {
"viewName": "Master",
"controlAggregation": "beginColumnPages"
},
"detail": {
"viewName": "Detail",
"controlAggregation": "midColumnPages"
}
}
}
Related
I tried to add https://openui5.hana.ondemand.com/entity/sap.f.tutorial.fiori2/sample/sap.f.tutorial.fiori2.13
to my project where I route from my login view to Start view and then to the master detail view.
it is important for me to have my rootView viewName set to my Login page, if I set it to view.App <- than it works, but thats not what I want.
manifest.json
"sap.ui5": {
"_version": "1.1.0",
"rootView": {
"viewName": "RCenter.view.app",
"type": "XML"
},
----------------------------------SKIPPING TO ROUTING-------------------------------------------------------
"routing": {
"config": {
"routerClass": "sap.f.routing.Router",
"viewType": "XML",
"viewPath": "RCenter.view",
"bypassed": {
},
"async": true
},
"routes": [
{
"pattern": "Start",
"name": "Start",
"controlId": "idStart",
"target": "TargetStart"
},
{
"pattern": "Login",
"name": "Login",
"target": "TargetLogin"
},
{
"pattern": "page2",
"name": "page2",
"target": "page2",
"layout": "EndColumnFullScreen"
},
{
"pattern": ":layout:",
"name": "master",
"target": [
"master",
"detail"
]
},
{
"pattern": "detail/{product}/{layout}",
"name": "detail",
"target": [
"master",
"detail"
]
},
{
"pattern": "detail/{product}/detailDetail/{supplier}/{layout}",
"name": "detailDetail",
"target": [
"App",
"master",
"detail",
"detailDetail"
]
}
],
"targets": {
"TargetStart": {
"transition": "slide",
"controlId": "idStart",
"clearAggregation": true,
"controlAggregation": "pages",
"viewName": "Start"
},
"TargetLogin": {
"transition": "slide",
"controlId": "idStart",
"clearAggregation": true,
"controlAggregation": "pages",
"viewName": "Login"
},
"master": {
"viewName": "Master",
"controlId": "flexibleColumnLayout",
"controlAggregation": "beginColumnPages"
},
"detail": {
"viewName": "Detail",
"controlId": "flexibleColumnLayout",
"controlAggregation": "midColumnPages"
},
"detailDetail": {
"viewName": "DetailDetail",
"controlId": "flexibleColumnLayout",
"controlAggregation": "endColumnPages"
},
"page2": {
"viewName": "AboutPage",
"controlId": "flexibleColumnLayout",
"controlAggregation": "endColumnPages"
}
}
}
App.View
<mvc:View
controllerName="RCenter.controller.App"
displayBlock="true"
height="100%"
xmlns="sap.f"
xmlns:mvc="sap.ui.core.mvc">
<FlexibleColumnLayout
id="flexibleColumnLayout"
stateChange=".onStateChanged"
backgroundDesign="Solid"
layout="{/layout}"/>
</mvc:View>
I mostly get Control with ID idStart could not be found - Target: TargetStart
Login.view & Start.view App-ID:
<App
id="idStart">
idStart is the id of in Login.view and Start.view (After Login you will get redirected to Start and there you will get redirected to the master detail view if you click on a certain button.
How can I get the Master-Detail Page of the example Link shown above working in my Project but without setting it as rootView-viewName??
Thanks!!
The router is picking the control; based in rootView and the given ID. In your case the control with the ID "app".
Routing simply changes the view under the aggregation pages of the "app" control.
Hence, setting it to a login view makes no sense.
As you use a flexible column layout, the router should target the layout and not app.
I am trying to build an app with flexible column layout and routing according to the tutorial on page https://sapui5.hana.ondemand.com/#/topic/a59b3de038874f879cf20bfc3287bd7c.
The app is very simple and it looks as the following:
The default button press event on the detail page is implemented as:
onPress: function (evt) {
this.oRouter.navTo("navigation", {
layout: fioriLibrary.LayoutType.EndColumnFullScreen
});
}
After clicking, it shows me the error message:
What am I doing wrong?
The routing part from the manifest file:
"routing": {
"config": {
"routerClass": "sap.f.routing.Router",
"viewType": "XML",
"viewPath": "io.example.fcl.view",
"controlId": "flexibleColumnLayout",
"transition": "slide",
"bypassed": {},
"async": true
},
"routes": [
{
"pattern": ":layout:",
"name": "master",
"target": [
"master",
"detail"
]
},
{
"pattern": "{layout}",
"name": "detail",
"target": [
"master",
"detail"
]
},
{
"pattern": "navigation",
"name": "navigation",
"target": "navigation",
"layout": "EndColumnFullScreen"
}
],
"targets": {
"master": {
"viewName": "Master",
"controlAggregation": "beginColumnPages"
},
"detail": {
"viewName": "Detail",
"controlAggregation": "midColumnPages"
},
"navigation": {
"viewName": "Navigation",
"controlAggregation": "endColumnPages"
}
}
}
The resource can be found on https://github.com/softshipper/fcl.
I'm facing an issue with SAPUI5 SplitScreen Concept. I have one initial view on which there is a button that leads to a SplitScreen application. Until this point everything works fine.The issue is that there a two additional views (Master.view, Detail.view) that should be routed to the SplitView.
They simply aren't loaded to it and I can't solve the problem.
I have mentioned manifest.json above.
{
"_version": "1.12.0",
"sap.app": {
"id": "curvy.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
}
},
"sap.ui5": {
"flexEnabled": false,
"rootView": {
"viewName": "curvy.SplitApp.view.App",
"type": "XML",
"async": true,
"id": "App"
},
"dependencies": {
"minUI5Version": "1.65.6",
"libs": {
"sap.ui.layout": {},
"sap.ui.core": {},
"sap.m": {}
}
},
"contentDensities": {
"compact": true,
"cozy": true
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "curvy.SplitApp.i18n.i18n"
}
}
},
"resources": {
"css": [{
"uri": "css/style.css"
}]
},
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"viewType": "XML",
"async": true,
"viewPath": "curvy.SplitApp.view",
"controlAggregation": "pages",
"controlId": "app",
"clearControlAggregation": false
},
"routes": [{
"name": "RouteApp",
"pattern": "RouteApp",
"target": ["TargetApp"]
}, {
"name": "SplitView",
"pattern": "SplitApp",
"view":"SplitView",
"controlId": "App",
"target": ["SplitView"],
"subroutes": [{
"pattern": "Route_Master",
"name": "Master",
"view": "Master",
"targetAggregation": "masterPages",
"targetControl": "splitapp",
"target": ["Master"],
"subroutes": [{
"pattern": "Route_Detail",
"name": "Detail",
"view": "Detail",
"targetAggregation": "detailPages",
"target": ["Detail"]
}]
}]
}],
"targets": {
"TargetApp": {
"viewType": "XML",
"transition": "slide",
"clearControlAggregation": false,
"viewId": "App",
"viewName": "App"
},
"SplitView": {
"viewType": "XML",
"viewName": "SplitView"
},
"Master": {
"viewType": "XML",
"viewName": "Master",
"controlId": "splitapp"
},
"Detail": {
"viewType": "XML",
"viewName": "Detail",
"controlId": "splitapp"
}
}
}
}
}
MESSAGE AND CODE, EDITED
I followed this tutorial "Navigate between single full view and split view", to add a separate page / view of the appSplit and now it works perfectly, but now I have the following problem, and that is that the "create" target of the "split" throws me this error in the console.
The target create has no controlId set and no parent so the target
cannot be displayed. - EventProvider sap.m.routing.Target
I can not create a new user anymore, because of this error, the "NotFound" target does not work either
This is the code of my Router
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"viewType": "XML",
"viewPath": "Apptest.view",
"controlAggregation": "pages",
"clearTarget": "false",
"bypassed": {
"target": [
"notFound"
]
},
"async": true
},
"routes": [
{
"pattern": "",
"name": "LaunchPad",
"view": "LaunchPad",
"targetControl": "customFioriContent"
},
{
"pattern": "split",
"name": "App",
"view": "App",
"targetControl": "customFioriContent",
"subroutes": [
{
"pattern": "master",
"name": "master",
"view": "Master",
"targetAggregation": "masterPages",
"preservePageInSplitContainer": true,
"targetControl": "fioriContent",
"subroutes": [
{
"pattern": "object/{SUC_ID}",
"name": "object",
"view": "Detail",
"targetAggregation": "detailPages"
}
]
}
]
}
],
"targets": {
"master": {
"viewName": "Master",
"viewLevel": 2,
"viewId": "master",
"controlAggregation": "masterPages"
},
"LaunchPad": {
"viewName": "LaunchPad",
"controlAggregation": "pages",
"viewId": "LaunchPad",
"viewLevel": 1
},
"object": {
"viewName": "Detail",
"viewId": "detail",
"viewLevel": 3
},
"objectNotFound": {
"viewName": "ObjectNotFound",
"viewId": "objectNotFound"
},
"notFound": {
"viewName": "NotFound",
"viewId": "notFound"
},
"detailObjectNotFound": {
"viewName": "DetailObjectNotFound",
"viewId": "detailObjectNotFound",
"controlAggregation": "pages"
},
"detailNoObjectsAvailable": {
"viewName": "DetailNoObjectsAvailable",
"viewId": "detailNoObjectsAvailable"
},
"SplitApp": {
"viewType": "XML",
"viewName": "SplitApp"
},
"create": {
"viewName": "CreateEntity",
"viewLevel": 2
}
}
}
Based on your description, that the launchpad is just an independent page that will take you to the split app, you don't need to define the controlAggregation for the launchpad Route. Just remove controlAggregation": "pages" and it should work.
Also remove the "controlAggregation": "detailPages", from the config on the "config" area of your json.
Dear Gurus,
As my title, I'm tryig to create an App which contains a Full-screen Menu page with some tiles, and when user presses on one, it navigate to another Master-Detail page. My problem is I can't show the detail page. My code works as below:
manifest.json:
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"viewType": "XML",
"viewPath": "WYTH.view",
"controlId": "rootApp",
"controlAggregation": "pages"
},
"routes": [{
"pattern": "menu",
"name": "menu",
"view": "Menu",
"targetControl": "rootApp",
"targetAggregation": "pages"
}, {
"pattern": "zwm01",
"name": "zwm01",
"view": "ZWM01Root",
"targetControl": "rootApp",
"targetAggregation": "pages",
"subroutes": [{
"pattern": "zwm01/",
"name": "zwm01master",
"view": "ZWM01Master",
"targetControl": "ZWM01",
"targetAggregation": "masterPages",
"subroutes": [{
"pattern": "zwm01/",
"name": "zwm01detail",
"view": "ZWM01Detail",
"targetControl": "ZWM01",
"targetAggregation": "detailPages"
}]
}]
}]
},
I managed to show the menu view with this. When I click on 1 tile, it fires the function below:
navZWM01: function() {
this.getRouter().navTo("zwm01", false);
},
In result, it doesn't show the detailpage, but the masterpage
Any suggestions?
Best regards
1) To launch full screen app i am using the routing as follows. Here Iam loading App Container wiith the help of rootView
routes : [
{
pattern : "",
name : "_full1",
targetAggregation: "pages",
target : "monitorOperations"
}
],
"targets": {
"monitorOperations" : {
"viewName": "Full1",
"viewLevel": 1,
"viewId": "_Full1Id",
"controlId": "idAppControl",
"controlAggregation": "pages"
},
}
2) To Load master detail template iam using the routing as follows. Here iam loading the splitApp container with the help of rootView
routes : [
{
"pattern": "",
"name": "master",
"target": ["detail", "master"]
},
{
"pattern": "detail/{detailId}",
"name": "detail",
"target": ["master", "detail"]
}
],
"targets": {
"master": {
"viewName": "Master",
"viewLevel": 1,
"viewId": "master",
"controlId": "idAppControl",
"controlAggregation": "masterPages"
},
"detail": {
"viewName": "Detail",
"viewId": "detail",
"controlId": "idAppControl",
"controlAggregation": "detailPages",
"viewLevel": 2
},
"notFound": {
"viewName": "NotFound",
"viewId": "notFound",
"viewLevel": 3
}
}
Combine both, in such a way that the full screen (app container) is loaded first, when user clicks on button or selects any Tile/Item in the full screen then load the second page (split container with master and detail)
routing: {
config : {
routerClass : MyRouter,
viewType : "XML",
viewPath : "org.edu.ui.views",
targetAggregation : "detailPages",
clearTarget : false
},
routes : [
{
pattern : "",
name : "_full1",
arget : "monitorOperations"
},
{
pattern : "manageOperations",
name : "_full2",
target : ["SplitAppContainer","detail", "master"]
},
{
"pattern": "detail/{product}",
"name": "detail",
"target": ["master", "detail"]
},
{
"pattern": "manageOperations1",
"name": "master",
"target": ["detail", "master"]
}
],
"targets": {
"monitorOperations" : {
"viewName": "Full1",
"viewLevel": 1,
"viewId": "_Full1Id",
"controlId": "idAppControl",
"controlAggregation": "pages"
},
"SplitAppContainer" : {
"viewId": "_Full2Id",
"viewName": "Full2",
"viewLevel": 1,
"controlId": "idAppControl",
"controlAggregation": "pages"
},
"master": {
"parent" : "SplitAppContainer",
"viewName": "Master1",
"viewLevel": 2,
"viewId": "master",
"controlId": "idSplitContainerControl",
"controlAggregation": "masterPages"
},
"detail": {
"parent" : "SplitAppContainer",
"viewName": "Detail",
"viewId": "detail",
"controlId": "idSplitContainerControl",
"controlAggregation": "detailPages",
"viewLevel": 3
},
"notFound": {
"viewName": "NotFound",
"viewId": "notFound",
"viewLevel": 3
}
}
}
I used this in my implementation, Thanks to Saran Kumar, Hope this is helpful.
Try to create two routes and tow targets, one for Master and one for Details. Each target is binded to a View, as defined in the viewName property of your targets. Set the target property of both routes to navigate to both targets.
"routes": [
{
"pattern": "",
"name": "master",
"target": ["object", "master"]
},
{
"pattern": "Objects/{objectId}",
"name": "object",
"target": ["master", "object"]
}
],
"targets": {
"master": {
"viewName": "Master",
"viewLevel": 1,
"viewId": "master",
"controlAggregation": "masterPages"
},
"object": {
"viewName": "Detail",
"viewId": "detail",
"viewLevel": 2
}
Then when you navigate from the tile click, both targets are matched. If you pass parameters to your details view, catch the "routeMatched" or the "patternMatched" events of the Router object and change the "detail" view context with bindElement()
This is very detailed in the demokit: Master-Detail Navigation