TwinColSelect, no valuechange event on deselect?

TwinColSelect doesn’t appear to trigger a Property.ValueChangeEvent when an item is deselected (moved back to left hand column). The event is definitely working for me when I select, but not on deselect.

Is there another event I can set listeners for to detect this, or is this not possible?

Does anyone have any ideas about this, could it be a bug that needs reporting?

Make sure your TwinColSelect has multiselection mode enabled, and allows null selection (if appropriate). When these settings are on, as I believe they should be by default, I do get ValueChangeEvents also for removing items.

Thanks for your response, I’ve just realised it was a bug in my own code, in the event callback I was doing:


if(personSelector.getValue() != null && ((Set<Person>) personSelector.getValue()).size() > 0) {
//stuff i expected to happen here
}

I now realise it was only not working when I removed the last selected item so no items were selected. Of course ((Set) personSelector.getValue()).size() > 0) causes logic to fail. This was a silly mistake, I think I forgot I put that logic in a while ago when I intended to do something different with the component.

Oh well, perhaps if people are experiencing a similar problem (/ absent mindedness) this thread will point them in the direction of where their code is wrong.

On another note, is there any way of doing paging with TwinColSelect for large data sets so the user can scroll through them?

Currently not - you need to build your own CustomComponent with a single column table on the left to support lazy loading. This should not be too hard, though.

I’m not sure if the
ListBuilder add-on
already takes such an approach or if it uses a custom client side widget.