Find your content:

Search form

You are here

Conditionally Render Component In Visualforce Page


I would like to conditionally render a component in a VisualForce page based on a custom field.

I was hoping to do something like this:

<apex:page standardController="myObject__c">
    <c:myComponent myProperty="{! Id }" render="{! myBoolean__c }" />

Components don't have a render property though.

What is the best way to do this?

Attribution to: Greg

Possible Suggestion/Solution #1

The property you're looking for is called rendered, not render. And it's available on most (if not all) tags.

Attribution to: eyescream
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content