我正在开发一个sapui5 fiori主要细节应用程序,即使我阅读文档并将其应用于那里,我似乎无法从一个视图移动到另一个视图。
我创建了一个“示例”视图,我想从细节移到示例然后返回到细节,但似乎无法工作。 这是我的细节控制器的移动按钮:
move : function () {
var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
oRouter.navTo("example", {
});
},
这里是示例控制器的返回按钮:
return : function () {
var oHistory = History.getInstance();
var sPreviousHash = oHistory.getPreviousHash();
if (sPreviousHash !== undefined) {
// The history contains a previous entry
history.go(-1);
} else {
// Otherwise we go backwards with a forward history
var bReplace = true;
this.getRouter().navTo("detail", {
entity: "equipementSet('10000004')"
} , bReplace);
}
},
最后我的manifest.json代码:
"routes": [
{
"pattern": "",
"name": "main",
"view": "Master",
"targetAggregation": "masterPages"
},
{
"pattern": "{entity}/:tab:",
"name": "detail",
"view": "Detail",
"targetAggregation": "detailPages",
"targetControl": "idAppControl"
},
{
"pattern": "example",
"name": "example",
"view": "example",
"targetAggregation": "detailPages",
"targetControl": "idAppControl"
}...