PDA

View Full Version : row LayoutContainer



ghatfan99
28 Sep 2010, 12:18 AM
hello every one,
i have a contentPanel, and in it i want to put fields, at the seconde line i want to put two fields and for that i used LayoutContainer (RowLayout), but the result is not good(see the photo), here is my code:



ContentPanel leftPanel =

new ContentPanel(new FormLayout());

leftPanel.setFrame(false);
leftPanel.setHeaderVisible(false);
leftPanel.setBodyStyle("padding: 10px;");
leftPanel.setStyleAttribute("marginRight", "10px");
//leftPanel.setHeading("demande");
//leftPanel.setBorders(true);
FormLayout layoutvv =


new FormLayout();

layoutvv.setLabelWidth(75);
leftPanel.setLayout(layoutvv);


DateField dateDemande = new DateField();
dateDemande.setFieldLabel("Date");
dateDemande.setEmptyText("jj/mm/aaaa");
dateDemande.getPropertyEditor().setFormat(
DateTimeFormat.getFormat("dd/MM/yyyy"));
leftPanel.add(dateDemande, formData);


TextFieldMask periodeDemande1 = new TextFieldMask("99:99");
periodeDemande1.setFieldLabel("Periode");
periodeDemande1.setEmptyText("hh:mm");
// leftPanel.add(periodeDemande, formData); TextFieldMask
TextFieldMask periodeDemande2 =


new TextFieldMask("99:99");

periodeDemande2.setEmptyText("hh:mm");


LayoutContainer row = new LayoutContainer(new RowLayout(
Orientation.HORIZONTAL));
row.setStyleAttribute("padding", "3px");
row.setSize(120, 25);
row.addText("Periode: ");
row.add(periodeDemande1, new RowData(54, 1));
row.addText("-");
row.add(periodeDemande2, new RowData(55, 1));
leftPanel.layout(true);
leftPanel.add(row, formData);


TextField<String> dureeDemande = new TextField<String>();
dureeDemande.setFieldLabel("Durée");
leftPanel.add(dureeDemande, formData);


TextField<String> agentDemande = new TextField<String>();
agentDemande.setFieldLabel("Agent");
leftPanel.add(agentDemande, formData);


TextField<String> notesDemande = new TextField<String>();
notesDemande.setFieldLabel("Notes");
leftPanel.add(notesDemande, formData);


TextField<String> status = new TextField<String>();
status.setFieldLabel("Status");
leftPanel.add(status, formData);

i want that my fields have the same size in font and in size.
thank's

micgala
28 Sep 2010, 8:36 AM
Hi.

Try using the MultiField class.

Regards
Michel.

ghatfan99
30 Sep 2010, 6:48 AM
thanks for your answer it works perfectly.

regards