2010-04-30 42 views
5

非常簡單:有條件地顯示一個RichFaces的模式面板

<a4j:commandButton id="bob" 
     action="#{MyBacking.doAction}" 
     image="/img/btn.png" 
     reRender="stuff" 
       oncomplete="#{not empty MyBacking.myCondition ? #{rich:component('myModelPanel')}.show()" : <do nothing>}" 
     ajaxSingle="true"> 
    </a4j:commandButton> 

那明顯無效EL。以這種方式有條件地顯示myModelPanel的最簡潔的方法是什麼?

由於IA

回答

1

嘗試調用空JS方法

1

您可以使用此:

<a4j:commandButton data="#{ordre.render}" 
        oncomplete=" if (data == true) { 
            #{rich:component('popup')}.show() 
           } else { 
            alert('error'); 
           }" /> 
0

使用本:

    <a4j:commandButton value="verify" 
             oncomplete="#{rich:component('popup')}.show()" > 
         <a4j:support event="onclick" 
            onsubmit="if (!verifInputs()){return false;}"/> 
        </a4j:commandButton> 
0

由於該情況只是在底層提供你應該使用這個:

<a4j:commandButton id="bob" 
     action="#{MyBacking.doAction}" 
     image="/img/btn.png" 
     reRender="stuff" 
       oncomplete="if (#{not empty MyBacking.myCondition} == true) { 
           #{rich:component('myModelPanel')}.show() 
          }" 
     ajaxSingle="true"> 
</a4j:commandButton> 
0
oncomplete="if (#{ MyBacking.myCondition}) { 
#{ 
rich:component('myModelPanel' 
}.show() 
}" 
相關問題