PDA

View Full Version : MultiField child Field lablels



VadimV1144
20 Jul 2009, 8:47 AM
Hi, is there a way to display the labels for individual fields within the MultiField?

VadimV1144
20 Jul 2009, 8:34 PM
Here are a few issues I found with the MultiField widget:
1) The FieldLabels for the member Fields are not displayed
2) When setResizeFields = true , the right edge of the rightmost field does not align with the other fields in the form (see example or screenshot)
3) The border is missing from the bottom of the fields within the MultiField widget.

Screenshot:
http://extjs.com/forum/attachment.php?attachmentid=15140&stc=1&d=1248150508

- GXT 2.0
- Both (Host and web mode)
- IE 7.0, FireFox 3.5
- Windows XP x64
- Simple test function


private void multiFieldTest(){

FormPanel form = new FormPanel();
form.setFieldWidth(300);
form.setFrame(true);

TextField before = new TextField();
before.setName("before");
before.setFieldLabel("Before MF");
form.add(before);

//Create multifield with two TextFields
MultiField mf = new MultiField();
mf.setName("multi");
mf.setSpacing(10);
mf.setResizeFields(true);
mf.setOrientation(Style.Orientation.HORIZONTAL);
mf.setLabelSeparator("");

TextField mf1 = new TextField();
mf1.setName("multione");
mf1.setFieldLabel("Multi One");
mf.add(mf1);
TextField mf2 = new TextField();
mf2.setName("multitwo");
mf2.setFieldLabel("Multi Two");
mf.add(mf2);
form.add(mf);

TextField after = new TextField();
after.setName("after");
after.setFieldLabel("AfterMF");
form.add(after);

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

sven
21 Jul 2009, 2:04 AM
1) This is not a bug. Only a formlayout renders fieldlabels.

2) This is already fixed in SVN.

3) I cant reproduce this with your testcase

VadimV1144
21 Jul 2009, 2:24 AM
Thank you, one more question:

I tried setting FormLayout on a HorizonalPanel (which extends LayoutContainer) via setLayout() method, but the FieldLabels still did not render.
Does this mean that I can set the FormLayout only on the LayoutContainer itself in order to get the desired effect (rendering of the FieldLabels)?

sven
21 Jul 2009, 2:31 AM
A HorizontalPanel uses already an other layout intern. You need to use a LayoutContainer.

VadimV1144
21 Jul 2009, 2:39 AM
ic, so its only a single layout per container
out of curiosity - is it theoretically possible to have multiple layouts per container