Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

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

I have an apex element which relies on the output of two Boolean methods to be rendered.

At the moment, both methods are evaluating to true, yet the apex element is not rendering. If I reverse one of the methods to evaluate to false, the element renders.

So the following DOES NOT render:

<apex:outputLink rendered="{!isTrue && !isTrue}"> //true && true


But this DOES render:

<apex:outputLink rendered="{!isTrue && ! !isTrue}"> //true && false


I'm checking that the methods really are returning what I'm expecting them to by outputting them into the console.

console.log('{!isTrue}'); //true
console.log('{! !isTrue}'); //false

Am I using the rendered attribute incorrectly?

Can anyone spot what's wrong here?

share|improve this question
up vote 7 down vote accepted

{!} is merge syntax

Adding parentheses may help visualize what is happening in your evaluations.

true and not true == false

<apex:outputLink rendered="{! (isTrue && !isTrue) }"> 

true and not not true (true to false and then back to true) == true

<apex:outputLink rendered="{! (isTrue && !!isTrue) }"> 
share|improve this answer
Ah! Cheers Mark, that cleared things up for me! – Daft Sep 3 '14 at 16:05
for clarity, you could use the NOT function rather than confuse yourself with the overloaded ! operator as in: <apex:outputLink rendered="{! cond1 && NOT(cond2) }"> – cropredy Sep 3 '14 at 23:06

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.