Hi Thomas,
Thanks for your response.
I am not using MVP .I am not using PlaceController . So I only relay on History.addValueChangeHandler.
What problem I am facing is ...
In GWT have History ,HistoryImpl classes.
HistoryImpl class have newItem() , newItemOnEvent() these two final methods will change the $wnd.location.hash value when we click on browser back button.
Moreover, GWT have different HistoryImpl classes for browser specific and contain native methods to update the $wnd.location.hash .
Like under package com.google.gwt.user.client.impl
HistoryImpl
HistoryImplIE6
HistoryImplMozilla
HistoryImplSafari
HistoryImplTimer
For Example : In Mozilla browser , if I click on browser back button,control is going to HistoryImplMozilla (see below GWT implementation in History.gwt.xml) and change the the browser URL in "nativeUpdate" method and then control will come to History.addValueChangeHandler (onValueChange()) at this time the browser URL already modified and difficult to get the original URL from here.
History.gwt.xml
<!-- Mozilla has a slightly different history implementation than the -->
<!-- standard case. -->
<replace-with class="com.google.gwt.user.client.impl.HistoryImplMozilla">
<when-type-is class="com.google.gwt.user.client.impl.HistoryImpl"/>
<any>
<when-property-is name="user.agent" value="gecko1_8"/>
<when-property-is name="user.agent" value="gecko"/>
</any>
</replace-with>
How to show the alert message in this time ? in Alert message if user clicks to NO button means wants to stay in same page then its difficult to get the original URL . because original URL already modified.
In which place is suitable for showing Alert message to the user if form is dirty and clicks on browser back button.
Its difficult to customize the HistoryImpl class for newItem() , newItemOnEvent() these are final methods can't over ride in sub classes. If i do that (copy entire class and done the customize) I need to customize History ,HistoryImpl ,HistoryImplIE6,HistoryImplMozilla , HistoryImplSafari ,HistoryImplTimer.
Can you please suggest the best way to handle this problem ?
Thanks