View Full Version : Re-Layout problem when showing cached components

21 Mar 2011, 6:14 AM

I use Ext GWT 2.1.1 and I have an application with a layout which basically is composed by a BorderLayout, with some fields in the NORTH, a FitLayout container with a grid in the CENTER and a HBoxLayout with some buttons in the SOUTH.

This set of components fills the screen and resizes automatically as expected. But in one especific situation I have the following problem:

I need to navigate to other screen and then I want to cache the components I mentioned in a Singleton to use them again. Once I want to come back to the previous screen I retrieve the singleton to show the components as they were. The problem is that when I do it (display the cached components from the singleton) and I've had resized the second screen (the one which is not cached), some problems on the layout appears. For example, the grid in the CENTER uses the space of the buttons in the SOUTH.

I tried to call layout(true) in the parent component when loading the screen but it does not work properly. The only solution I found was to instantiate all the components again instead of using the singleton.

I would like to know if I'm doing anything wrong when trying to show those previously cached components.

Thank you in advance