Sorted TwinColSelect

Moi,

In my application I’m using a TwinColSelect with a BeanItemContainer. Is there an easy way to keep the items in the two columns ordered? I need the items ordered just alphabetically. Currently the items are appended to the bottom of the lists when the user manipulates the selected list.

Thanks for your help in advance,
Sandor.


BeanItemContainer<Person> pContainer = new BeanItemContainer<Person>(Person.class);
for (Person p : persons) {
	pContainer.addBean(p);
}
TwinColSelect select = new TwinColSelect();
select.setContainerDataSource(pContainer);
select.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
select.setItemCaptionPropertyId("name");

Dear Sandor,

kindly, try use vaadin add-on listbuilder which is enhancement of TwinColSelect have item ordering.

https://vaadin.com/directory#addon/listbuilder

Best Regards,
Shenouda Bertel