PDA

View Full Version : GXT 3.0 - oddity with using TopBottomComponent in a Viewport?



jvahabzadeh
4 Nov 2011, 9:46 AM
All,

I'm trying to do a prototype of something akin to a full-screen application in GXT 3.0 (yes, I realize it's early to do this, but it's more a proof of concept thing), but I'm running into a little unexpected behavior.

I have a Viewport (ok, the temporary workaround version CustomViewport as described in http://www.sencha.com/forum/showthread.php?151548-Viewport-bug), and it is attached to the RootPanel.

Within this Viewport I have a TopBottomComponent. For the TopBottomComponent:
1) The top widget is a MenuBar
2) The bottom widget is a FlowLayoutContainer
3) The widget is a ContentPanel

Each of the menu items will, when clicked, open a new Window.

When I minimize the Window, I call hide() on it, then create a TextButton and add it to the FlowLayoutContainer I mentioned in #2 above.

In a way, the FlowLayoutContainer is acting somewhat like the MS Windows taskbar.

Initially, when there are no TextButtons in the FlowLayoutContainer, the latter has a height of 0. That's just fine.

However, when I minimize some windows, thus adding TextButtons to the FlowLayoutContainer, it does not resize to allow the TextButtons to be visible UNLESS I resize the browser window. This happens in Firefox 5 as well as IE 8. I have not tried with any other browsers.

If I continue to add more until a second row of TextButtons is created, again, the height doesn't resize until I adjust the browser window size.

Conversely, if I restore the Windows by clicking on the TextButton (and thus removing them from the FlowLayoutContainer), when fewer rows (or none) are needed, the FlowLayoutContainer's height will not shrink unless I resize the browser window.

It almost seems as if some sort of refresh or update is not occurring until I change the browser window size.

Is this a bug? Or is there some method I should be calling on that FlowLayoutContainer every time I add or remove a TextButton?

Thanks in advance.

sven
4 Nov 2011, 9:50 AM
However, when I minimize some windows, thus adding TextButtons to the FlowLayoutContainer, it does not resize to allow the TextButtons to be visible UNLESS I resize the browser window. This happens in Firefox 5 as well as IE 8. I have not tried with any other browsers.

This is the expected behaviour. You need to call forceLayout on your TopBottomComponent after adding something into the FlowLayoutContainer.

jvahabzadeh
4 Nov 2011, 11:13 AM
How can this be done? TopBottomComponent itself does not have the forceLayout() method, nor do its super classes.

sven
4 Nov 2011, 11:49 AM
You are correct. This is an issue. I will come back to you once this is fixed.

jvahabzadeh
4 Nov 2011, 12:38 PM
I appreciate it, thanks!