when set a value to combobox the hidden field don't received the value.. I need select the item in combobox to my hidden field receveid the value.. the problem:
my form have a combobox that have the country that the person live.. when the user go update your profile.. I need reset this field and do the user to select you country again...
Code:
ListStore<TestModel> store = new ListStore<TestModel>();
TestModel model = new TestModel();
model.setCodigo(1);
model.setNome("name 1");
TestModel model1 = new TestModel();
model1.setCodigo(2);
model1.setNome("name 2");
store.add(model);
store.add(model1);
FormPanel form = new FormPanel();
ComboBox<TestModel> combo = new ComboBox<TestModel>();
combo.setStore(store);
combo.setFieldLabel("xxx");
combo.setDisplayField("nome");
combo.setValueField("codigo");
combo.setName("comboBox");
combo.setValue(model);
form.add(combo);
RootPanel.get().add(form);
TestModel.java
Code:
public class TestModel extends BaseModel {
public Integer getCodigo() {
return get("codigo");
}
public String getNome() {
return get("nome");
}
public void setCodigo(Integer codigo) {
set("codigo", codigo);
}
public void setNome(String nome) {
set("nome", nome);
}
}