0

I have a problem with the simplegrid class: in my project I have a class that extends Vertical Panel in which I put a simplegrid. The problem is that if I don't call the method initWidget I cannot see the simplegrid (it loads data, but doesn't display). I know that calling initWidget solves the problem because a few days ago my class extended Composite instead of Vertical Panel and everything worked fine.

Does anyone know why I have to call initWidget to make the simple grid to be displayed?

4

1 回答 1

1

Composite只是另一个小部件的包装器。例如,您可以包装一个VerticalPanel并向其添加两个Label小部件,一个作为标题,另一个在下方显示相关数据。

Composite小部件必须知道它应该包装这些其他小部件中的哪一个,并通过方法告诉它initWidget(Widget widget)。你必须调用一次,并且只调用一次,否则你会得到一个错误。

于 2012-07-12T08:37:02.797 回答