I'm using IJC 5.6.0 and i've written an IJC plugin which requires a GridView to be open, and the user to have selected rows in that grid view.
After some actions taken on those row contents by the plugin, it updates some of their column's values in the local database (via DFEntityDataProvider.update(…)).
The problem is that i cannot get the grid view to update its UI to reflect the changes without closing the grid view tab in IJC and reopening that view from the left pane. I've tried, one at a time:
- Doing nothing, assuming that some listener chain will fire
- Grabbing the WBTable and invoking repaint()
- Grabbing the VertexTableModel from the WBTable and invoking:
- updateTableData(…) passing in a List of the row ids for the rows updated successfully via the entity data provider
and none of these resulted in the UI reflecting the new data in the local database.
Can someone give me a pointer as to what i can do to programmatically address this?
Calling DFEntityDataProvider.update method should really start chain of events which finally repaints content of grid view or any other widget in form.
This is the same way how for example paste in gridview works. It also updates value in data layer (entity data provider) and all other layers above (mainly user interface) are notified through listeners.
Is it strange that it doesn't work as there are no known issues with copy/paste.
As for other approaches:
- repaint on WBTable could help if the problem is somewhere in Swing or in this widget, but it expects that data model is correctly updated. It is not much likely that this can help
- calling methods on table model can help, but it should not be needed as model should reflect changes done using EntityDataProvider.
Maybe it can be useful to know what value is returned from various objects after you call update(), specifically what return DFEntityDataProvider.getData(...) - is this returns correctly updated value then what returns vertexTableModel.getValueAt(...) and possibly also appropriate DFResultSet's rootVertex.getData(...).
One more idea: this auto-refresh data in gridview can work only when DFEntityDataProvider instance is in the same instance of schema like opened gridview. I mean if you are connected twice and doing changes in one connection (even within the same running IJC) then it won't refresh data in forms opened within a different connection.
If it's possible feel free to send me relevant part of your code (this part with update call) so I can check it (phamernik at chemaxon dot com).