我有一个包含 2 个组件、一个按钮和面板的 JSF 页面。该按钮调用 jQuerytoggle
来隐藏和显示面板。我希望当页面加载时,面板最初是隐藏的,这样当我第一次按下按钮时,面板就会显示出来。
<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>
使用此代码,面板始终最初是可见的。