首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >VBox UI5在Javascript视图中使用"href“

VBox UI5在Javascript视图中使用"href“
EN

Stack Overflow用户
提问于 2017-10-19 08:07:35
回答 1查看 558关注 0票数 2

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

我使用工具栏上的sap.m.Link导航到其他页面,它工作得很好;

代码语言:javascript
复制
new sap.m.Link(this.createId("Foo"),{ 
                text: "Foo",
                type: "Transparent",
                href: myLink
            }).addStyleClass("headerLink"),

但是,在有文本的customTile中,我使用的是customTile。我也想对我的VBox实现同样的功能。我该怎么做呢?

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

我的customTile看起来像这样

代码语言:javascript
复制
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");
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-10-19 12:39:35

编辑:问题解决了!

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

代码语言:javascript
复制
var myLink= "https://foo.com";
var myLinkO= new sap.m.Link({
        text: "text foo",
        type: "Transparent",
        href: myLink
    }).addStyleClass("classFoo");

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46825287

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档