gwt2 - With GWT, is there a way to not load widgets declared in uibinder xml files? -
one common design have gwt create widget contains 2 children: , b.
i declare these 2 widgets , b in uibinder file associated main widget.
what want load or not widget depending on if statement.
ideal approach set provided=true widget , set widget null when want not load widget. gwt throws error.
is there way declare widgets in uibinder , not loading them ?
thanks
edit: after lot of discussions, ideal approach declared field "provided=true" , "optional=true" when optional=true, createandbindui must not throw exception if field null. clean approach.
if think feature must exists in gwt, please star issue: http://code.google.com/p/google-web-toolkit/issues/detail?id=5699
edit 2 : using lazypanel described thomas seems better way handle this.
i stumbled on gwt issue, led me here, here's take on it, 20 months later.
use lazypanel
, set visible="false"
it's content not built until need (simply call setvisible(true)
reveal it, triggerring lazy-initialization of content.
lazypanel
integrated uibinder declare content in same uibinder template, if simplepanel
, without bothering creating subclass of lazypanel
. see https://developers.google.com/web-toolkit/doc/2.4/devguideuibinder#lazy
Comments
Post a Comment