I’m working on figuring out the whole custom components thing. After a few hours of online guides and some copy-pasting from the Cuba source I’ve managed to get a test project cobbled together. But when I go to a screen which uses my custom component I only see this message:
Widgetset ‘com.company.artfulphoenix.web.toolkit.ui.AppWidgetSet’ does not contain an implementation for com.company.artfulphoenix.component.TestComponent. Check the connector’s @Connect mapping, the widgetset’s GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions.
Here’s the project. I’ve tried to set it up to mirror the Cuba source. The web module has the component loader and wrapper, the toolkit module has the client-side component and connector, and the widgets module has the server-side component.
I’ve tried to keep everything about as simple as it gets. Here’s the client component:
package com.company.artfulphoenix.web.toolkit.ui.component.client.test;
import com.google.gwt.user.client.ui.Widget;
public class TestWidget extends Widget {
public static final String CLASSNAME = "test-widget";
public TestWidget() {
this("Hello, World!");
}
public TestWidget(String text) {
getElement().setInnerHTML(text);
getElement().addClassName(CLASSNAME);
}
}
The server component:
package com.company.artfulphoenix.component;
import com.vaadin.ui.AbstractComponent;
public class TestComponent extends AbstractComponent {
private static final long serialVersionUID = 3009534414097007546L;
}
The connector:
package com.company.artfulphoenix.web.toolkit.ui.component.client.test;
import com.company.artfulphoenix.component.TestComponent;
import com.google.gwt.core.client.GWT;
import com.vaadin.client.ui.AbstractComponentConnector;
import com.vaadin.shared.ui.Connect;
@Connect(TestComponent.class)
public class TestConnector extends AbstractComponentConnector {
private static final long serialVersionUID = -4732439674081475542L;
@Override
protected TestWidget createWidget() {
return GWT.create(TestWidget.class);
}
}
And the module descriptor:
<?xml version="1.0" encoding="UTF-8"?>
<module>
<inherits name="com.haulmont.cuba.web.widgets.WidgetSet"/>
</module>
Anyone know what I’ve done wrong here? I understand this may be more of a Vaadin or GWT problem, but I figured I’d try here first.