Hello.
For my project I need to implement few custom components. I implement it as single vaadin addon single component for future integration simplicity. I have seen some other addons, but all of them are made with different design. I wish I could compose my own custom addon object design to keep the same design among all of the addons I will make.
At this moment I use the idea I wish to explain:
- Server-side component part: Java class that extends some of the Vaadin Abstract*Component. It used to represent the component at the serverside.
- Client-side component. It is a class, derived from one of the Vaadin Client-side component V*Connector. This is a gwt compillable class, that used to delegate all the hard work to the underliyng object (name it ComponetDelegate)
- Component delegate class. It takes the client-side connectors widget and composes some DOM magic, attaching the magic to the connectors widget.
- State class. It is derived from some of the Vaadin AbstractState class. It is used to passthrough the state of the component between client and server to both sides.
- ClientRpc, ServerRpc interfaces. These ones are used to force oposite side component part to make trigger some action. Here I can pass some state elements as an argument.
I have actually couple of quastions: 1) Do I need to fix that design, Is it close to design of Vaadin components, so my custom ones will work good enough being in vaadin components environment. 2) I need to understand how to handle component binding moment: I have a custom component, which sometimes can be detached from the application UI. So, when I need to attach it again, I have to notify the client-side component, that it has to draw it’s elements again. But I don’t know how.At this moment I implicitly ask my serverside component to make a rpc call to redraw the things.