How to toggle two p:panels with effects
Posted: 03 Sep 2010, 03:56
Hi all
Assuming I have the following two Panels under a Parent Panels, as show in code below
The toggleButton will toggle someBean.someCondition (ie from true to false, or from false to true), the code above work fine, however I wonder what is the best way to add some effects when toggle happen, for example panel 1 will explode, and panel two will drop in..
Any suggestion?
Thanks in Advance
Assuming I have the following two Panels under a Parent Panels, as show in code below
Code: Select all
<p:panel id="parentPanel" header="Parent Parent">
<p:panel id="panel1" header="Panel One" rendered="#{someBean.someCondition}">
<!-- Panel Content Skip -->
</p:panel>
<p:panel id="panel2" header="Panel Two" rendered="#{!someBean.someCondition}">
<!-- Panel Content Skip -->
</p:panel>
<p:commandButton id="toggleButton" value="Click me.." actionListener="#{someBean.togglePanel}" update="parentPanel"/>
</p:panel>
Any suggestion?
Thanks in Advance