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
kamal3883kamal3883 

Image in visualforce

Hi,

I want to display violation image in visualforce page. Please find below statement where i want to display Violation image.

<apex:outputText value="{!if(caseWrap.caseMile.IsViolated, 'Violated', null)}" ></apex:outputText>

instead of violated i want to add violation image shown in case milestone. Please check sample in Image. Can we use static resource for this. Then how can we use Image tag in that case in this syntax.

User-added image
Best Answer chosen by kamal3883
Vamsi KrishnaVamsi Krishna
Kamal
you can use apex:image tag instead of outputText and use redered attribute to show / hide based on the IsViolated flag.. something like below..
add your image to static resources and use the resource name in place of myResourceImage below..

<apex:image id="theImage" value="{!$Resource.myResourceImage}" rendered="{!caseWrap.caseMile.IsViolated}" />

All Answers

Vamsi KrishnaVamsi Krishna
Kamal
you can use apex:image tag instead of outputText and use redered attribute to show / hide based on the IsViolated flag.. something like below..
add your image to static resources and use the resource name in place of myResourceImage below..

<apex:image id="theImage" value="{!$Resource.myResourceImage}" rendered="{!caseWrap.caseMile.IsViolated}" />
This was selected as the best answer
kamal3883kamal3883
Thanks Vamsi