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
melioratormeliorator 

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?


harlequinharlequin

Have you tried

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


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

melioratormeliorator
This worked - thanks!