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

So in my rendered attribute I am calling a getter method that returns a boolean. However I want to set rendered to the opposite of what it returns because it is used to render one component or another. What is the correct syntax for doing this?

I am aware that I can do this:

rendered="{!IF(selectedNameIsContact == false, true, false)}"

But I was hoping for a cleaner syntax such as

share|improve this question
up vote 4 down vote accepted

You just need to use double '!!'. It looks funky, but it accomplishes what you are looking for



As pointed out by @sfdcfox, you could also use

rendered="{!not selectedNameIsContact}"

Also pointed out by @Ralph, you could also use

{!selectNameisContact == false}
share|improve this answer
Excellent! Thank you – Louis Pujol Jul 1 '14 at 19:24
Also, rendered="{!not selectedNameIsContact}". I'd avoid using !! directly, because it might be construed as a typo later. – sfdcfox Jul 1 '14 at 19:24
Good point @sfdcfox. Added to reflect. – Chris Duncombe Jul 1 '14 at 19:25
The not does look a lot better than the double exclamation. Thanks for the input – Louis Pujol Jul 1 '14 at 19:38
where is {!not someBooleanFieldOrProperty} documented? I would have done this as {!NOT(someBooleanFieldOrProperty)} – cropredy Jul 1 '14 at 20:04

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.