GridFileDownloader

I published a moment ago my initial version for a downloader extension for Grid.

Add-on can be found in the
directory
.

See the list of
known issues
.

protected void addDownloadColumn() {
Indexed dataSource = grid.getContainerDataSource();
FontAwesome icon = FontAwesome.DOWNLOAD;
dataSource.addContainerProperty(icon, String.class,
createDownloadHtml());
grid.getColumn(icon).setRenderer(new HtmlRenderer());
grid.getHeaderRow(0).getCell(icon).setHtml(createDownloadHtml());
grid.getColumn(icon).setSortable(false);
setDownloadColumn(icon);
}

this method does not support GeneratedPropertyContainer or BeanItemContainer, what do you recommend in this case?

one of the possible solutions was to
@Override
protected void addDownloadColumn() {
//Container.Indexed
GeneratedPropertyContainer
dataSource = (GeneratedPropertyContainer) grid.getContainerDataSource();
FontAwesome icon = FontAwesome.DOWNLOAD;
//dataSource.addContainerProperty(icon, String.class,
// createDownloadHtml());
dataSource.addGeneratedProperty(icon, new PropertyValueGenerator() {
@Override
public String getValue(Item item, Object itemId,
Object propertyId) {
return createDownloadHtml();
}

                @Override
                public Class<String> getType() {
                    return String.class;
                }
            });
            grid.getColumn(icon).setRenderer(new HtmlRenderer());
            grid.getHeaderRow(0).getCell(icon).setHtml(createDownloadHtml());
            grid.getColumn(icon).setSortable(false);
            setDownloadColumn(icon);
        }

Hello,

I am getting widgetset not found errors. Yes I recompiled my widgetsets, other plugins work fine, all except this one.
Any ideas?

INFO: Requested resource
[/VAADIN/widgetsets/org.vaadin.gridfiledownloader.GridFileDownloaderWidgetset/org.vaadin.gridfiledownloader.GridFileDownloaderWidgetset.nocache.js] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.

Thank you.

Hi!

Haven’t run into this myself, I’m afraid. Does your MyWidgetset.gwt.xml contain an import to the GridFileDownloader? Have you cleaned/refreshed your project? Any other errors during the widgetset compilation or otherwise? Have you tried the more strict or detailed compilation options? Which Vaadin version are you using? Is your project an Ivy project created with the Eclipse plugin, or a Maven project created by one of the archetypes, or something else entirely?

Check out new GridActionRenderer add-on’s DownloadActionGrid for a simplified use case that supports column reordering out of the box.