PDA

View Full Version : how control the TextField in column form?



cqiao
30 Jun 2008, 3:37 AM
how control the TextField's labels and input box?and the distances in the column form?
In my code, a textField's label and inputbox are not in a row, shown in attantchment.
the code piece:
FormLayout layout = new FormLayout();
layout.setLabelAlign(LabelAlign.LEFT);

LayoutContainer left = new LayoutContainer();
left.setData(new ColumnData(.37));
left.setAutoHeight(true);
left.setBorders(true);
left.setLayout(layout);
left.setStyleAttribute("padding", "1");

layout = new FormLayout();
layout.setLabelAlign(LabelAlign.LEFT);
layout.setPadding(5);
LayoutContainer right = new LayoutContainer();
right.setData(new ColumnData(.3));
right.setLayout(layout);
right.setAutoHeight(true);
right.setBorders(true);
right.setStyleAttribute("padding", "1");

layout = new FormLayout();
layout.setLabelAlign(LabelAlign.LEFT);
LayoutContainer middle = new LayoutContainer();
middle.setData(new ColumnData(.33));
middle.setLayout(layout);
middle.setAutoHeight(true);
middle.setBorders(true);
middle.setStyleAttribute("padding", "1");
TextField text = new TextField();
text.setFieldLabel("

cqiao
2 Jul 2008, 4:27 PM
perhaps, it is caused by bugs in GXT 1.0 beta5. but the stabler version - 1.0 RC2 changes the correlative API, and the sample in net hasn't been updated.

gslender
2 Jul 2008, 6:22 PM
if you provide a full working code example - with onModuleLoad included (and no other class requirements) I can test and confirm issues or not

cqiao
3 Jul 2008, 6:37 AM
thanks! but that code has been deleted.

cqiao
5 Jul 2008, 4:41 PM
in 1.0 RC2, layoutContainer.setLayoutData(LayoutData,ld) is revoked, change the code "left.setLayoutData(new ColumnData(.5));" in the sample "column form" to "left.setLayoutData(left,new ColumnData(.5));", and revise the right's corresponding code, it will work fine.