Conditionally display modular panel richfaces

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

This is clearly an invalid EL. What is the most concise method I conditionally display myModelPanel this way?

Thanks IA

+5
source share
5 answers

Try calling an empty JS method

+1
source

You can use this:

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

use this:

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

Since the condition is only available in the database, you should use this:

<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
source
oncomplete="if (#{ MyBacking.myCondition}) {
#{
rich:component('myModelPanel'
}.show()
}"
0
source

All Articles