Richfaces 中<rich:modalPanel />有3中开启与关闭的方式分别如下
1.使用<rich:componentControl />标签
<h:graphicImage value="/open.png" id="showlink"/> <rich:componentControl for="modalPanelId" attachTo="showlink" operation="show" event="onclick"/> <h:graphicImage value="/close.png" id="hidelink"/> <rich:componentControl for="modalPaneld" attachTo="hidelink" operation="hide" event="onclick"/>
2.使用含有EL的js调用方式
<a href="#" οnclick="#{rich:component('modalPaneld')}.show() ">开启</a> <a href="#" οnclick="#{rich:component('modalPaneld')}.hide()">关闭</a>
3.js方式(调用richefaces内置的js)
Richfaces.showModalPanel('modalPaneld')//开启 Richfaces.hideModalPanel('modalPaneld')//关闭