Search code examples
rendererapex

Passing multiple methods into Apex 'rendered' attribute


Can I pass a second method into the rendered attribute of the following apex element?

        <apex:outputText rendered="{!(firstMethod == true)}">           
            <img class="refresh_btn" src="{!URLFOR($Resource.Images, 'images/icon_refresh.png')}" alt=""/>
        </apex:outputText>

Would this work?

        <apex:outputText rendered="{!(firstMethod == true)} && {!(secondMethod == true)}">          
            <img class="refresh_btn" src="{!URLFOR($Resource.Images, 'images/icon_refresh.png')}" alt=""/>
        </apex:outputText>

So both firstMethod and secondMethod must return true for the element to render.


Solution

  • Found the answer...

    <apex:outputText rendered="{!(firstMethod == true) && (secondMethod == true)}">