I need help.
How I can get all components in Vertical Layout?
VerticalLayout main = new VerticalLayout();
main.addComponent(new TextField("1"));
main.addComponent(new TextField("2"));
main.addComponent(new TextField("3"));
List<AbstractComponent> list = main.getAllComponents(); //How??
I use Vaadin 7
for (int i = 0; i < layout.getComponentCount(); i++) {
Component c = layout.getComponent(i);
//at this point you can do it to do whatever like:
if(c instanceof TextField){
TextField txtfield = (TextField) c;
txtfield.setValue("somestring");
}
}
layout would be main in your case.