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?
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!
what if we put solar panels on top of the semi truck trailer? That could power this tiny ad: