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 206470 - Show script for insert does not always reflect data for selected row.
Summary: Show script for insert does not always reflect data for selected row.
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 7.1
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-16 10:37 UTC by bolsover
Modified: 2012-04-20 10:13 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
proposed patch following the suggestion of the reporter (2.06 KB, patch)
2012-02-25 15:22 UTC, matthias42
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description bolsover 2011-12-16 10:37:02 UTC
Using the 'show script for insert' feature does not always reflect data of selected row.

The problem can be reproduced by first retrieving data from some table, selecting the top (#1) row from the table, right click and select 'Show script for insert'. The data returned will correctly reflect the selected row.

Now click one of the column headers to force a different sort of the data and repeat the row selection process and 'Show script for insert'.  For the top row of the table, the data displayed will be the same as before rather than the newly sorted data.

I have not checked the code but it seems likely that there needs to be a call to convertRowIndexToModel(someTable.getSelectedRow()) to ensure the correct row of the table model data is used.

db
Comment 1 matthias42 2012-02-25 15:22:03 UTC
Created attachment 116104 [details]
proposed patch following the suggestion of the reporter
Comment 2 Jan Peska 2012-04-19 11:55:42 UTC
(In reply to comment #1)
> Created attachment 116104 [details]
> proposed patch following the suggestion of the reporter

Thanks matthias, your patch works just fine.
Comment 3 Jan Peska 2012-04-19 12:02:00 UTC
fix: http://hg.netbeans.org/core-main/rev/72fa32370df8
Comment 4 Quality Engineering 2012-04-20 10:13:46 UTC
Integrated into 'main-golden', will be available in build *201204200400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/72fa32370df8
User: Jan Peska <JPESKA@netbeans.org>
Log: Issue #206470 - Show script for insert does not always reflect data for selected row.
Row index is converted to the model index -> right row is selected after the sorting is changed