4

This is the code of the VF PAGE

<apex:page showHeader="false"  controller="Controller004">
    <link href='https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'/>
    <style>
    h1{font-family: 'Oswald', sans-serif; text-decoration:none;}
    </style>
    <apex:pageBlock >
    <apex:pageBlockSection title="Record of avalaible Doctors">
    <apex:form >
    <apex:pageBlockTable value="{!obj}" var="a">

     <apex:column headerValue="Name">
     <h1><apex:outputField value="{!a.Full_Name__c}" /></h1>
     </apex:column>
     <apex:column headerValue="Fee">
    <h1><apex:outputField value="{!a.Fee__c}"/></h1>
    </apex:column>
    <apex:column headerValue="Schedule">
    <h1><apex:outputField value="{!a.schedule__c}"/></h1>
    </apex:column>
    <apex:column >
    <apex:image value="{!a.ImageUpload__c}" />
    </apex:column>
    </apex:pageBlockTable>
    </apex:form>
    </apex:pageBlockSection>
    </apex:pageBlock>

</apex:page>

AND this is the controller of the page:

global class Controller004{

    public List<Doctor__c> obj{get;set;}
    public Controller004(){
    obj = [select Full_Name__c, Fee__c, schedule__c, ImageUpload__c from Doctor__c];

    }
}
2
  • which field is richtextArea?
    – Ratan Paul
    Mar 16, 2016 at 3:55
  • its ImageUpload__c
    – Nishant
    Mar 16, 2016 at 3:57

1 Answer 1

4

Looks like ImageUpload__c is rich text area

then don't use apex:image for ImageUpload__c field

Instead use apex:outputField

<apex:outputField value="{!a.ImageUpload__c}"/>

This will display your rich text area image.

when we use apex:outputField salssforce in there end use as richTextArea field.

3
  • Yes Ratan. It works. I also wanted to know how to customize the size of the image displayed on the page, It displays in its default size.
    – Nishant
    Mar 16, 2016 at 6:11
  • @Nishant if you check the doc for apex:outputField, you can use style attribute to set height and width . DOC LINK
    – Ratan Paul
    Mar 16, 2016 at 6:17
  • @Nishant most welcome..
    – Ratan Paul
    Mar 16, 2016 at 7:02

You must log in to answer this question.

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