Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Component or widget

maurice noel
6 years ago Aug 11, 2015 4:41pm
Marko Grönroos
6 years ago Aug 11, 2015 9:13pm

That is a rather broad question. The simple answer is: if you can't do what you want with a (server-side) custom component, but you can do it with a (client-side) custom widget, then that's what you need to do.

Server-side component customization (by extending them) and composition (with CustomComponent or by extending layouts) is usually the easiest and preferred way to add functionality to components or create new components.

Server-side customization has much tighter limits than what you can do with client-side widgets, so if you want something that really isn't supported by the Vaadin widgets or the server-side API, you need to make custom widgets.

I personally always try to find a server-side solution, even a tricky solution that maybe uses CSS tricks. Only if it's completely impossible to do that way, I use a client-side solution (custom widget, component extension, or with Grid a custom renderer).

maurice noel
6 years ago Aug 12, 2015 4:50am