Anchor click listener doesnt work.

Anchor download;
private final Button buttonExport = new Button(“Export”);
download = new Anchor(getStreamResource(), “”);
download.getElement().setAttribute(“download”, “testExportAgent.xml”);
download.add(buttonExport);

nothing happens, why?

Button will eat the event

You could try it other way round

Here is a more complete example of export functionality