+ Start a Discussion

Show Icon in VF page based on a field

I've tried everything...

On a VF page I want to show a small icon based on a Checkbox on an object.

Imagine the checkbox is called "isClosed"

Seems that image formula fields that are passed to VF are escaped and show the string <img src="....

I've tried <apex:image url="{!IF(opp.isClosed__c, GetClosedIcon, GetOpenIcon)}" /> to call a method.

Any suggestions?


Have you tried

<apex:image url="{!IF(opp.isClosed__c, $Resource.imageForTrue, $Resource.imageForFalse)}" />

Replacing the 'imageForTrue' and 'imageForFalse' for real images of course.

This worked - thanks!