Wednesday, May 13, 2009

java.lang.IllegalStateException: This widget's parent does not implement HasWidgets

java.lang.IllegalStateException: This widget's parent does not implement HasWidgets

 

Ugh…that’s my nasty exception.

Apparently, I was using a class that extends composite, as the books I’m reading suggest. But, if you do, apparently if you add the composite to another page as though it were a panel, well, that won’t work. Either I should have extended a Panel class for my composite container, or I need to implement the HasWidgets interface.

 

import com.google.gwt.user.client.ui.HasWidgets;

 

Apparently, these are the methods involved in the HasWidgets interaface. The actually look like they make sense:

 

@Override
public void add(Widget w) {
    // TODO Auto-generated method stub
}

@Override
public void clear() {
    // TODO Auto-generated method stub
}

@Override
public Iterator<Widget> iterator() {
    // TODO Auto-generated method stub
    return null;
}

@Override
public boolean remove(Widget w) {
    // TODO Auto-generated method stub
    return false;
}

 

I’m just going to leave them blank for now and see if it works.

No comments:

Post a Comment

Followers