PDA

View Full Version : [CLOSED] Window shadow not readjusting when the size of the Window changes



bigmountainben
10 May 2009, 7:31 AM
popup = new Window();
popup.setAutoHeight(true); //(and all the components in it too)

Window has a FitLayout
In the FitLayout, there is a LayoutContainer (call it form) with a FormLayout

form has a bunch of fields, including a FieldSet at the end of it. The FieldSet is fairly large.

I start expanded. When I collapse it, the shadow of the Window doesn't shrink along with the rest of the Window.

sven
10 May 2009, 7:33 AM
Your approach is wrong. You cant use autoHeight with a fitlayout.

bigmountainben
10 May 2009, 7:37 AM
The problem also manifest itself if I use the default, FlowLayout and a RowLayout. What kind of Layout is one supposed to used with auto-= height?

sven
10 May 2009, 7:40 AM
Well, autoheight means the window grows automatically with the browserflow. There are no events fired with that. So the shadow cant be updated automatically. GXT tries to sync the shadow as best as possible. Please post a testcode that demonstrates the issues.

sven
10 May 2009, 7:45 AM
The problem also manifest itself if I use the default, FlowLayout and a RowLayout. What kind of Layout is one supposed to used with auto-= height?

FlowLayout (the default one), AnchorLayout, FormLayout, TableLayout, RowLayout with Orientation set to Vertical

bigmountainben
10 May 2009, 8:00 AM
public class Test implements EntryPoint {

public void onModuleLoad() {

Window w = new Window();
w.setHeading("my favorite variables");
w.setWidth(500);
w.setAutoHeight(true);
w.setShadow(true);
w.add(new TestForm());
w.show();
}

static class TestForm extends LayoutContainer {

TestForm() {
FormLayout fl = new FormLayout();
fl.setDefaultWidth(300);
fl.setLabelWidth(100);
setLayout(fl);
setAutoHeight(true);
}

@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
// Some fields
TextField foo = new TextField();
foo.setFieldLabel("foo");
TextField bar = new TextField();
bar.setFieldLabel("bar");
TextField baz = new TextField();
baz.setFieldLabel("baz");
// A field set
FieldSet fs = new FieldSet();
fs.setCollapsible(true);
fs.setHeading("quux");
fs.setExpanded(true);
TextArea quux = new TextArea();
quux.setHeight("5em");
fs.add(quux);

add(foo);
add(bar);
add(baz);
add(fs);
}
}
}

sven
10 May 2009, 8:01 AM
In which browser do you have the issue?

bigmountainben
10 May 2009, 8:07 AM
Doesn't fix it.

To restate: the issue is that when you collapse or expand the field set, the shadow for the entire window does not resize along with the window.

sven
10 May 2009, 8:10 AM
You need to listen the the fieldsets collapse and expand events and call
window.sync(true)

bigmountainben
10 May 2009, 8:19 AM
I figured that's what you meant.

That works, actually - but the Window should be listening to its children for resize events and do this for me.

I am seeing this on Safari (and Hosted mode, same agent different version). Have not tested FF or IE.

sven
10 May 2009, 8:22 AM
No, that is something you have to do. Even if we listen for that events, there are still ways to brake it as when the browserflow changes, no events are fired we can listen for.