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.
After modifying the Table Layout to remove some display columns, I used the Query Editor to add a parameterized query a column that is not to be displayed. After adding the query criteria and switching back to the Designer, the column that has the query criteria reappeared as a display column in the Table To reproduce: 1) Add a Table component 2) Drop a TRIP table onto the Table component 3) Using the Customizer, remove the tripid and personid columns from the display column 4) Edit the query on the tripRowSet and add a paramterized query for personid 5) Switch back to the Designer personid is restored as a display column in the Table
Since Matt added the Dataprovider listener, assigning this to him to take care of this bug.
Created attachment 47373 [details] diff of proposed fix
I've attached a proposed fix (see attachment diff-0824-1830.txt), which is currently under review. In this diff, before reconstructing the table columns, we try to determine whether the existing bindings will throw an ELException. We only reconstruct the table columns if an ELException is detected. This may prove a good algorithm for determining whether to reconstruct in response to a change in the dataprovider's wrapped data.
Adding wjprakash, sandipchitale to the CC list so they can see the proposed fix.
wjprakash wisely points out that we can remove columns that will throw an ELException rather than perform the more drastic maneuver of reconstructing the table. I will revise the proposed fix.
Created attachment 47562 [details] diff of revised proposed fix
The diff looks OK to me.
Created attachment 47783 [details] diff of integrated fix
Fixed. Checking in webui/src/designtime/com/sun/webui/jsf/component/TableRowGroupDesign Info.java; /cvs/woodstock/webui/src/designtime/com/sun/webui/jsf/component/TableRowGroupDes ignInfo.java,v <-- TableRowGroupDesignInfo.java new revision: 1.5; previous revision: 1.4 done One note of interest. CachedRowSetXImpl.setCommand calls release, which leads to an invocation of CachedRowSetDataProvider.fireProviderChanged. Following the call to release, setCommand calls propertyChangeSupport.firePropertyChange, which leads to (1) the field keys updating based on the new command and (2) an invocation of CachedRowSetDataProvider.fireProviderChanged. The net effect is that fireProviderChanged is called twice, first with the old field keys in place and subsequently with the new ones in place. In my opinion, this is not a flaw in CachedRowSetXImpl: release and firePropertyChange are firing two distinct events--it just so happens that they both trigger calls to fireProviderChanged. Unfortunately, the distinction in *how* the provider has changed is lost; there is no way to tell whether the number of rows have changed (due to the call to release) or whether the field keys have changed (due to the call to firePropertyChange). This is just a limitation in the dataprovider API. The two consecutive invocations of fireProviderChanged causes ProviderListener.providerChanged to be called twice, but the effect of the repetition is benign: the first invocation never catches an ELException, precisely because the old field keys are still in place. Thus the first invocation is effectively a no-op. The second invocation actually catches any ELException resulting from the update to the field keys.
Unfortunately I was able to reproduce this bug on SunOS sparc: Product Version: NetBeans IDE Dev (Build 200708300000) Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b05 System: SunOS version 5.10 running on sparc
And 1 more note: a Table column, which was added to column set, but wasn't related to DB table, has been disappear after modification of CachedRowSet in Query Editor.
Oh, I'm very sorry, just now I see that this bug was fixed on 08/30/2007. And the fix was not included into build 0708300000. But there is no newer build now. FIXED status is restored.
Verified on: Product Version: NetBeans IDE Dev (Build 2007090300000) Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b05 System: SunOS version 5.10 running on sparc