为 GWT 页面制作目录表。类似于维基百科有

发布于 2024-10-03 16:09:25 字数 178 浏览 0 评论 0原文

如何为 GWT 页面制作目录表,以便添加书签和直接跳转到动态页面的某个小节。

我的网络应用程序的地址类似于,
www.example.com/WebApp#param1=value1&param2=value2

此链接显示一个包含许多小节的页面,我想为用户提供能够直接添加书签和加载小节的功能。

How to make Contents table for a GWT page, for the purpose of bookmarking and direct jump to a subsection of a dynamic page.

Address for my webApplication is like,
www.example.com/WebApp#param1=value1¶m2=value2

This link displays a page with many subsections, i want to provide feature for users to be able to bookmark and load subsections directly.

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

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

发布评论

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

评论(1

蒲公英的约定 2024-10-10 16:09:25

您可以使用 History 类来访问 # 后的 URL 并做出相应的反应。它效果非常好,并且是解决此问题的官方推荐方法。

简短教程:http://www.bluecoders.com/tutorials/gwthistory.html

基本上,History 是一个静态类,您可以在其上调用 addValueChangeHandler 来注册一个应处理任何历史更改的对象。当用户使用浏览器中的后退和前进按钮时,这支持直接链接(例如书签)以及正确的导航。

You can use the History class to get access to the URL after the # and react accordingly. It works really well, and is the officially recommended way of solving this problem.

A short tutorial: http://www.bluecoders.com/tutorials/gwthistory.html

Basically, History is a static class on which you can call addValueChangeHandler to register an object that should deal with any history changes. This supports direct linking (e.g. bookmarks) and also proper navigation when the user uses the back and forward buttons in the browser.

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