Extends custom component

Hello. I made custom client side component. When i extending server side implementation i getting “does not contain implementation for extended component error”, is it normal ? If yes, why i can extend vaadin components ?

Which version of Vaadin are you using? Can you somehow share your code?

Do you have the @Connect annotation in your client-side Connector class?

-Olli

I’m using Vaadin 8. And i know Vaadin very well since 6->7->8 version. Let me explain what i want.

I need to make a new widget/component. I have 3 modules (client, client-compiled, server), coz @Connect annotation must have reference on a server implementation and server must depends on a client-compiled → client to get JS then if we put server component in to server module we will have cycle dependecies. So, we put server implemintation in to client module, and after any change we need to recompile client module then redeploy main war. Would be my will, I would use OSGI, but… So i got the idea. We can create dumb server component in module client and then extend it in server module and all what i need to do is redeploy war or do hot swap.

client module

[code]
package my.project;

public class MyComponent extends AbstractComponentContainer {
//impl…
}
[/code]client moudle gwt package

package my.project.client;

public class MyWidget extends SimplePanel {
  //impl....
}

package my.project.client;

@Connect(MyComponent.class)
public class MyWidgetConnector extends AbstractComponentContainerConnector {
   //impl...
}

server module - works.

[code]
package my.project;

public class MyUI extends UI {
@Override
protected void init(VaadinRequest vaadinRequest) {
MyComponent aComponent = new MyComponent();
setContent(aComponent);
}
}
[/code]server module - “does not contain implementation for extended component error”

package my.project;

public class MyExtendedComponent extends MyComponent {
    //impl.....
}
[/code][code]
package my.project;

public class MyUI extends UI {
    @Override
    protected void init(VaadinRequest vaadinRequest) {
        MyExtendedComponent aComponent = new MyExtendedComponent();
        setContent(aComponent);
    }
}

From the code I can see, it should just work. If you can use MyComponent in your MyUI, you should definitely be able to use MyExtendedComponent, it’s basically the same as you extend from a Vaadin button.
Can you try in your MyUI class, create a VerticalLayout which would include both MyComponent and MyExtendedComponent, and see if either one of them can be rendered? If MyComponent can be rendered and MyExtendedComponent cannot, then it would be really weird, and if possible I would like to see the implementation of both classes for further investigation.