PDA

View Full Version : Styling regression for FormPanels in GXT 2.1



carlos.aguayo
6 Jan 2010, 4:28 PM
Hi,
After upgrading to GXT 2.1 we noticed some forms had its fields shifted. I isolated the issue to the following code:



import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.RootPanel;

public class Demo implements EntryPoint {

public void onModuleLoad() {
FormPanel formPanel = new FormPanel();
formPanel.setSize(350, 220);

FieldSet fieldset = new FieldSet();
fieldset.setHeading("test");
fieldset.setLayout(new FormLayout());

LabelField name = new LabelField();
name.setFieldLabel("Name");
name.setValue("hello world");
fieldset.add(name, new FormData("100%"));

formPanel.add(fieldset);

RootPanel.get().add(formPanel);
}

}
Using GXT 2.0.1, the form is displayed fine as seen in this picture:
18132

After upgrading to GXT 2.1, the "hello world" is shifted down:
18133

The "100%" in the FormData is what is causing the problem, hardcoding a pixel value obviously fixes the problem. However this seems like a regression, GXT 2.1 should render the content in the same way.