如何在 jsf 2.0 中创建选项卡行为

发布于 2024-11-04 05:18:52 字数 297 浏览 0 评论 0原文

这是一个简单的问题,到目前为止我还不知道如何以最好的方式去做。 我正在开始一个新项目,所以我仍然有些灵活性。

JSF 2.0,Facelets是受欢迎的(虽然我才刚刚开始学习什么是facelets),无论你推荐什么核心技术,我都会考虑。 它也应该适用于 IE6(但如果有一个真正足够的解决方案不适用于 IE6,请告诉我)

如何在 Web 应用程序中创建类似选项卡的行为? (我猜最好的例子是 Gmail,其中侧边栏可以更改内容而无需刷新页面)。

无需赘述,我只是在寻找其背后的技术以及指向正确方向的手指。

谢谢你!

Simple question that I couldn't figure out how to do so far in the best way.
I'm starting a new project so I'm still somewhat flexible.

JSF 2.0, Facelets are welcome (Although I'm just starting to learn what facelets are), whatever core technology you recommend, I will consider.
It should also work on IE6 (But if there is a really adequate solution that doesn't work on IE6, let me know)

How Do I create a Tab-Like behaviour in a webapp? (The best example would be Gmail, I guess, where the sidebar changes the contents without refreshing the page).

No need to go into details, I'm just looking for the technology behind it and a finger pointing in the right direction.

Thank you!

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

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

发布评论

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

评论(3

放肆 2024-11-11 05:19:08

知道我知识渊博,我使用 jQuery BBQ 插件和 AJAX。

使用此链接查看完整的解决方案:

从网络应用程序更新网址栏以表示当前状态

IE6/7后退/前进按钮不更改window.location .哈希

Know That I Am more knowlegdable I use the jQuery BBQ plugin with AJAX.

Use this links to see the full solution:

Updating the url bar from the webapp to represent the current state

IE6/7 Back/Forward button don't change window.location.hash

半城柳色半声笛 2024-11-11 05:19:07

如果您想“自己做”,您可以使用 f:ajax 标签。这需要三个参数:

  • event:触发 ajax 更新的内容。在您的情况下,当您单击某些内容时,例如带有选项卡名称的锚点。
  • 侦听器:事件发生时对托管 bean 执行操作。您的操作将根据用户单击的内容确定当前正在显示哪个选项卡。您的 UI 将使用该信息来确定要渲染的内容。
  • render:将重新显示的组件的 id。这应该是选项卡控件本身,可以是页面上的 panelGroup 或 panelGrid。这决定了页面的哪一部分将被重绘。您将在此处拥有所有选项卡的 UI 逻辑,但将它们配置为仅在它们是当前选择时才呈现。

Richfaces、Primefaces 和 Icefaces 组件库都有您可以使用的解决方案。

If you want to "do it yourself," you would use the f:ajax tag. This takes three parameters:

  • event: what triggers the ajax update. In your case, it would be when you click on something, such as an anchor with the tab name.
  • listener: executes an action on a managed bean when the event occurs. Your action would figure out which tab is currently being displayed based on what the user clicked on. Your UI would use that information to determine what to render.
  • render: an id for a component that will be redisplayed. This should be the tab control itself, which could be a panelGroup or panelGrid on the page. This determines which part of the page will be redrawn. You would have the UI logic for all of your tabs here, but configure them to render only if they are the current selection.

The Richfaces, Primefaces, and Icefaces component libraries all have solutions you could use as well.

始终不够 2024-11-11 05:19:07

Primefaces Tabview 组件怎么样。 Primefaces 是一个基于 JSF 2.0 的组件库。 (从未在 IE6 上尝试过。我建议在 IE6 中尝试给定的示例)

How about Primefaces Tabview component. Primefaces is a component library based on JSF 2.0. (Never tried it on IE6. I'd suggest to try the given examples in IE6)

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