This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Table sorter going nuts once added another itam

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy,

I've successfully implemented the table sorter from the sun website. Problem is when I add another item to the table - I get an ArrayIndexOutOfBoundsException.ArrayIndexOutOfBoundsException.

specifying the problem at: return getViewToModel()[viewIndex].modelIndex;
in

public int modelIndex(int viewIndex) {
return getViewToModel()[viewIndex].modelIndex;
}

does anyone know what might be the problem?
thanks

the complete error is below.
 
Thomas Rowland
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am experiencing the same problem. I have struggled with this for days and have resorted to removing the TableSorter unless I can find a solution.

I have tried swapping out the sorterTableModel and replacing it with the original tableModel while updates are happening, but this does not work.

Anyone have any insight they can share?

Thanks,
Tom
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this problem was also posted to sun's forum

http://forum.java.sun.com/thread.jspa?threadID=744037

the solution from 74philip (Hi Craig) is the one you want
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic