function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

How to conditionally show a component?

I need to show a outputPanel depending on some clause.

        <apex:outputText style="font-style:italic;font-weight:bold;color:red" value="{!error.errorDescription}"/>
    //show something else

How do I do this in VisualForce Page? Also the errorExists has to be read from the custom controller. Something like IF({!error.errorExists})???

Please help?
Checkout the "rendered" attribute.  Should do you nicely.

Usually I wrap stuff in an output panel tag when I'm switching off a rendered true vs false.

Thanks..I figured the rendered attribute after posting the message....:-)
All components (and now custom components!) support the rendered attribute directly and I tend to only wrap in a container (e.g. apex:outputPanel) when I need to show or hide a group of components.