如何在命令按钮上隐藏和显示p:panel [英] How to hide and show p:panel on commandbutton click
问题描述
我有以下问题:
我是JSF2和Primeface的新手.
I'm new to JSF2 and primefaces.
在用户输入字符串并单击CommandButton之后,页面上有一个表,该表中将填充信息.单击按钮后,我希望在处理结束之前将其禁用.
I have a table in a page that will be populated with information, after the user enters a string and clicks a CommandButton. After clicking the button, I want it to be disabled until processing is over.
要禁用CommandButton,我需要执行以下操作;
To disable the CommandButton I'm doing the following;
<p:commandButton update=":outPanel" widgetVar="btnSend" id="btnsend"
value="Calcular" actionListener="#{calcBean.getTrfs}"
onclick="btnSend.disable()" oncomplete="btnSend.enable()" />
然后有一个面板,我想在其中显示其内容:
And then I have a panel where I want to show its contents:
<p:panel id="outPanel" widgetVar="outpanel">
#{calcBean.result}
</p:panel>
首次加载页面时,如何隐藏此面板?
How can I hide this outpanel when the page loads the first time?
单击CommandButton时如何隐藏它,并且仅在bean中的处理成功后才再次显示它?
How can I hide it when I click the CommandButton, and only show it again if the processing in my bean is successful?
谢谢.
推荐答案
已解决
我必须放
closable="true" toggleable="true"
p:panel中的属性...谢谢
attributes in p:panel... Thanks
这篇关于如何在命令按钮上隐藏和显示p:panel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!