Using Searchable with Boolean values in JTable

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.

Using Searchable with Boolean values in JTable

Postby robert » Thu Mar 26, 2009 6:39 pm

I've been experimenting with SearchableBar in my JTable. In some tables I have a Boolean column that is rendered as a JCheckBox. If I start a search with the letter "T", the search returns all of the rows where the checkbox is selected, correspoinding to TRUE. The same thing occurs when I start a search with the letter "F" (FALSE). The search results are then incorrect, but I have no idea how this problem can be corrected. Any suggestions?

Thanks
robert
 
Posts: 41
Joined: Thu Apr 03, 2008 6:56 am

Re: Using Searchable with Boolean values in JTable

Postby JIDE Support » Thu Mar 26, 2009 8:09 pm

Does it work as you expected or it doesn't? Type "T" should fine all check boxes that are checked and "F" should fine all that are not checked because we convert the value to String using toString method then compare with what user typed. So I think it should work correctly with both check and unchecked check boxes as long as the data behind the check box is a boolean.

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

Re: Using Searchable with Boolean values in JTable

Postby robert » Thu Mar 26, 2009 8:29 pm

It does not work as expected to the end user. For example, there might be a table that does not have a single occurence of the the letter "T". But if they search for "T" they get results for every boolean true value, even though the word "true" does not appear anywhere in the table. To the end user, the search has returned an incorrect result. The average end user would not know that a checked box is equal to the letter "T".
robert
 
Posts: 41
Joined: Thu Apr 03, 2008 6:56 am

Re: Using Searchable with Boolean values in JTable

Postby JIDE Support » Thu Mar 26, 2009 8:32 pm

I think I prefer to keep it this way but you can easily change it by sublcassing TableSearchable and overriding convertElementToString method to convert boolean data to an empty string. Since those classes are open source in JIDE Common Layer at https://jide-oss.dev.java.net so feel free to check them out from svn and find a way to customize it to fit your need.

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

Re: Using Searchable with Boolean values in JTable

Postby robert » Thu Mar 26, 2009 8:41 pm

Thanks for your reply, I will try your suggestion.
robert
 
Posts: 41
Joined: Thu Apr 03, 2008 6:56 am


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

Who is online

Users browsing this forum: No registered users and 7 guests