Vaadin 8 - Grid custom Renderer

Hi,
I’m dealing with grid and custom renderer to get double to currency value format (display 10.000,00 for 10000.0 double value)

As described in vaadin documentation, I create 3 classes:

ServerSide Renderer

public class CurrencyGridRenderer extends AbstractRenderer<Object, Object> {

    private static final long serialVersionUID = -66300138811340773L;
    
    public CurrencyGridRenderer() {
        this("");
    }
    
    public CurrencyGridRenderer(String value) {
        super(Object.class, value);
    }
}

Client Side Renderer

[code]
public class CurrencyGridClientRenderer implements Renderer {

@Override
public void render(RendererCellReference cell, Double data) {
    setTextContent(cell.getElement(), "Euro "+ data);
    
}

private native void setTextContent(Element elem, String text)
/*-{
    elem.textContent = text;
}-*/;

}
[/code]Connector

[code]
@Connect(com.test.utilities.CurrencyGridRenderer.class)
public class CurrencyGridRendererConnector extends AbstractGridRendererConnector {

private static final long serialVersionUID = -66300138811340773L;

@Override
public CurrencyGridClientRenderer getRenderer() {
    
    return (CurrencyGridClientRenderer) super.getRenderer();
}

}
[/code]In my class, I set renderer as follow:

Column<ProductAmount, Double> valueCol = (Column<ProductAmount, Double>) costGrid.getColumn("value"); valueCol.setRenderer(new CurrencyGridRenderer()); I get my grid empty. I I change valueCol.setRenderer(new CurrencyGridRenderer()); to valueCol.setRenderer(new TextRenderer()); everything works fine.

I have to compile widgetset in some ways? In another post someone put the client renderer class and connector class in resources/…/widget/client and add in widgetset.gwt.xml file located in resources/…/widget/ and compile widgetset. I tried but no luck.

Someone had the same issue? I miss some step?
Thank you for your support!

I have the same issue since 2016. It is currently not possible to create a fully functional custom grid renderer as of now (july 2017). At least if you follow the official documentation. There is a strange widgetset compilation bug that prevents the Renderer from being used.

I found a way however that works barely. You can subclass an existing renderer like this:
https://github.com/vaadin/framework/issues/8656 (See comment from Mar 9).

That one works for me without any widgetset recompilation. But there are limits and it seems like a hack to me.