Skip to main content

Find widget for JXTable not searching from selected row

3 replies [Last post]
sandy85
Offline
Joined: 2012-06-05
Points: 0

I have a problem with default find widget for JXTable. Default find widget for JXTable is not searching forward from the selected row, instead its searching from the first row every time. Please let me know how to change this and start the search from the selected row.
Thanks,

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kleopatra
Offline
Joined: 2003-06-11
Points: 0

(sorry for the late response, still in post-vacation lazyness :-)

good question! It's not supported, currently. My first impulse for a quick custom solution was to suggest a custom TableSearchable - which surprisingly wouldn't work by itsel:

- the "lastfoundindex" (that is the starting point of a search) is primarily kept in the PatternModel of the find widget.
- that property is unconditionally set to -1 when binding the find widget to the concrete searchable, in findPanel.setSearchable
- while AbstractSearchable internally keeps track of its own lastSearchResult, it has no public api to somehow grab it (or any other api to get hold of an index it wants to start a new search from, like f.i. the selected row of the associated table)

Please file a feature issue in the swingx issue tracker - the use-case is well worth to be supported, but needs some thought to add cleanly.

Thanks for bringing the issue to our attention
Jeanette

sandy85
Offline
Joined: 2012-06-05
Points: 0

Could you please let me know the location where I need to file this as a feature issue.
Looks like I need to customize the TreeSearchable class.
Thanks for your reply.

kleopatra
Offline
Joined: 2003-06-11
Points: 0

On the left of the swingx project page is a link to the project jira :-) Copied for your convenience:

http://java.net/jira/browse/SWINGX

Cheers
Jeanette