我從展示中遵循此示例:http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=popup&sample=login&skin=blueSky 它顯示了我如何點擊鏈接來打開popupPanel並將該面板追加到該鏈接的相同位置。但我希望如果再次點擊,它會關閉面板。任何人都知道如何做到這一點?這裏是我的代碼如何從同一鏈接中打開和關閉rich:popupPanel
<h:outputLink value="#" id="sb-dd-ol" >
<rich:componentControl event="click" operation="show" target="sb-dd-pp">
<a4j:param noEscape="true" value="event"/>
<rich:hashParam>
<a4j:param noEscape="true" name="top"
value="jQuery(#{rich:element('sb-dd-ol')}.parentNode).offset().top +
jQuery(#{rich:element('sb-dd-ol')}.parentNode).height()" />
<a4j:param noEscape="true" name="left"
value="jQuery(#{rich:element('sb-dd-ol')}.parentNode).offset().left" />
</rich:hashParam>
</rich:componentControl>
Test
</h:outputLink>
<rich:popupPanel id="sb-dd-pp" autosized="true" modal="false"
moveable="false" resizeable="false" followByScroll="false">
This is a test
</rich:popupPanel>