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.

1 Answer 1

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>
2
  • 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.
    Commented Jan 15, 2018 at 7:09
  • What does not work? The link or the image or both? Could you describe it a bit more specific? Thanks
    – Christoph
    Commented Jan 25, 2018 at 8:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .