单击RadioButton在PrimeFaces中扩展手风琴面板 [英] Expanding Accordion Panel in PrimeFaces with a RadioButton click
问题描述
下面是我要实现的布局快照.
Below is the snapshot of the layout I'm trying to achieve.
我在这里有两个问题/问题:
I have two questions/problems here:
-
现在,该页面加载,所有手风琴面板均打开.我希望它最初处于关闭状态(如选项1中一样).
Right now,the page loads with all the accordian panels open. I want it initially to be in the closed state (like in option 1).
单击选项卡附近的单选按钮时,选项卡应展开.如果单击另一个单选按钮,则与该单选按钮关联的新选项卡应展开,而另一个应关闭.
On click of the Radio button near the tab, the tab should expand. If I click on another radio button, the new tab associated with the radio button should expand, and the other one should close.
我们如何做到这一点?
我没有看到任何切换功能或与PrimeFaces手风琴相关的任何东西.仅存在widgetVar.show()函数,但对我没有帮助.
I don't see any toggle function or anything associated with PrimeFaces accordian. There is only widgetVar.show() function, but it's not helping me.
推荐答案
要先关闭手风琴面板标签,请尝试将activeIndex设置为-1(或任何与现有面板不对应的值).我尚未在手风琴面板中使用多个选项卡对此进行过测试,但它应该可以工作:
To begin with your accordion panel tabs closed try setting activeIndex to -1 (or any value that does not correspond to an existing panel). I have not tested this with multiple tabs in an accordion panel, but it should work:
<p:accordionPanel activeIndex="-1">
这篇关于单击RadioButton在PrimeFaces中扩展手风琴面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!