0

I am new to Visualforce.

I am currently trying to display html on condition-based but I see there is no else condition so I have tried below but not able to succeed.

<apex:outputPanel rendered="{!IF(activity.isanalytic == true, true, '')}" layout="none">
    <p>True Inside output panel</p>
</apex:outputPanel>
<apex:outputPanel rendered="{!IF(activity.isanalytic == true, '', false)}" layout="none">
    <p>False Inside output panel</p>
</apex:outputPanel>

On both the condition I want to display different divs.

Thanks in advance

2

To not render a section, return a false value, not an "empty string." Also, a Boolean value is already a Boolean value, so there's no need to convert it to a Boolean value via IF.


<apex:outputPanel rendered="{!activity.isanalytic}" layout="none">
    <p>True Inside output panel</p>
</apex:outputPanel>
<apex:outputPanel rendered="{!not(activity.isanalytic)}" layout="none">
    <p>False Inside output panel</p>
</apex:outputPanel>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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