Search code examples
gxt

GXT Attached / Rendered


I have a GXT ContentPanel instance (cp). I attempt to add a Text object to the content panel as below:

Text text = new Text("Main Content Window");
cp.add(text);

However, the Text is not visible even though I did text.setVisible(true). In my debugger, I saw that the content panel (cp) does have the text object added to the cp.items list. However, the text object has "rendered = false" and "attached = false".

Thanks for Help!


Solution

  • you may add the text to ContentPanel using Label which is straight forward.

    by the way text is not not component to add to the panel(Contentpanel/ layout container) we can add only component to the container.