如何在移动控件中应用深度链接

发布于 2025-01-07 12:41:15 字数 1361 浏览 2 评论 0原文

我正在尝试在最近的扩展库中使用移动控件。我已经设置了基本结构并且它似乎正在工作。但是,当我导航到某个页面时,我没有看到末尾带有页面名称的#。当我点击后退按钮时,我确实得到了“#home”应用。

如何将 # 应用于各个页面,以便在浏览器发出完全刷新或有人想要进行深层链接时它们会保留?

谢谢!

<xe:singlePageApp id="singlePageApp1"
    selectedPageName="home">
    <xe:appPage id="home" pageName="home">
        <xe:djxmHeading id="djxmHeading0"
            label="My Home Page">
        </xe:djxmHeading>
        <xe:djxmLineItem id="djxmLineItem3" label="Sell Items"
            moveTo="mobilePage1">

        </xe:djxmLineItem>
        <xe:djxmLineItem id="djxmLineItem4" label="Sold Items"
                moveTo="mobilePage2">
            </xe:djxmLineItem>
    </xe:appPage>
    <xe:appPage id="appPage1" pageName="mobilePage1"
        autoCreate="true">
        <xe:djxmHeading id="djxmHeading1" label="Sell an Item"
            moveTo="home" back="Back">
        </xe:djxmHeading>
        <xc:cc_SellItem></xc:cc_SellItem>
    </xe:appPage>
    <xe:appPage id="appPage2" pageName="mobilePage2">
        <xe:djxmHeading id="djxmHeading2" moveTo="home" back="Back"
            label="Sold Items">
        </xe:djxmHeading>

        <xp:panel>List of Sold Items will go here.</xp:panel></xe:appPage>
    </xe:singlePageApp>

I'm trying to use mobile controls in a recent extension library. I've setup the basic structure and it seems to be working. However when I navigate to a page I don't get a # with the page name applied to the end. When I hit the back button I DO get a "#home" applied.

How do get the # to apply to the indivudal pages so they will stick if a full refresh is issued from the browser or someone wants to do deep linking?

Thanks!

<xe:singlePageApp id="singlePageApp1"
    selectedPageName="home">
    <xe:appPage id="home" pageName="home">
        <xe:djxmHeading id="djxmHeading0"
            label="My Home Page">
        </xe:djxmHeading>
        <xe:djxmLineItem id="djxmLineItem3" label="Sell Items"
            moveTo="mobilePage1">

        </xe:djxmLineItem>
        <xe:djxmLineItem id="djxmLineItem4" label="Sold Items"
                moveTo="mobilePage2">
            </xe:djxmLineItem>
    </xe:appPage>
    <xe:appPage id="appPage1" pageName="mobilePage1"
        autoCreate="true">
        <xe:djxmHeading id="djxmHeading1" label="Sell an Item"
            moveTo="home" back="Back">
        </xe:djxmHeading>
        <xc:cc_SellItem></xc:cc_SellItem>
    </xe:appPage>
    <xe:appPage id="appPage2" pageName="mobilePage2">
        <xe:djxmHeading id="djxmHeading2" moveTo="home" back="Back"
            label="Sold Items">
        </xe:djxmHeading>

        <xp:panel>List of Sold Items will go here.</xp:panel></xe:appPage>
    </xe:singlePageApp>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

魔法少女 2025-01-14 12:41:15

您只需在 moveTo 属性中的页面名称中添加哈希 (#) 前缀即可:

<xe:djxmLineItem id="djxmLineItem3" label="Sell Items" moveTo="#mobilePage1"></xe:djxmLineItem>
<xe:djxmLineItem id="djxmLineItem4" label="Sold Items" moveTo="#mobilePage2"></xe:djxmLineItem>

查看 XPages 移动控件教程中的“moveTo 属性”

You just need to add the hash (#) prefix to the page name in the moveTo property:

<xe:djxmLineItem id="djxmLineItem3" label="Sell Items" moveTo="#mobilePage1"></xe:djxmLineItem>
<xe:djxmLineItem id="djxmLineItem4" label="Sold Items" moveTo="#mobilePage2"></xe:djxmLineItem>

Have a look at "The moveTo property" in the XPages Mobile Controls Tutorial.

蘸点软妹酱 2025-01-14 12:41:15

扩展库还包括动态内容组件。该组件有一个 useHash 属性,它引用 URL 中的 #。这应该允许您根据哈希值指定加载应用程序的哪一部分。

The Extension Library also includes a Dynamic Content component. This component has a useHash property, which refers to the # in the URL. This should allow you to specify which portion of the app is loaded based on the hash value.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文