Problem with showing panels

Hi,

I have a problem with showing panels. When I show a panel which was previously hidden, it shows all the elements inside it, even the hidden ones. How can I solve this?

Give details. How are you doing that? Does layoutChildElements() solve?

I.e., I have a panel like this

[xml]

<panel id="panel_1" childLayout="vertical" visible="false">

<text style="nifty-label" text="Text 1"/>

<text style="nifty-label" text="Text 2" visible="false"/>

</panel>

[/xml]



Then from controller I try to show this panel by following code

[java]

nifty.getCurrentScreen().findElementByName("panel_1").show();

[/java]

It will show this panel and both Text 1 and Text 2, even though Text 2 must be hidden.

It might be not a problem, it might be the panel behavior. I think you will have to re-hide the text 2 when you show then panel 1. Btw, when elements haven’t their id set, and it’s gonna be a problem. Try to set different ids for the text elements, and try again.