CustomComponent does not repaint its layout if click event happens

Hi @ll,

i got a strange problem with a custom component. The custom component owns a vertical layout as composition root and also some subclasses which are manipulating the vertical layout. The custom component should repaint its layout after a button is clicked and after the subclasses have manipulated the vertical layout.

The subclasses are some logical “processors” which are adding or removing components from the vertical layout whithin a specific logic. It seems all to work correctly. The (click-)event is fired, the subclasses are called from the method “componentEvent” and manipulating the layout but the view in the browser still remains the same as it was before the button was clicked. So no repainting happens.

I tried some different ways in the custom component to start the repaint of the vertical layout like


...
		this.setCompositionRoot(null);
	        this.setCompositionRoot(this.theLayout);
...

or even


...
		this.requestRepaint();
...

but got no result at all. Can someone point me to the right direction what i have to do, so the repainting in the browser happens? Would be great …

Thanks everybody

Udo

Hi,

got it working now! I was pretending that after adding / deleting new components to the layout the layout has to be repainted completely. So i first had this logic here (abstract):


...
this.thelayout.removeAll();
...
this.theLayout.addComponent(remainingComponent);
...
this.theLayout.addComponent(newComponent)
...
this.setCompositionRoot(null);
this.setCompositionRoot(this.theLayout);
...

or


...
this.thelayout.removeAll();
...
this.theLayout.addComponent(remainingComponent);
...
this.theLayout.addComponent(newComponent);
...
 this.requestRepaint();
...

but after a few testings i was figuring out that only the new component has to be simply added to the layout like this:


...
this.theLayout.addComponent(newComponent);
...

After i changed my code everything is working fine.

Regards

Udo