2010-04-30 12 views
5

abbastanza semplice:visualizzare condizionale un pannello modale 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> 

Quello è ovviamente valida EL. Qual è il metodo più conciso che mostro condizionatamente myModelPanel in questo modo?

Grazie IA

risposta

1

Prova a chiamare il metodo JS vuoto

1

È possibile utilizzare questo:

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

uso questo:

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

Dal momento che la condizione è disponibile solo nel sottofondo stato dovresti usare questo:

<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() 
}" 
Problemi correlati