One common design I have with GWT is to create a widget which contains two children: A and B.
I declare these two widgets A and B in the uibinder file associated to my main widget.
What I want to do is to load or not widget A depending on an if statement.
Ideal approach is to set provided=true for widget A and to set widget A to null when I want to not load this widget. But GWT throws an error.
Is there a way to declare widgets in uibinder and then not loading them ?
thanks
EDIT: after a lot of discussions, an ideal approach is to declared a field "provided=true" and "optional=true" when optional=true, createAndBindUI must not throw an Exception if the field is null. This is a clean approach.
If you think that this feature must exists in GWT, please star this issue: http://code.google.com/p/google-web-toolkit/issues/detail?id=5699
EDIT 2 : using the LazyPanel as described by Thomas seems to be a better way to handle this.