简体   繁体   English

GWT多个独立入口点

[英]GWT Multiple Independent Entry Points

I"m working on a GWT application that has three different areas (top nav bar, content pane, and bottom panel) on the page that are more or less independent of each other. One area is updated based on the action from the other area; for example, clicking on a link at the top nav bar will update the content area with the relevant info. The bottom panel is totally independent of the others and only updates itself upon some server push. 我正在GWT应用程序上工作,该应用程序在页面上具有彼此不同的三个不同区域(顶部导航栏,内容窗格和底部面板)。一个区域根据另一个区域的操作进行更新;例如,单击顶部导航栏上的链接将使用相关信息更新内容区域;底部面板完全独立于其他区域,并且仅在某些服务器推送时才进行更新。

I'm thinking of having three modules or three entry points in one module for these three areas. 我正在考虑针对这三个领域在一个模块中包含三个模块或三个入口点。 The problem I'm facing is "how can I refresh only the content pane while at the same time supporting history stack?" 我面临的问题是“如何在支持历史记录堆栈的同时仅刷新内容窗格?” It's probably similar to Gmail app: clicking on Inbox or Sent only refreshes the list of emails but not the other parts of the screen. 它可能类似于Gmail应用程序:单击“收件箱”或“已发送”仅刷新电子邮件列表,而不刷新屏幕的其他部分。

I know I can easily do the refresh part in JavaScript. 我知道我可以轻松地完成JavaScript中的刷新部分。 My concern is how to support the history stack. 我关心的是如何支持历史记录堆栈。 Thanks! 谢谢!

Did you take a look at the Activities and Places framework? 您是否看过“ 活动和地点”框架? This approach totally solves your problem while taking care of the history stack for you. 这种方法完全可以解决您的问题,同时为您处理历史记录堆栈。

In short, you only need a single entry point. 简而言之,您只需要一个入口点。 Your application would be divded into three display areas. 您的应用程序将分为三个显示区域。 And each display area is a container for an "Activity" where the activity decides what gets displayed. 每个显示区域都是“活动”的容器,其中活动决定要显示的内容。

If you click on a link in the nav bar you go to a new "Place" which might update the Activity in the content pane or even start a different Activity there (eg going from Inbox to Outbox will discard InboxActivity and start an OutboxActivity). 如果单击导航栏中的链接,则转到一个新的“位置”,该位置可能会更新内容窗格中的“活动”,甚至在那里启动另一个活动(例如,从“收件箱”转到“发件箱”将丢弃InboxActivity并启动OutboxActivity)。 Going to a new place will also update the URL and thus handle the back button. 转到新位置也会更新URL,从而处理后退按钮。

This will make more sense to you if read the documentation and maybe this article . 如果阅读文档以及本文对您来说将更有意义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM