Singleton Component

Hi,
why I can’t use Singlton pattern for CRUD UI component page and update the page components according to each event instead of
create new object for each request?

when I try to do it I got the below exception :-

at com.vaadin.ui.AbstractSingleComponentContainer.removeFromParent(AbstractSingleComponentContainer.java:177) ~[vaadin-server-7.7.9.jar:7.7.9]

at com.vaadin.ui.AbstractComponentContainer.addComponent(AbstractComponentContainer.java:211) ~[vaadin-server-7.7.9.jar:7.7.9]

at com.vaadin.ui.CssLayout.addComponent(CssLayout.java:123) ~[vaadin-server-7.7.9.jar:7.7.9]

Regards,

Hi,

if I understand your case correctly, you want to create a single Component instance and reuse that in multiple places? That’s just supported by Vaadin due to how the way the framework is designed, as the client side and server side need to keep track of each other.

-Olli

Hi,
I need to write single component for multi users and can access the component concurrently.

Regards,

Hi,

You’ll need to implement that in the application layer.
Server Push
will help you pass the updates to the different UIs.

-Olli

Hi,
Thanks for reply Mr. Olli, That sounds great.

Regard,