PDA

View Full Version : strange behaviour when updating to 1.0.4



mpelze2s
4 Sep 2008, 9:01 AM
Hi,

I updated my project to ExtGWT 1.0.4 and now I have some really strange things. In forms all LayoutContainers with FormLayout have scroll bars or at least a grey area at the right side where a scroll bar could be. That looks horrible in a form using lots of LayoutContainers to create a complext layout. In 1.0.2 these scroll bars were not there.

Also field labels of radio buttons in radio groups are not displayed any longer. The radio buttons are there but no text.

The following screenshot shows a simple test window with the following code:



public class Test extends Window {


public Test() {
this.setHeight(800);
this.setWidth(1000);

LayoutContainer main = new LayoutContainer();
main.setHeight(800);
main.setWidth(900);
main.setLayout(new FlowLayout());

LayoutContainer top = new LayoutContainer();
top.setLayout(new ColumnLayout());

LayoutContainer topLeft = new LayoutContainer();
topLeft.setLayout(Utils.createFormLayout(LabelAlign.TOP));

List<String> persons = new ArrayList<String>();
topLeft.add(Utils.createComboBox("Antragssteller", "Antragssteller", persons, null));

LayoutContainer topMiddle = new LayoutContainer();
topMiddle.setLayout(Utils.createFormLayout(LabelAlign.TOP));
topMiddle.add(Utils.createTextField("Personal-ID", "Personal-ID", null, true));

LayoutContainer topRight = new LayoutContainer();
topRight.setLayout(Utils.createFormLayout(LabelAlign.TOP));
topRight.add(Utils.createTextField("Antragsnummer", "Antragsnummer", null, true));

top.add(topLeft, new ColumnData(0.33f));
top.add(topMiddle, new ColumnData(0.34f));
top.add(topRight, new ColumnData(0.33f));

main.add(top);

// more LayoutContainers to follow

this.add(main);
}

}
(The methods in the class "Utils" are just conenienve methods for creating layouts and fields. They just create an object, set the id, the field label, ... and return it.)

As you can see each column has something grey on the right side. As the layout gets more complex scroll bars appear everywhere.

What happened in 1.0.4 that all my forms do not work any more?


Best regards,
Martin

mpelze2s
5 Sep 2008, 2:18 AM
Hi again,

I was able to isolate the problem from my project in a simple project consisting only of these two classes:

[code]package test.client;

import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Window;
import com.extjs.gxt.ui.client.widget.form.Radio;
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
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.ColumnData;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;

public class TestWindow extends Window {

public TestWindow() {
this.setHeight(800);
this.setWidth(1000);

LayoutContainer main = new LayoutContainer();
main.setHeight(600);
main.setWidth(900);
main.setLayout(new FlowLayout());

// scroll bars
LayoutContainer top = new LayoutContainer();
top.setLayout(new ColumnLayout());

LayoutContainer topLeft = new LayoutContainer();
topLeft.setLayout(this.createFormLayout(LabelAlign.TOP, 100, 100));
topLeft.add(this.createTextField("something", "something", false));

LayoutContainer topMiddle = new LayoutContainer();
topMiddle.setLayout(this.createFormLayout(LabelAlign.TOP, 100, 100));
topMiddle.add(this.createTextField("Personal-ID", "Personal-ID", false));

LayoutContainer topRight = new LayoutContainer();
topRight.setLayout(this.createFormLayout(LabelAlign.LEFT, 100, 100));
topRight.add(this.createTextField("Antragsnummer", "Antragsnummer", false));

top.add(topLeft, new ColumnData(0.33f));
top.add(topMiddle, new ColumnData(0.34f));
top.add(topRight, new ColumnData(0.33f));

main.add(top);

LayoutContainer two = new LayoutContainer();
two.setWidth(500);
two.setHeight(200);
two.setLayout(this.createFormLayout(LabelAlign.TOP, 100));
two.add(this.createTextField("Per", "Per", false));

main.add(two);


// radio buttons
LayoutContainer three = new LayoutContainer();
three.setLayout(this.createFormLayout(LabelAlign.LEFT));

Radio newOne = this.createRadioButton("Neuantrag", "one", true);
Radio change = this.createRadioButton("

gicappa
5 Sep 2008, 7:03 AM
Just For the radio buttons: you have to use setBoxLabel instead of setFieldLabel and labels will magically display back to the screen.