正在查找有关GWT/MVP操作的输入,无浏览器历史记录更改

正在查找有关GWT/MVP操作的输入,无浏览器历史记录更改,gwt,mvp,gwt-mvp,gwt-history,Gwt,Mvp,Gwt Mvp,Gwt History,我正在尝试开发一个具有MVP模式的GWT应用程序。到目前为止,除了一种特定的操作外,其他都很好:不更改url的操作不更改浏览器历史记录 在GWT MVP模式中,事件由演示者发送,应用程序控制器捕获事件并更新浏览器历史记录。如果历史记录已更改,则视图将更新 **有历史变化的MVP运行良好** Current URL is /list User clicks on contactdelete button. Fire DeleteContactAction event. App controller

我正在尝试开发一个具有MVP模式的GWT应用程序。到目前为止,除了一种特定的操作外,其他都很好:不更改url的操作不更改浏览器历史记录

在GWT MVP模式中,事件由演示者发送,应用程序控制器捕获事件并更新浏览器历史记录。如果历史记录已更改,则视图将更新

**有历史变化的MVP运行良好**

Current URL is /list
User clicks on contactdelete button.
Fire DeleteContactAction event.
App controller catches, change history to 'delete'
onValueChange is called
if (token.equals("delete")) 
delete contact screen, then delete contact
Fire ContactDeletedEvent 
app controller catches and change the history to list 
onValueChange is called: contact list refreshes
不更改历史记录的对话框的GWT MVP模式

**问题**-我使用一个对话框,不想更改浏览器历史记录,因此问题出在这里:

  Current URL is /list
  User clicks on contactdelete button.
  Contact is deleted
  Fire ContactDeletedEvent.
  App controller catches, change history to 'list'
  **onValueChange is NOT called** because url is already /list and there is no change
  # problem: contact list does not refresh
问:有人知道在MVP环境中实现这一点的模式吗


非常感谢您的帮助/想法。

除了GWT之外,您是否使用了自动更改历史的框架

常规GWT/MVP不需要更改历史记录,事实上,通常由应用程序自己更新历史记录


如果要在不更改历史记录的情况下更新应用程序的状态,可以使用EventBus发布应用程序其他元素可以订阅的事件,以在不更改历史记录的情况下更新应用程序的状态。

基本上,您必须创建自己的PlaceHistoryHandler。您的自定义PlaceHistoryHandler将忽略特定类型的PlaceChangeEvent,即它不会更新其历史记录。

我在这里使用教程中的示例:在本例中,事件由appcontroller收集,appcontroller更改浏览器历史记录以触发处理。我试图保持appcontroller中事件的集中化,但试图避免*此事件的处理方式如下:使用历史记录更改*此事件的处理方式如下:不使用历史记录更改。明白我的意思了吗?好吧,与其让AppController收集事件并触发历史记录更改,不如让应用程序的其他部分监听相关事件本身。GWT MVP开发的另一个好框架是GWT presenter,它是积极开发的,与此示例框架不同。我可以问你为什么要这样做的更多背景吗?