gpt4 book ai didi

javascript - 在带有 VBox-SAP UI5 的 Javascript View 中使用 "href"

转载 作者:行者123 更新时间:2023-11-28 02:36:43 25 4
gpt4 key购买 nike

我正在尝试从我的 SAP UI-5 应用程序导航到其他页面。 (HTML 的 < a href /> )

我用了sap.m.Link在我的工具栏上导航到其他页面,而且效果很好;

new sap.m.Link(this.createId("Foo"),{ 
text: "Foo",
type: "Transparent",
href: myLink
}).addStyleClass("headerLink"),

但是我正在使用 VBoxcustomTile我有文字的地方。我想对我的 VBox 实现相同的功能还有。我该怎么做 ?

请注意我不能使用 window.location.replace("http://mywebsite.com/nextPage.html");因为它不允许我返回到我访问过的最后一页。

我的 customTile看起来像这样

var iconBox1 = new sap.m.VBox({
items: [
new sap.m.HBox({
items: [
new sap.m.Text({
text: "Foo" // I want to navigate after clicking on this Text or this Box generelly
}).addStyleClass("tileTextDashboard")
]
}).addStyleClass("textNumberConatainer")
]
});


var customTile1 = new sap.m.CustomTile(this.createId("tile1"), {
content: [
iconBox1
],
press: [oController.someFunction, oController]
}).addStyleClass("customTileDashboard");

最佳答案

编辑:问题解决了!

如果有人遇到同样的问题,我将添加我的解决方案:

var myLink= "https://foo.com";
var myLinkO= new sap.m.Link({
text: "text foo",
type: "Transparent",
href: myLink
}).addStyleClass("classFoo");

现在您只需要替换 VBox 中的 items 数组中的 myLinkO

关于javascript - 在带有 VBox-SAP UI5 的 Javascript View 中使用 "href",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46825287/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com