RegisterSearchFAQ UsergroupsLog in
TableReorder part three: weird columnselection

 
Reply to topic    Citra Technologies Forum Index » Report a Bug View previous topic
View next topic

TableReorder part three: weird columnselection
Author Message
cone



Joined: 29 May 2007
Posts: 339

Post TableReorder part three: weird columnselection Reply with quote
Hi,

didn't know exactly if it is a bug. Maybe a better solution is not possible but i get selectionEvents for columns which shouldn't exist.

In your demo i add a button to reduce the columns for the tab "Table" like:
Code:
((PersonTableModel)originalModel).setColumns(new String[] {"Name", "Country", "Telephone", "Married"});


* select all cells of a row
* reduce the columns
=> the TableStyleSelector (TableReorder) adds columns in reselectTableRows which are no more there!
triggered by a structureChanged but the tableColumnModel is not updated at this time!

In the demo it is no problem but if there was a listener on selection changed with wrong columns it is a nightmare!

Maybe you can check the columns of the model before add a selection?
That's what i did now in my method as workaroud:
Quote:

if (table.getSelectedColumns().length > table.getModel().getColumnCount()) => do nothing


Kind regards,
michael
Wed Jan 03, 2018 4:08 am View user's profile Send private message
support



Joined: 21 Feb 2006
Posts: 1457

Post Reply with quote
Hello,

I think that it is a java bug that SelectionModel lets you select columns that are not there, I've had this problem before. I will add the check as you said.

Thanks for the suggestion.
Thu Jan 04, 2018 5:57 am View user's profile Send private message
support



Joined: 21 Feb 2006
Posts: 1457

Post Reply with quote
Hi,

The check for selecting columns that do not exist after a reorder event has been put in version 4.17.

Thanks!
Fri Feb 09, 2018 6:16 am View user's profile Send private message
Display posts from previous:    

Reply to topic    Citra Technologies Forum Index » Report a Bug All times are GMT - 5 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group