Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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=""/>

Would this work?

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

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

share|improve this question
up vote 5 down vote accepted

Yes you can, although your syntax is a little off. The following should work:

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

Which you should be able to reduce to:

<apex:outputText rendered="{!firstMethod && secondMethod}"> 
share|improve this answer
Cheers Alex, appreciate the quick response. – Daft Apr 7 '14 at 10:02

Yes, you can do that, but like this:

rendered="{!firstMethod == true && secondMethod == true}"

Alternative use AND function:

rendered="{!AND(firstMethod, secondMethod)}"
share|improve this answer
Cheers for the answer mast0r! – Daft Apr 7 '14 at 10:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.