• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

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

 
author and cow tipper
Posts: 5000
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • 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: 5000
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
 
what if we put solar panels on top of the semi truck trailer? That could power this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!