I want to display images from a static resource on visual force page. By clicking on the image the page need to redirect to another page with id passing on url and image should representing the record of leads
how to do this with coding
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityI want to display images from a static resource on visual force page. By clicking on the image the page need to redirect to another page with id passing on url and image should representing the record of leads
how to do this with coding
Just another solutio with "native" Salesforce functions:
public PageReference gotoPage()
{
PageReference p = new PageReference('/apex/MyPage?=' + param);
return p;
}
<apex:commandLink action="{!gotoPage}">
<apex:param name="p1" value="{!myId}" assignTo="{!param}">
<apex:image url="{!$Resource.YoutImage}"/>
</apex:commandLink>
<div class="row"><a href="{!$Page.mypage}?clickedOn=urlparam">
<apex:image url="{!URLFOR($Resource.test, 'img/game01.png')}"
alt="Snap Shot" width="239" height="169" />
Use href for the url .You can use URLFOR to pull image from static resource and place it in div Tag .
'ClickedOn' is my URL parameter and you can put a merge field there and pass the value to URL