Richfaces 中有3中开启与关闭的方式分别如下

http://rockjava.iteye.com/blog/185147

Richfaces 中<rich:modalPanel />有3中开启与关闭的方式分别如下

1.使用<rich:componentControl />标签

Xml代码

   1. <h:graphicImage value="/open.png" id="showlink"/>    
   2. <rich:componentControl for="modalPanelId" attachTo="showlink" operation="show" event="onclick"/> 
   3. <h:graphicImage value="/close.png" id="hidelink"/>   
   4. <rich:componentControl for="modalPaneld" attachTo="hidelink" operation="hide" event="onclick"/>  

<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调用方式

Xml代码

   1. <a href="#" onclick="#{rich:component('modalPaneld')}.show() ">开启</a>  
   2. <a href="#" onclick="#{rich:component('modalPaneld')}.hide()">关闭</a> 

<a href="#" onclick="#{rich:component('modalPaneld')}.show() ">开启</a>
<a href="#" onclick="#{rich:component('modalPaneld')}.hide()">关闭</a>

3.js方式(调用richefaces内置的js)

Xml代码

   1. Richfaces.showModalPanel('modalPaneld')//开启  
   2. Richfaces.hideModalPanel('modalPaneld')//关闭 

Richfaces.showModalPanel('modalPaneld')//开启
Richfaces.hideModalPanel('modalPaneld')//关闭

你可能感兴趣的:(xml,Richfaces,Blog)