I have a JSF page with one button. When button clicked I redirect another page after doing some database process. I want to use BlockUI because redirecting take some time. I added primeface BlockUI component but it do not work for me. I looked PrimeFaces showcase page but I can not do.
My JSF page (xhtml)
<h:body>
<h:form id="form1">
<div align="center">
<p:button id="btn1" value="database" outcome="database" />
<p:blockUI block="form1" trigger="btn1">
<p>Database process</p><br />
<p:graphicImage value="http://www.primefaces.org/showcase/images/loading.gif"/>
</p:blockUI>
</div>
</h:form>
</h:body>
BlockUI worked after I changed p:button with p:commandButton
<p:commandButton id="btn2" value="database" action="#{class.func()}" />
and my func() is
public void func()
{
return "database.xhtml";
}