I am getting similiar behaviour using GWT 2.0.
In my case I use buttons to switch between an inner I-Frame.
I put a check in the onClick methods to not write a newItem to History
if the the old token matches the new token.

As a result I only have to push the back button twice now instead of
three times.
I think what is happening is that when a button is pressed, and the
new I-Frame is
loaded, the token is written twice to the stack.  So the first time
you press the back
button there is no change in the token value so the onValueChanged (or
onHistoryChanged)
does not get called.



On Feb 8, 11:35 am, AM <[email protected]> wrote:
> Hi Obsega - my company has bought the licenses for Ext-GWT 1.0 - which
> is not compatible with GWT2.0. To upgrade to GWT2.0, we'd have to
> upgrade our ExtGWT licenses to ExtGWT3.0 - and since I am the only one
> using this toolkit now and need this upgrade only for theHistory
> functionality, I am not very optimistic if we'd be upgrading the
> ExtGWT licenses :-(
>
> I know its annoying to ask questions about an older version - but I
> have no other option in this case. Anyone .. any clues what might be
> going on??
>
> Thanks!
>
> On Feb 8, 9:39 am, obesga <[email protected]> wrote:
>
>
>
> > Quick response: in GWT2.0, use
>
> >History.addValueChangeHandler(ValueChangeHandler<java.lang.String>
> > handler)
>
> > that is not deprecated
>
> > Try use
> >History.newItem("page" + tabIndex,false);
>
> > to avoid firing event, this may be the cause
>
> > Hope that helps
>
> > Oscar
>
> > On Feb 7, 9:19 am, AM <[email protected]> wrote:
>
> > > Hi,
> > > I am running into this weird issue where the onHistoryChanged() isn't
> > > being called when I hit the browser's back button or even if I call
> > >History.back(). I am testing this in the hosted mode (even running it
> > > in firefox yields me the same result). The strange thing is, if I call
> > >History.back() thrice - looks like it calls onHistoryChanged() on the
> > > third request - it is quite confusing and I was hoping if someone
> > > could shed some light on this issue that I am running into.
>
> > > I am using GWT 1.5 and to demonstrate my case, I'll use the example in
> > > the GWT-1.5 tutorial (http://preview.tinyurl.com/6grjh2)
>
> > > // Excluding imports for brevity
>
> > > // Entry point classes define <code>onModuleLoad()</code>.
> > > public class BrowserHistoryExample implements EntryPoint {
>
> > >   TabPanel tabPanel;
>
> > >   public void onModuleLoad() {
>
> > >     tabPanel = new TabPanel();
>
> > >     int tabIndex = 0;
>
> > >     // A Ext-GWT ContentPanel
> > > (com.extjs.gxt.ui.client.widget.ContentPanel)
> > >     ContentPanel cp = new ContentPanel();
> > >     cp.addText("Page1");
> > >     tabPanel.add(cp, "Page1");
>
> > >     cp = new ContentPanel();
> > >     cp.addText("Page2");
> > >     tabPanel.add(cp, "Page2");
>
> > >     Button backButton = new Button("Back");
> > >     backButton.addClickListener(new ClickListener () {
>
> > >                 public void onClick(Widget arg0) {
> > >                     System.out.println("Going back now ...");
>
> > >                    History.back();
>
> > >                     // Commenting this for now ...
> > >                     // but on un-commenting, the third call to
> > >History.back() seems to invoke onHistoryChanged()
> > >                     //History.back();
> > >                     //History.back();
> > >                 }
> > >     });
> > >     cp = new ContentPanel();
> > >     cp.addText("Page3");
> > >     cp.add(backButton);
> > >     tabPanel.add(cp, "Page3");
>
> > >     tabPanel.addTabListener(new TabListener() {
>
> > >       public boolean onBeforeTabSelected(SourcesTabEvents sender, int
> > > tabIndex) {
> > >         return true;
> > >       }
>
> > >       public void onTabSelected(SourcesTabEvents sender, int tabIndex)
> > > {
> > >           // Push an item onto thehistorystack
> > >           System.out.println("Pushing tabIndex: " + tabIndex + " on the
> > > stack");
> > >          History.newItem("page" + tabIndex);
> > >       }
> > >     });
>
> > >    History.addHistoryListener(new HistoryListener() {
>
> > >       public void onHistoryChanged(String historyToken) {
>
> > >           System.out.println("Got token: " + historyToken);
>
> > >         // Parse thehistorytoken
> > >         try {
> > >           if (historyToken.substring(0, 4).equals("page")) {
> > >             String tabIndexToken = historyToken.substring(4, 5);
> > >             int tabIndex = Integer.parseInt(tabIndexToken);
> > >             // Select the specified tab panel
> > >             tabPanel.selectTab(tabIndex);
> > >           } else {
> > >             tabPanel.selectTab(0);
> > >           }
>
> > >         } catch (IndexOutOfBoundsException e) {
> > >           tabPanel.selectTab(0);
> > >         }
> > >       }
> > >     });
>
> > >     tabPanel.selectTab(0);
> > >     RootPanel.get().add(tabPanel);
> > >   }
>
> > > }
>
> > > So the thing is, when I navigate from Page1 tab to Page2 tab to Page3
> > > tab - and then when I hit the "back" button (defined above, which
> > > simply callsHistory.back()) - nothing really happens for the first 2
> > > times I hit the button. Only when I hit it the third time (or
> > > alternatively callHistory.back() thrice in the buttonClick event) -
> > > is the onHistoryChanged() method invoked.
>
> > > Again, it would be great if someone could help me figure out whats
> > > going on?
>
> > > Thanks!- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to