is it possible to dynamically add FormItem to a Form? That is, if i click on a button to add some FormItems to an existing DynamicForm?
i have tried to test, but it does not work. because setFields() or setItems() does not work like addMember().
Does anyone have an idea about how to handle this?
thanks a lot.
i have tried to test, but it does not work. because setFields() or setItems() does not work like addMember().
Code:
public class smd implements EntryPoint { public void onModuleLoad() { VLayout layout = new VLayout(); Button button = new Button("Add"); final DynamicForm form = new DynamicForm(); button.addClickHandler(new ClickHandler(){ public void onClick(ClickEvent event) { for(int i = 0; i<5; i++){ TextItem item = new TextItem(); form.setFields(item); } } }); layout.addMember(button); layout.addMember(form); layout.draw(); } }
thanks a lot.
Comment