hugoloza / gwt-platform

Automatically exported from code.google.com/p/gwt-platform
0 stars 0 forks source link

PlaceManager.onValueChange creates a duplicate history entry #404

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The default place manager ends up creating two history events when the browser 
url is updated externally (e.g. via a bookmark).  The doRevealPlace called by 
onValueChange should not update the browser url since it is being notifier of a 
change that just happened.

The symptom is that the browser 'back' button cannot navigate back beyond the 
first page load.  Looking at the browser history (e.g. in chrome by holding 
down the back button) shows two entries with the same value.  Manually going 
back 2 entries has the desired effect.

Below is a patch that addresses the issue:

--- src/main/java/com/gwtplatform/mvp/client/proxy/PlaceManagerImpl.java 
+++ src/main/java/com/gwtplatform/mvp/client/proxy/PlaceManagerImpl.java.new
@@ -264,7 +264,7 @@
         revealDefaultPlace();
       } else {
         placeHierarchy = tokenFormatter.toPlaceRequestHierarchy(historyToken);
-        doRevealPlace(getCurrentPlaceRequest(), true);
+                doRevealPlace(getCurrentPlaceRequest(), false);
       }
     } catch (TokenFormatException e) {
       unlock();

Original issue reported on code.google.com by snstan...@gmail.com on 24 Feb 2012 at 4:10

GoogleCodeExporter commented 9 years ago
This looks like an easy fix. Will it make it into 2.5 Final ?

Original comment by atifsyed...@gmail.com on 22 Jul 2012 at 9:26