PDA

View Full Version : I want to know what is the difference between onRender and constructor



cabe
14 Jan 2009, 2:42 AM
Hi,when I was going to create a new widget which would contain some child widgets,I am always confused whether I should create these widgets in constructor or in onRender() method. Now I just create them in the constructor. Is there any advantages or tricks if I do it in onRender()? :-/

gslender
15 Jan 2009, 4:42 AM
onRender is the correct place to create the widget dom elements - this is the model that GXT uses and should be followed to ensure lazy rendering where possible.

cabe
16 Jan 2009, 1:17 AM
Thank you gslender,you are always so kind to help rookies.Now I want make clear what is the advantage of lazy rendering? To save memory space? If there is no onRender() method in GXT -what will be in trouble?