Closed anne-k closed 1 year ago
Hello. GridExporter relies on GridHelpers in order to retrieve the headers (among other things); and the initialization of GridHelpers requires that the UI is locked.
When autoAttachExportButtons
is true
, GridHelpers is initialized earlier. When it's false, the initialization happens inside of the stream factory, and that access is never locked:
https://github.com/FlowingCode/GridExporterAddon/blob/98d22acbccb91b31c3af54b78bd1ce219d4971f1/src/main/java/com/flowingcode/vaadin/addons/gridexporter/CsvInputStreamFactory.java#L42
As a workaround, please call GridHelpers.getSelectionFilter(grid);
immediately after initializing the grid (that should avoid the late initialization that throws an exception).
I'll keep this issue open in order to deliver a proper fix.
Thank you! It works! Just a side note, it seems to be GridHelper rather than GridHelpers. Thank you for the quick reply and the workaround.
Hi,
Thanks for this plugin, it's very useful. I want to use it to export to CSV with a custom export button, which works... until I try to hide the buttons generated by the plugin, by setting exporter.setAutoAttachExportButtons(false). If I do that, when I click my export button I get an empty file, and this exception in the application log:
The only difference is the AutoAttachExportButtons setting. Do you have any idea what could be causing this? I'm using Vaadin 23.3.0 and addon version 1.4.0.