views:

380

answers:

3

Hello

Quite simple:

    <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>

Thats obviously invalid EL. What's the most concise method I conditionally show myModelPanel in this way?

Thanks IA

+1  A: 

Try calling empty JS method

Max Katz
A: 

You can use this:

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

use this:

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