Suppressing selection events from TableSearchable

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Suppressing selection events from TableSearchable

Postby teknosoul » Sun Sep 16, 2012 7:34 am

Using JIDE 3.4.5, is there any way to suppress / prevent a TableSearchable and shrink support from firing selection events? I find that it fires a lot of selection events when changing the search string. The following seems to happen and I get 3 valueChanged events on the selection model before a searchable event.

evt1 - TableSearchable.addTableSelection eventually calls JideTable.changeSelection which eventually fires a DefaultListSelectionModel.fireValueChanged
evt2 - TableSearchable.addTableSelection calls JideTable.clearSelection which eventually fires the DefaultListSelectionModel.fireValueChanged
evt3 - same flow as evt1

for all events, evt.getValueIsAdjusting() returns false.

Then I get a Searchable_change event followed by another valueChangedEvent triggered by the TableShrinkSearchableSupport.applyFilter and finally a Searchable_match

I'm not sure what the first 3 events are for, but if we do anything somewhat expensive in the selection events, these pose a problem. So basically, is there a way for searchable to just do the filtering and not selection?

Thanks
teknosoul
 
Posts: 4
Joined: Thu Aug 16, 2012 3:40 pm

Re: Suppressing selection events from TableSearchable

Postby JIDE Support » Mon Sep 17, 2012 1:23 pm

Per my testing, two selection events instead of three are detected on searching. Due to the fact that the selected row is always the first row on searching, I'm afraid that we have to clear selection first then add the selection for row 0 later to notify the listener that the selected content actually changed although the selected row didn't.

Please correct me if you still observe 3 events.

Thanks,
----------
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36466
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 3 guests