View Full Version : [FNR] Problems with RowLayout

15 Mar 2011, 10:18 AM
I believe it's a bug because it started after upgrade from GXT 2.1.1 to 2.2.3.

I'm having a layout problem with this combination of components (the indentation indicates parent/child relationship):

Window (FitLayout)
ContentPanel (RowLayout and a ToolBar as top component)
ContentPanel (any layout, RowData(1, -1) to use components height)
Grid (RowData(1, 1) to fill space left in the parent panel

The problem is the grid height isn't beeing expanded to fill the parent's ContentPanel space left. I had to force height on the grid (100%) or else the rows doesn't show, but still the vertical space is filled only after a window resize.

I didn't test using another components.

I'm sending three attachments.

1. The window screenshot in version 2.1.1
2. Same window screenshot in version 2.2.3
3. A sample code to reproduce the problem.

Nothing was changed in my code, except GXT version, and from that upgrade the problem started.

More information:
Executing in host mode
Google Chrome 8.0.552.237
Windows 7
GWT 2.2.0

I apologise if I'm wrong. Thanx.

15 Mar 2011, 10:22 AM
Forgot to send the attachments.

21 Mar 2011, 12:35 PM

21 Mar 2011, 10:37 PM
Try to call layout(true) after showing the window

22 Mar 2011, 3:55 AM
I did it by adding a WindowListener to the window and it worked. But seems to me this is just a workaround, not an actual fix, since I will have to add an WindowListener to all my windows using RowLayout.

First, is this the only solution?
Second, is this I reported a real bug?
Should I expect for a correction or use this workaround from now on?

22 Mar 2011, 7:29 AM
I agree, this is annoying.. :s

10 Apr 2011, 7:06 PM
This affects every RowLayout we have in a window (and we have many).

I upgraded from 2.1.3 to 2.2.3 and RowLayout fails to work. It is caused by the rev 2183. You can replace the RowLayout class with a version in 2.1 or 2.1.3.

As this breaks our application layout I'm going to raise it via support.

10 Apr 2011, 11:50 PM
I'm affected by this bug too.

14 Apr 2011, 3:36 PM
So the support response so far is that this change was made due to "a bug with hidden items". (I don't know what that bug is, or what it's impact is).

The suggested solutions are:

1: Call layout(true) on the window after showing it
2: Roll back to the old version of RowLayout (be aware of the "hidden" bug)
3: Override the window class show() method to call this.layout(true) at the end.

I really think this bug should be addressed as it has compromised the Rowlayout should work.

Update: Sencha told me the "hidden items fix" was done because "The row layout did not always size the the panels in the rowlayout correctly if some of them where hidden."

Also option 1 and 3 above may cause so performance issues it you have complex windows.

15 Apr 2011, 4:10 AM
Did they give you some indication that this bug will be solved in future releases? I don't think it's nice to be forcedto apply a workaround everytime I need to use RowLayout, unless they say "this is it".

28 Apr 2011, 3:53 PM
One of the support guys agreed that it's a problem, but did not give any time frames. Looking at how many issues are not being answered on this forum at the moment, my guess is that GXT3 is the current focus. Seeing that even raising a ticket didn't prompt a patch, I'd say you'd be better to work around this issue for now.

15 May 2011, 8:27 PM
Note that this issue is still not fixed in the 2.2.4 release

16 May 2011, 12:37 AM
This thread will be updated once its fixed.

27 May 2011, 9:25 AM
I removed the change for now as long as isVisible is implemented correctly.

27 May 2011, 10:14 PM
Thanks Sven,

So this fixes the layout issues (rev 2394) - is the visibility issue you were worried about still a problem?


28 May 2011, 12:35 AM
Yes, and the thread that coursed this change was much longer and more often on internal tickets. However as the second half of the patch did not make it into GXT so far, i reverted the change.

24 Jun 2011, 7:01 AM
Even in the most up to date SVN version the RowLayout doesn't work if you use Orientation.HORIZONTAL as you can see in this simple use case:

public void onModuleLoad() {
LayoutContainer lc = new LayoutContainer(new RowLayout(
lc.add(new Text("Item1"));
lc.add(new Text("Item2"));
}Executing this code results in a white browser screen, no text is displayed.
Using FireBug you can see that all html tags are present, but somehow not displayed.

Changing from Orientation.VERTICAL to Orientation.HORIZONTAL you can see that the LayoutContainers style-attribute gets extended by postition: relative; which seems to be the cause for not showing the text elements.


Investigating the RowLayout class it seems to be the onLayout method which adds this style be calling target.makePositionable();

protected void onLayout(Container<?> container, El target) {
super.onLayout(container, target);

if (container instanceof ScrollContainer<?>) {
ScrollContainer<?> sc = (ScrollContainer<?>) container;
} else {
target.setStyleAttribute("overflow", "hidden");

if (orientation == Orientation.VERTICAL) {
} else {
Any suggestions how to solve this problem?

24 Jun 2011, 7:03 AM
You need to size your layoutcontainer, this is not a bug.