Sapui5 如何在shell中包含根视图
我看到这个例子 现在我有了一个根视图(this.app),一切正常Sapui5 如何在shell中包含根视图,sapui5,Sapui5,我看到这个例子 现在我有了一个根视图(this.app),一切正常 return this.app; 现在我想将根应用程序包含在一个shell容器中。。 我尝试这样做: var oShell= new sap.m.Shell("idShell", { title: "Test App", logo:"https://dl.dropboxusercontent.com/u/7546923/OpenUI5/SAPUI5.png",
return this.app;
现在我想将根应用程序包含在一个shell容器中。。
我尝试这样做:
var oShell= new sap.m.Shell("idShell", {
title: "Test App",
logo:"https://dl.dropboxusercontent.com/u/7546923/OpenUI5/SAPUI5.png",
headerRightText: "This is a sap.m.Shell",
logout: function() {alert("Logout button was pressed");}
});
oShell.setApp(this.app);
return oShell;
var oShell= new sap.m.Shell("idShell", {
title: "Test App",
logo:"https://dl.dropboxusercontent.com/u/7546923/OpenUI5/SAPUI5.png",
headerRightText: "This is a sap.m.Shell",
logout: function() {alert("Logout button was pressed");}
});
oShell.setApp(sap.ui.xmlview("view.shell")); //the view of the example in the documentation
return oShell;
但这样我就看不到顶部的酒吧了。(我只看到应用程序的宽度有限,左侧的应用程序外有徽标)
我尝试这样做:
var oShell= new sap.m.Shell("idShell", {
title: "Test App",
logo:"https://dl.dropboxusercontent.com/u/7546923/OpenUI5/SAPUI5.png",
headerRightText: "This is a sap.m.Shell",
logout: function() {alert("Logout button was pressed");}
});
oShell.setApp(this.app);
return oShell;
var oShell= new sap.m.Shell("idShell", {
title: "Test App",
logo:"https://dl.dropboxusercontent.com/u/7546923/OpenUI5/SAPUI5.png",
headerRightText: "This is a sap.m.Shell",
logout: function() {alert("Logout button was pressed");}
});
oShell.setApp(sap.ui.xmlview("view.shell")); //the view of the example in the documentation
return oShell;
通过这种方式,我可以看到该条,但无法将根应用程序与shell的内容相关联
现在我使用sap.ui.unified.Shell
jQuery.sap.require("sap.ui.unified.Shell");
jQuery.sap.require("sap.ui.unified.ShellHeadItem");
this.shell = new sap.ui.unified.Shell('');
var logout=new sap.ui.unified.ShellHeadItem({
tooltip: "Logout",
icon: "sap-icon://menu2"
});
this.shell.addHeadItem(logout);
this.shell.addContent(this.app);
如何使用MVC模式来管理shell bar内容?我想使用XML视图。我怎样才能避免写作呢
jQuery.sap.require("sap.ui.unified.Shell");
jQuery.sap.require("sap.ui.unified.ShellHeadItem");
这对我来说很有用:
new sap.m.Shell("Shell", {
app: sap.ui.jsview("RootView", "my-app.view.App")
}).placeAt("root");
而my app.view.app
的根控件是sap.m.SplitApp
(或sap.m.app
)。请注意,sap.m.Shell
只是提供了一个框架,而没有提供任何通常在sap.m中使用的NavContainer、Page或类似概念。您的视图.shell中的根控件是什么?从文档中:
getApp():sap.ui.core.Control
聚合应用程序的Getter。Shell包含应用程序或拆分应用程序
(它们可能被包装在视图中)。不允许使用其他控件类型
顺便说一句:你的示例链接对我不起作用
溴
克里斯这对我很有用:
new sap.m.Shell("Shell", {
app: sap.ui.jsview("RootView", "my-app.view.App")
}).placeAt("root");
而my app.view.app
的根控件是sap.m.SplitApp
(或sap.m.app
)。请注意,sap.m.Shell
只是提供了一个框架,而没有提供任何通常在sap.m中使用的NavContainer、Page或类似概念。您的视图.shell中的根控件是什么?从文档中:
getApp():sap.ui.core.Control
聚合应用程序的Getter。Shell包含应用程序或拆分应用程序
(它们可能被包装在视图中)。不允许使用其他控件类型
顺便说一句:你的示例链接对我不起作用
溴
克里斯这对我很有用:
new sap.m.Shell("Shell", {
app: sap.ui.jsview("RootView", "my-app.view.App")
}).placeAt("root");
而my app.view.app
的根控件是sap.m.SplitApp
(或sap.m.app
)。请注意,sap.m.Shell
只是提供了一个框架,而没有提供任何通常在sap.m中使用的NavContainer、Page或类似概念。您的视图.shell中的根控件是什么?从文档中:
getApp():sap.ui.core.Control
聚合应用程序的Getter。Shell包含应用程序或拆分应用程序
(它们可能被包装在视图中)。不允许使用其他控件类型
顺便说一句:你的示例链接对我不起作用
溴
克里斯这对我很有用:
new sap.m.Shell("Shell", {
app: sap.ui.jsview("RootView", "my-app.view.App")
}).placeAt("root");
而my app.view.app
的根控件是sap.m.SplitApp
(或sap.m.app
)。请注意,sap.m.Shell
只是提供了一个框架,而没有提供任何通常在sap.m中使用的NavContainer、Page或类似概念。您的视图.shell中的根控件是什么?从文档中:
getApp():sap.ui.core.Control
聚合应用程序的Getter。Shell包含应用程序或拆分应用程序
(它们可能被包装在视图中)。不允许使用其他控件类型
顺便说一句:你的示例链接对我不起作用
溴
Chris我的根应用程序(this.app)是一个拆分应用程序@cschuff我更改链接该链接与sap.ui.unified.Shell有关,您的代码显示一个sap.m.Shell。你在用什么?我写:this.shell=newsap.m.shell(“shell”,{app:this.app})代码>其中this.app
是我的SplitApp这是结果。如何查看条形图上的元素?(注销、搜索、用户..)如果我添加this.shell.setShowLogout(true).setHeaderRightText('test').setShowLogout(true).setTitle('title')代码>我有相同的结果。在sap_bluecrystal主题中,外壳标题默认隐藏。只有徽标在大屏幕上可见(内容左侧)。搜索class.sapMShellHeader。在那里你可以找到标题和注销,但它是隐藏的。你必须自己设计:我的根应用程序(this.app)是一个SplitApp@cschuff我更改链接该链接与sap.ui.unified.Shell有关,您的代码显示一个sap.m.Shell。你在用什么?我写:this.shell=newsap.m.shell(“shell”,{app:this.app})代码>其中this.app
是我的SplitApp这是结果。如何查看条形图上的元素?(注销、搜索、用户..)如果我添加this.shell.setShowLogout(true).setHeaderRightText('test').setShowLogout(true).setTitle('title')代码>我有相同的结果。在sap_bluecrystal主题中,外壳标题默认隐藏。只有徽标在大屏幕上可见(内容左侧)。搜索class.sapMShellHeader。在那里你可以找到标题和注销,但它是隐藏的。你必须自己设计:我的根应用程序(this.app)是一个SplitApp@cschuff我更改链接该链接与sap.ui.unified.Shell有关,您的代码显示一个sap.m.Shell。你在用什么?我写:this.shell=newsap.m.shell(“shell”,{app:this.app})代码>其中this.app
是我的SplitApp这是结果。如何查看条形图上的元素?(注销、搜索、用户..)如果我添加this.shell.setShowLogout(true).setHeaderRightText('test').setShowLogout(true).setTitle('title')代码>我有相同的结果。在sap_bluecrystal主题中,外壳标题默认隐藏。只有徽标在大屏幕上可见(内容左侧)。搜索class.sapMShellHeader。在那里你可以找到标题和注销,但它是隐藏的。你必须自己设计:我的根应用程序(this.app)是一个SplitApp@cschuff我更改链接该链接与sap.ui.unified.Shell有关,您的代码显示一个sap.m.Shell。你在用什么?我写:this.shell=newsap.m.shell(“shell”,{app:this.app})代码>其中this.app
是我的SplitApp这是结果。如何查看条形图上的元素