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
Rajesh_SFGRajesh_SFG 

Dynamic changing Static Resource Name

Hi,

  

   I need to create the image with dynamic change static resource name tag. 

<apex:image url="{!$Resource.LogoName}" width="650" height="70"/>

 

I want to change the LogoName dynamically from controller class. That mean queried the image name from Static Resource table then pass that value from controller class. how can i do..

Best Answer chosen by Admin (Salesforce Developers) 
Bhawani SharmaBhawani Sharma

You don't need to worry about that number. Resources are first looked by Name.

Give it a try.

 <apex:image url="/resource/1311880464000/{!imageName}"/>

All Answers

Bhawani SharmaBhawani Sharma

<apex:image url="/resource/1311880464000/{!imageName}"/>

 

where imageName is controller class property.

Rajesh_SFGRajesh_SFG

Thanks yar,

  <apex:image url="/resource/1311880464000/{!imageName}"/> , How to get  '1311880464000'  this number. because the url changing depend upon the orgnaization. 

Bhawani SharmaBhawani Sharma

You don't need to worry about that number. Resources are first looked by Name.

Give it a try.

 <apex:image url="/resource/1311880464000/{!imageName}"/>

This was selected as the best answer
Rajesh_SFGRajesh_SFG

so many thanks yar....