Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others


0 votes
in Technique[技术] by (71.8m points)

jsf 2 - How to hide and show p:panel on commandbutton click

i have the following problem:

I'm new to JSF2 and primefaces.

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.

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">

How can I hide this outpanel when the page loads the first time?

How can I hide it when I click the CommandButton, and only show it again if the processing in my bean is successful?


See Question&Answers more detail:os

Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)


i have to put

   closable="true" toggleable="true" 

attributes in p:panel... Thanks

Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

547k answers


35.4k users