View Full Version : Is there any other way to do this ?

Nicolas BUI
22 Oct 2010, 3:41 AM
I've just encounter a strange things (bug or not?). After few hours reading API and testing, I've found an alternative solution, so I'm not fully satisfied as I want a clean base configuration.
Can you tell me you if there is a better alternative ?

Here is my problems, let start with me component tree

Window (borderlayout)

TreeGrid (A, east)
Grid (B, center)
Panel (C, south, borderlayout)

TabPanel(D, west)


TabPanel(E, center)

1: Panel (F, layout column)

Fieldset 1 (J)


Fieldset 2 (H)


2: Panel (I)


1/ The main window start normally with Panel (C) collapsed.
2/ When clicked on a row of the Grid, the Panel (C) is expanded so thetwo TabPanel side-by-side is visible.
3/ On my Tabpanel (E), the first item is activated (by configuring activeTab config).
4/ the Panel (F) simply not visible (height and Width are 0) or incorrectly positionned (bas size). Until I resize the main south panel (manually with my mouse). So the panel couldn't compute the size as it's hidden....

So, my current is pretty simple, but it worked, I have to catch an "event" :
1/ first I will not set the activeTab config
2/ Then on the main Window, I'm watching for the even named "expand".
3/ On the event, I do "tab.setActiveTab(..)"

Is there any solution without using event to do the trick ?

My other question or suggestion is : With the BorderLayout, when the container fire the event "expand", I still don't know which pan has been expanded (north ? south ?). It would be nice to know it to force event propagation huh ?

Nicolas BUI

Best regards

22 Oct 2010, 4:39 AM
No quick answer.

But regarding the 'expand' event question:
The region panels fire the expand event, not the border layout container. So if you want to know when the south regions expands, just attach an expand listener to THAT panel.