1

I have a visualforce page with a table with images as follows:

<apex:dataTable value="{!List_of_images}" var="Rlist" styleClass="box" >     
<apex:column headerValue="Pic" styleClass="P_image" value="{!Rlist.Pic_in_db}"/> 
</apex:dataTable>

I'm trying to make images that appear in the rows clickable. The link on the record should be obtained similarly to the list of images.

2

You need to use the column facet for the column header and explicitly configure the body.

E.g.

<apex:dataTable value="{!List_of_images}" var="Rlist" styleClass="box" >     
<apex:column headerValue="Pic" styleClass="P_image" value=""/>
    <apex:column styleClass="P_image">
        <apex:facet name="header">Pic</apex:facet>
        <a href="{!Rlist.LINK_IN_DB}"><apex:outputField value="{!Rlist.Pic_in_db}"/></a>
    </apex:column>
</apex:dataTable>
  • Hi Christoph, thanks. This seems to work on my VF page but for the oddest reason, when I display the VF page on a SF site, it doesn't work. Any idea why? – Rufus K. Jan 15 '18 at 7:09
  • What does not work? The link or the image or both? Could you describe it a bit more specific? Thanks – Christoph Jan 25 '18 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.