PDA

View Full Version : Bug with scrollers in Chrome



lichnost
11 Aug 2009, 5:41 AM
Scrollbars appears in Google Chrome when resizing window



public void onModuleLoad() {
GXT.hideLoadingPanel("loading");

final TextField<String> text1 = new TextField<String>();
final TextField<String> text2 = new TextField<String>();
final TextArea text3 = new TextArea();

final Window window = new Window();
window.setLayout(new FitLayout());
window.setScrollMode(Scroll.AUTO);

final LayoutContainer form = new LayoutContainer() {
@Override
protected void onResize(int width, int height) {
text1.setWidth(width);
text2.setWidth(width);
text3.setWidth(width);
text3.setHeight(height - 56);
}
};
FormLayout formLayout = new FormLayout();
formLayout.setHideLabels(true);
form.setLayout(formLayout);

form.add(text1);
form.add(text2);
form.add(text3);

window.add(form);
window.addListener(Events.Show, new Listener<WindowEvent>(){

@Override
public void handleEvent(WindowEvent be) {
form.setHeight(be.getWindow().getHeight());
form.setWidth(be.getWindow().getWidth() - 15);
}

});
window.show();

}

sven
11 Aug 2009, 5:45 AM
This is not a bug. Moving this to the help forum. You should use FormData instead of your own resizhandling.

lichnost
11 Aug 2009, 7:34 AM
I use form here only as an example. I think all browsers should woks with this code the same, other browsers works well except Chrome.

sven
11 Aug 2009, 7:40 AM
IE also fails with that code. You use fitlayout and setup a scrollmode. A fitlayout will never show scrollbars.

You use a fitlayout and size your layoutcontainer. Why are you doing that?

lichnost
12 Aug 2009, 10:37 PM
Well, actually I dont want scrollbars at all. Maybe I've made something wrong here.
I have a component extends LayoutContainer with two ListFields and buttons that should be resizable to his parent. And I have a problem with scrollers in Chrome and IE too, when setting window size little less only. After window move scrollers dissapears.
I will post another testcase little later.

Arno.Nyhm
13 Aug 2009, 9:00 AM
please also some screenshots.