问题
I have created an app based on Flexible Column Layout. The landing page looks as follows:
When the button Go to master detail is clicked, then it should route to /overview
page with TwoColumnsMidExpanded.
The press handler is defined as follows:
onPress: function (evt) {
this.oRouter.navTo("overview", {
layout: fioriLibrary.LayoutType.TwoColumnsMidExpanded
});
}
The source can be found on https://github.com/softshipper/fcl.
回答1:
passing the name of the layout via routing parameters just does this: passes the name of the layout via routing parameters.
you still have to take care of the layout in your applications event handlers for the event routeMatched
.
Here is a nice working example:
https://sapui5.hana.ondemand.com/#/entity/sap.f.FlexibleColumnLayout/sample/sap.f.sample.FlexibleColumnLayoutWithFullscreenPage/code/webapp/controller/FlexibleColumnLayout.controller.js
pay attention to onBeforeRouteMatched
handler in FlexibleColumnLayout.controller.js
on how to deal with that.
来源:https://stackoverflow.com/questions/65390737/why-the-navigation-to-twocolumnsmidexpanded-does-not-work