您可以設置使用<f:facet/>
標記面板標題。
例子:
<rich:panel id="myPanel">
<f:facet name="header">
<a4j:commandLink id="myPanelControl" value="Control"/>
</f:facet>
My panel content.
</rich:panel>
如果你想 「關閉」(你的意思是隱藏?)面板,你可以使用jQuery
使用jQuery實例:
<a4j:commandLink onclick="$('#myPanel').hide();"/> <!-- Or show(); -->
使用顯示器:
document.getElementById(elementId).style.display = 'none' //Or 'block' to show it back
使用<rich:componentControl/>
,但它不是必需的(在這種情況下,與<a4j:commandLink/>
)..
<rich:componentControl for="myPanelControl" event="onclick" operation="use jQuery or display here.."/>
如果你想啊,以執行bean的方法:graphicImage的,使用只action
和onComplete
:
<rich:componentControl event="onclick" action="#{...}" onComplete="hide script here"/>
或者你可以窩內<a4j:commandLink/>
一個圖像
<a4j:commandLink id="myPanelControl" action="#{myBean.executeSomething} value="" onComplete="$('#myPanel').hide()">
<h:graphicImage value="/myImage.jpg"/>
</a4j:commandLink>
有關面板的更多信息可以發現here和here。