• 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
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

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
 
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
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!