Using Searchable with changing table models

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 changing table models

Postby robert » Thu Mar 26, 2009 7:00 pm

I've been experimenting with Searchable with the JTable in my application. The table model in my JTable can change. For example, a user can click a button to retrieve a new dataset that may have a different number of rows/columns. After trying some experiments, I started getting some Exceptions. For example, if I do a search in the table and then change the table model, an exception may occur (out of bounds exception), because the new model may have a different number of columns, or possibly no data at all. The "Searchable" is still looking at the old table model. I fixed this issue in my application code by installing a new Searchable (SearchableUtils.installSearchable) each time the table model is changed. While this has fixed the problem, I'm not sure this is the best way to solve the issue. Is this the best approach or should I be doing something else?

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

Re: Using Searchable with changing table models

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

To save me the time to write a test case, could you send me yours or post the exception here? It should be an easy fix.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Using Searchable with changing table models

Postby robert » Fri Mar 27, 2009 11:26 am

I'm having some trouble reproducing the issue in a test case, which leads me to believe that the issue might be in my application rather than in Jide. I'm still looking into it. I have added an example of one of the exceptions below. Basically what happened is I did a search and a match was found in column 6. Then a new dataset was loaded into the table that had less than 6 columns. This produced "ArrayIndexOutOfBoundsException: 6".
Code: Select all
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 6
   at com.fermsoft.amphora.TableModel1.getValueAt(TableModel1.java:2395)
   at com.fermsoft.amphora.TableSorter.getValueAt(TableSorter.java:238)
   at javax.swing.JTable.getValueAt(JTable.java:1903)
   at com.jidesoft.swing.TableSearchable.getValueAt(Unknown Source)
   at com.jidesoft.swing.TableSearchable.getElementAt(Unknown Source)
   at com.jidesoft.swing.Searchable.findFromCursor(Unknown Source)
   at com.jidesoft.swing.SearchableBar.highlightNext(Unknown Source)
   at com.jidesoft.swing.SearchableBar.highlightAllOrNext(Unknown Source)
   at com.jidesoft.swing.SearchableBar.access$000(Unknown Source)
   at com.jidesoft.swing.SearchableBar$1.searchableEventFired(Unknown Source)
   at com.jidesoft.swing.Searchable.fireSearchableEvent(Unknown Source)
   at com.jidesoft.swing.TableSearchable.tableChanged(Unknown Source)
   at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280)
   at javax.swing.table.AbstractTableModel.fireTableDataChanged(AbstractTableModel.java:182)
robert
 
Posts: 41
Joined: Thu Apr 03, 2008 6:56 am

Re: Using Searchable with changing table models

Postby JIDE Support » Fri Mar 27, 2009 11:44 am

In this case, maybe you can hook up with JIDE Common Layer source code and debug yourself. It shouldn't be difficult to do it yourself instead of trying to reproduce it. I just looked at the code based on the stack trace but couldn't think of a reason.

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

Unable to search the item present in combo box

Postby sunanda » Tue Feb 02, 2010 3:55 am

When I search for any item present in a combo box if the item is present in the combo box then it is not allowing to type the second character. If the search item is not present in the combo box then it is allowing to type all the character. Can anybody suggest me how to over come this problem. This is happening only for a particular combo box.
sunanda
 
Posts: 1
Joined: Tue Feb 02, 2010 3:45 am

Re: Using Searchable with changing table models

Postby JIDE Support » Tue Feb 02, 2010 10:37 am

Since it is happening only for a particular ComboBox, would you please try to figure out the difference between that ComboBox and the others? I checked out Searchable code and could not find any place to cease accepting keyboard input so it's really hard to guess the reason. A test case or the code snippet of the particular ComboBox would help us go further.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
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 64 guests