Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to dynamically show/hide GXT panels?
    text
    copied!<p>I'm creating ContentPanel and hide it:</p> <pre><code>final ContentPanel infoPanel = new ContentPanel(); final TabPanel infoTabPanel = new TabPanel(); ... //Adding TabItems with some forms infoPanel.add(infoTabPanel); infoPanel.hide(); add(infoPanel); </code></pre> <p>Then in some Event Listener I try to show this hidden panel:</p> <pre><code>infoPanel.show(); infoPanel.layout(); </code></pre> <p>But this panel is shown without any data. Only if I click on tabs data appears.</p> <p>So how to hide/show this panel correctly?</p> <p><strong>EDITED:</strong></p> <p>I'm using GXT 2.2.4.<br> I'm creating ContentPanel with TabPanel which contains FormPanel and hide ContentPanel.</p> <p>Then in Event Listener I try to show this hidden panel, but it is shown without form. Only if I click on tabs form appears.</p> <p>Here is code:</p> <pre><code>protected void onRender(Element parent, int pos) { super.onRender(parent, pos); final ContentPanel infoPanel = new ContentPanel(); infoPanel.setAutoHeight(true); final TabPanel infoTabPanel = new TabPanel(); infoTabPanel.setAutoHeight(true); final FormPanel testForm = new FormPanel(); FieldSet fieldSet = new FieldSet(); fieldSet.setHeading("Information"); FormLayout fLayout = new FormLayout(); fieldSet.setLayout(fLayout); LabelField field1 = new LabelField(); LabelField field2 = new LabelField(); field1.setFieldLabel("Field1:"); field1.setName("field1"); fieldSet.add(field1); field2.setFieldLabel("Field2:"); field2.setName("field2"); fieldSet.add(field2); testForm.add(fieldSet); TabItem formTab = new TabItem("Form Tab"); formTab.add(testForm); infoTabPanel.add(formTab); TabItem longText = new TabItem("Long Text"); longText.addStyleName("pad-text"); longText.addText("Long Text" + "&lt;br&gt;" + "Long TextLong Text"); infoTabPanel.add(longText); infoPanel.add(infoTabPanel); infoPanel.hide(); Button buttonShow = new Button("show"); buttonShow.addSelectionListener(new SelectionListener&lt;ButtonEvent&gt;() { @Override public void componentSelected(ButtonEvent ce) { infoPanel.show(); } }); Button buttonHide = new Button("hide"); buttonHide.addSelectionListener(new SelectionListener&lt;ButtonEvent&gt;() { @Override public void componentSelected(ButtonEvent ce) { infoPanel.hide(); } }); add(infoPanel); add(buttonShow); add(buttonHide); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload