如何在命令按钮单击上隐藏和显示p:面板

RLu*_*eac 4 primefaces jsf-2

我有以下问题:

我是JSF2和primefaces的新手.

在用户输入字符串并单击CommandButton后,我在页面中有一个表格,其中将填充信息.单击按钮后,我希望在处理结束之前将其禁用.

要禁用CommandButton我正在执行以下操作;

<p:commandButton update=":outPanel" widgetVar="btnSend" id="btnsend"
     value="Calcular" actionListener="#{calcBean.getTrfs}" 
     onclick="btnSend.disable()" oncomplete="btnSend.enable()" />  
Run Code Online (Sandbox Code Playgroud)

然后我有一个面板,我想要显示其内容:

<p:panel id="outPanel" widgetVar="outpanel">
         #{calcBean.result}
</p:panel>
Run Code Online (Sandbox Code Playgroud)

如何在第一次加载页面时隐藏此分页面?

单击CommandButton时如何隐藏它,如果我的bean中的处理成功,则只显示它?

谢谢.

RLu*_*eac 7

解决了,

我必须把

   closable="true" toggleable="true" 
Run Code Online (Sandbox Code Playgroud)

p:panel中的属性...谢谢