PDA

View Full Version : field label is not showing



mrhari
30 Dec 2010, 4:09 AM
Hi i am adding 2 text field and 2 combobox in a Lauout container. and i set field label for each.but it is not displaying.i set layout container's layout as ColumLayout.If it is set as form layout label's are dispalying.But i want in same colum.

here is my sample code

public class test extends
implements EntryPoint
{
public void onModuleLoad() {


LayoutContainer main = new LayoutContainer();
main.setLayout(new ColumnLayout());
cmbAdvFields= new ComboBox<ModelData>();

cmbAdvFields.setFieldLabel("Field");
main.add(cmbAdvFields,new ColumnData());
cmbAdvCondition = new ComboBox<ModelData>();
cmbAdvCondition.setFieldLabel("Condition");
main.add(cmbAdvCondition,new ColumnData());
main.add(cmbAdvFields,new ColumnData());

TextField<String> txtSname=new TextField<String>
txtSname.setFieldLabel("Firs tName");
main.add(txtSname,new ColumnData());
TextField<String> txtFname=new TextField<String>
txtSname.setFieldLabel("Firs tName");
main.add(txtSname,new ColumnData());
RootPanel.get().add(main);
}
}

sven
30 Dec 2010, 4:25 AM
A FieldLabel is only shown in a FieldLayout. You need to use an extra container as shown in this example: http://www.sencha.com/examples/explorer.html#advancedforms