• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Two GWT HistoryListeners on Two Panels - which one handles the history change?

 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have two panels, a main ScreenManager and a subpanel with a CardLayout. Both implement Google Web Toolkits HistoryListener/AvalueChangeHandler.

When a card in the deck changes, I only want the subpanel with the CardLayout to handle that change. But, will the event get fired to the ScreenManger as well, since both are registered as HistoryListener classes? If so, can I capture the HistoryChanged event in the onHistoryChanged method of the subpanel?

That darned backbutton is a real pain!

-Cameron McKenzie
 
Cameron Wallace McKenzie
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So, I thought this was going to be a bigger problem than it was, largely because I was mislead by the GWT-EXT showcase that has a cardlayout, but the layout does not seem to support the back button.

This app has the same layout - PanelManager and sub-panels. I found that all I needed to do was manage the CardLayout normally in the subpanel, and have the ScreenManager simply redisplay the CardLayout panel through the History. A small change in the CardLayoutSample of the GWT-EXT sample, History.newItem("cardLayout");, allows the whole thing to work:



It's a quick fix. Obvoiusly the call isn't needed in all of those places, just once at the end of the method, but you get the idea. Now the ShowCase example supports the back button on the CardLayout. Now to apply it to my own application!

-Cameron McKenzie
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic