Looking for input on GWT / MVP action w/o browser history change

Posted by user198313 on Stack Overflow See other posts from Stack Overflow or by user198313
Published on 2010-04-13T23:17:49Z Indexed on 2010/04/13 23:23 UTC
Read the original article Hit count: 554

Filed under:
|
|

Hello there,

I am trying to develop a GWT app with the MVP pattern. So far so good except for one specific case of actions: actions that do not change the url (no browser history change).

In the GWT MVP pattern, events are sent from presenters, the an app controller catches them and update the browser history. If the history has changed then the view updates.

** MVP with history change (Works well)**

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 pattern for dialog box w/o history changes

** Issue ** - I use a dialog box and I don't want to change the browser history, so here is the problem:

  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

Question: does anyone know a pattern to implement this in the context of MVP?

Any help / idea appreciated.

© Stack Overflow or respective owner

Related posts about gwt

Related posts about mvp