【发布时间】:2015-10-19 04:45:09
【问题描述】:
我有一个包含 2 个组件、一个按钮和面板的 JSF 页面。该按钮调用 jQuery toggle 来隐藏和显示面板。我希望当页面加载时,面板最初是隐藏的,这样当我第一次按下按钮时,面板就会显示出来。
<p:commandButton onclick="PF('panelMatches').toggle()" value="Matches" type="button" />
<p:panel id="button_panel" widgetVar="panelMatches" closable="true" toggleable="true">
Matches: 0
</p:panel>
使用此代码,面板最初始终可见。
【问题讨论】:
标签: jsf jsf-2 primefaces panel conditional-rendering