0

I have a Grid, which have a TopToolbar and BottomToolbar. In the BottomToolbar, I added a CSVDataExporter:

CSVDataExporter csvDataExporter = new CSVDataExporter();
csvDataExporter.setDataFormatNameModel(new ResourceModel("csv.export.link.name"));
csvDataExporter.setDelimiter('|');
addBottomToolbar(new ExportToolbar(this).addDataExporter(csvDataExporter));

I have the link, so I can export the table to CSV fine!

BUT! How could I change the CSV export link to be a Button, but do the same and be at the same place as it was? Thank you!

victorio
  • 6,224
  • 24
  • 77
  • 113
  • You could use css to make the links look like buttons: http://stackoverflow.com/questions/710089/how-do-i-make-an-html-link-look-like-a-button – papkass Nov 04 '13 at 13:15

1 Answers1

1

The Link is generated by your ExportToolbar using the createExportLink method. To generate something else (as in any other component) you can extend the ExportToolbar to override this method. If this is the only place where you need this functionality, you can do so by implementing an anonymous inner class.

Generally you'll want this method to return a Component that has it's own markup, like a Panel, that contains whatever you want to display as your Exportlink or -button.

Nicktar
  • 5,548
  • 1
  • 28
  • 43