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
Attribution to: rakesh
Possible Suggestion/Solution #1
<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
Attribution to: Mohith Shrivastava
Possible Suggestion/Solution #2
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>
Attribution to: Sergej Utko
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/5081