i don't have any idea on how to get the selected items in a DualListField. Can somebody help me. so here's my code on DualListField. And I want txtCat to be the container of the selected items aside from the TextCell. And also I want the selected item to be converted on its IDCategory
final DualListField<Category, String> field = new DualListField<Category, String>(category, toCategory, catProp.strName(), txCell);
field.addValidator(new EmptyValidator<List<Category>>());
field.setEnableDnd(true);
field.setMode(Mode.INSERT);
vlc.add(new FieldLabel(field, "Categories"), new VerticalLayoutData(1, -1, new Margins(10)));
txtCat = new TextField();
txtCat.setEmptyText("Value");
txtCat.addFocusHandler(new FocusEvent.FocusHandler() {
@Override
public void onFocus(FocusEvent event) {
field.getFromStore();
}
});
vlc.add(new FieldLabel(txtCat, "Chosen Categories"), new VerticalLayoutData(-18, -1, new Margins(10)));
In latest GXT3 version DualListField , You could get the selected items in ToView part through field.getValue() method. You get all the data in ToView as follows. field.getToView() .getStore().getAll() . hth
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.