PDA

View Full Version : How to add new widget dynamicly



zouljisi
11 May 2010, 7:27 AM
when I use gwt panel to add a widget dynamicly in runtime it work well, but I use the Layoutcaontainer to add a widget it didn't work .It said the render will be called when add a widget to a gwt panel...I cofused about the add function of layoutcontainer, It won't render his child witch added to it...

jocy
11 May 2010, 7:55 AM
i don't understand very well what you wrote but i have you try to layout() your panel after adding he widget, because the widget could have be added but not shown.
this method refresh your panel or layoutcontainer...

f.sauter
11 May 2010, 1:26 PM
or say
myComponent.setLayoutOnChange(true) this should update the view after the add method aswell

sven
11 May 2010, 1:29 PM
I dont suggest to set that to true. It is better to call it manually only in cases you really need it.

zouljisi
11 May 2010, 6:25 PM
thank you, I'm really appreciated it. layout has worked.

jocy
11 May 2010, 11:25 PM
cool !!! it was a pleasure !!!