On 13 nov, 01:05, doogster <[email protected]> wrote:
> On Oct 25, 10:45 am, Vincent <[email protected]> wrote:
>
> > I faced the same problem withLayoutPanelinside SimplePanel.
> > For now, the only workaround a found is the same than the one proposed
> > by Jeff, except that I extends theLayoutPanel.
>
> Extending LayoutPanel doesn't work for me in GWT 2.1.
>
> I've extended LayoutPanel like this:
>
> public class SimpleLayoutPanel extends LayoutPanel implements
> AcceptsOneWidget
> {
> @Override
> public void setWidget(IsWidget w)
> {
> this.clear();
> this.add(w);
> }
>
> }
>
> When I use it instead of a SimplePanel, calling PlaceController.goTo()
> gives me the following exception trace:
>
> com.google.gwt.event.shared.UmbrellaException: One or more exceptions
> caught, see full set in UmbrellaException#getCauses
[...]
> Caused by: java.lang.NullPointerException: null
beware of 'null's! ActivityManager will call setWidget(null) on the
AcceptsOneWidget, and most widgets aren't prepared to it and will
throw (layoutPanel.add(null) does, that's what you're experiencing)
Fix:
this.clear();
Widget widget = Widget.asWidgetOrNull(w);
if (widget != null) {
this.add(widget);
}
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.