flow
5 Jun 2008, 4:35 AM
Hi,
I added a FormPanel into a normal LayoutContainer using the FitLayout.
If I resize the window, so that the FormPanel cannot be displayed anymore, the scrollbars appear.
Strange effect: on scrolling, only the FormPanel scrolls, but its widgets (here a TextField) remains on the spot.
package com.soko.multibase.client;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*
* @author huber, itestra GmbH
* @version $Id: ClientTest.java,v 1.2 2008/06/04 16:20:10 huber Exp $
*/
public class ClientTest extends LayoutContainer implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
final Viewport v = new Viewport();
v.add(this);
v.layout();
v.setLayout(new FitLayout());
RootPanel.get().add(v);
}
public ClientTest() {
setData("layout", new FitLayout());
setScrollMode(Scroll.AUTO);
final FormPanel propertiesFormPanel = new FormPanel();
propertiesFormPanel.setHeading("Basics");
propertiesFormPanel.setFieldWidth(200);
propertiesFormPanel.setLabelWidth(200);
propertiesFormPanel.setLabelAlign(LabelAlign.RIGHT);
propertiesFormPanel.setBorders(false);
propertiesFormPanel.setFrame(true);
propertiesFormPanel.setWidth(500);
propertiesFormPanel.setHeight(300);
final TextField<String> textField = new TextField<String>();
textField.setFieldLabel("Description");
textField.setEnabled(false);
textField.setReadOnly(true);
propertiesFormPanel.add(textField);
final HorizontalPanel horizontalPanel = new HorizontalPanel();
horizontalPanel.add(propertiesFormPanel);
add(horizontalPanel);
}
}
I added a FormPanel into a normal LayoutContainer using the FitLayout.
If I resize the window, so that the FormPanel cannot be displayed anymore, the scrollbars appear.
Strange effect: on scrolling, only the FormPanel scrolls, but its widgets (here a TextField) remains on the spot.
package com.soko.multibase.client;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*
* @author huber, itestra GmbH
* @version $Id: ClientTest.java,v 1.2 2008/06/04 16:20:10 huber Exp $
*/
public class ClientTest extends LayoutContainer implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
final Viewport v = new Viewport();
v.add(this);
v.layout();
v.setLayout(new FitLayout());
RootPanel.get().add(v);
}
public ClientTest() {
setData("layout", new FitLayout());
setScrollMode(Scroll.AUTO);
final FormPanel propertiesFormPanel = new FormPanel();
propertiesFormPanel.setHeading("Basics");
propertiesFormPanel.setFieldWidth(200);
propertiesFormPanel.setLabelWidth(200);
propertiesFormPanel.setLabelAlign(LabelAlign.RIGHT);
propertiesFormPanel.setBorders(false);
propertiesFormPanel.setFrame(true);
propertiesFormPanel.setWidth(500);
propertiesFormPanel.setHeight(300);
final TextField<String> textField = new TextField<String>();
textField.setFieldLabel("Description");
textField.setEnabled(false);
textField.setReadOnly(true);
propertiesFormPanel.add(textField);
final HorizontalPanel horizontalPanel = new HorizontalPanel();
horizontalPanel.add(propertiesFormPanel);
add(horizontalPanel);
}
}