This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 256206 - TableCellEditor getCellEditor(Object node, String columnID) called on wrong node when the column is sorted
Summary: TableCellEditor getCellEditor(Object node, String columnID) called on wrong n...
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Outline&TreeTable (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P1 normal with 2 votes (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-27 14:32 UTC by epele83
Modified: 2016-02-03 16:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description epele83 2015-10-27 14:32:19 UTC
I have an Outline view and I implemented the olv model using the org.netbeans.spi.viewmodel apis

I need to customize the cell editor so I've implemented the TableRendererModelFilter interface.

Now, if the column is sorted and I click on the cell, the object passed to the getCellEditor method is wrong, it's the same object as the outline was not sorted at all.

It's high priority on our end, so please if you can provide a fix or a workaround it would be really appreciated.

Thanks
Comment 1 epele83 2015-10-28 11:15:44 UTC
Digging more on the issue I've found that the same issue exists also for getCellRenderer(..) method.

I found also a possible patch to apply in:
org.netbeans.modules.viewmodel.DelegatingCellRenderer
org.netbeans.modules.viewmodel.DelegatingCellEditor

Instead to use:
Node n = DelegatingCellRenderer,getNodeAt(om, row) 

we can fix it using 
Node n = Visualizer.findNode(outline.getValueAt(row, 0))

I am not very sure about the patch but it works in all the tests I did.

Thanks
-Paolo
Comment 2 Martin Entlicher 2015-10-29 13:20:53 UTC
Reproduced.
Comment 3 Martin Entlicher 2015-10-29 14:12:09 UTC
Fixed by changeset:   293362:3840ea6ba356
http://hg.netbeans.org/core-main/rev/3840ea6ba356
Comment 4 Martin Entlicher 2015-10-29 14:57:03 UTC
I'm marking this as a candidate for 8.1 patch. It's too late to merge into 8.1 final release.

We'll not distribute patches for 7.4, but it can be fixed in a similar fashion there. You can create a patch yourself by applying the change to 7.4 sources and build the affected module. Then follow http://wiki.netbeans.org/DevFaqModulePatching Ask me, or write a comment here, if you need a help with this.
Comment 5 epele83 2015-10-29 23:08:11 UTC
Thank you for the patch, we have already put it in our platform.

Thank you again
-Paolo
Comment 6 Quality Engineering 2015-10-30 02:22:42 UTC
Integrated into 'main-silver', will be available in build *201510300002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3840ea6ba356
User: mentlicher@netbeans.org
Log: #256206: Convert rows to the model index before retrieving the node.
Comment 7 Jiri Prox 2015-12-16 12:08:56 UTC
verified by reporter (comment 5)
Comment 8 Martin Entlicher 2016-01-14 13:34:07 UTC
The fix is transplanted into release81 branch:
http://hg.netbeans.org/releases/rev/a24feab6f488
http://hg.netbeans.org/releases/rev/a700277cd50c
Comment 9 Jiri Prox 2016-02-03 14:12:12 UTC
epele83 can you please verify thins in the 8.1 patch1?

The staged update centers are

distro:
http://updates.netbeans.org/netbeans/updates/8.1/uc/final/distribution/catalog_stage.xml.gz

plugins:
http://updates.netbeans.org/netbeans/updates/8.1/uc/final/certified/catalog_stage.xml.gz

If you have question about applying the patch let me know

Thanks
Comment 10 epele83 2016-02-03 16:35:20 UTC
I applied the patch time ago on NB7.4
It worked, I will test also the patch on NB8.1.