Howdy folks.
I’m back with another question about theming.
I’ve managed to extend/modify a button renderer for my grid
In my “server side” packages i have my renderer i use in my grid
[code]
import com.vaadin.ui.renderers.ButtonRenderer;
@SuppressWarnings(“serial”)
public class HtmlButtonRenderer extends ButtonRenderer {
public HtmlButtonRenderer() {
super();
}
public HtmlButtonRenderer(RendererClickListener listener) {
this();
addClickListener(listener);
}
}
[/code]and then under the widgetset.client package i have the connector
[code]
import com.vaadin.client.connectors.ButtonRendererConnector;
import com.vaadin.shared.ui.Connect;
@SuppressWarnings(“serial”)
@Connect(package.to.serversiderenderer.HtmlButtonRenderer.class)
public class HtmlButtonRendererConnector extends ButtonRendererConnector {
@Override
public VHtmlButtonRenderer getRenderer() {
return (VHtmlButtonRenderer) super.getRenderer();
}
}
[/code]and the client implementation
[code]
import com.google.gwt.user.client.ui.Button;
import com.vaadin.client.renderers.ButtonRenderer;
import com.vaadin.client.widget.grid.RendererCellReference;
public class VHtmlButtonRenderer extends ButtonRenderer {
@Override
public void render(RendererCellReference cell, String text, Button button) {
if (text != null) {
button.setHTML(text);
}
button.addStyleName(“v-button”);
button.addStyleName(“v-button-borderless”);
button.addStyleName(“no-padding”);
button.setVisible(text != null);
}
}
[/code]Aight, you compile and this works like a charm.
Now, i have a nice “commons” project and i wanted to put this in there. Same structure.
I put the jar in my original project, compile, but then the button is not rendered correctly.
Basically the “text” in the client renderer is always rendered as plain text, and the styles are not applied…it basically seems the client implementation is not even called.
I’ve tried also to make it an addon: compiled theme and widgetset, exported as vaadin addon (.jar), included the jar in my original project and linked the jar widgetset file in the widgetset.gwt.xml declaration.
Compiled ( and i see the addon being processed in the compilation) and … doesn’t work either.
Am I doing something wrong? SOmething missing? Any suggestion is very welcomed!
Cheers.