function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
azhar khasimazhar khasim 

Had a Long TextArea Field in Custom object and want to display the data in that field(Allotment (Long TextArea)) on Visualforce Page

I had a field (Allotment) Long TextArea Field in Bren Updates(Custom Object).
I need to display the data which was in Allotment in te Visualforce Page.
I have tried it using <apex:outputField>
But still i was not getting thhe data to display on Visualforce page.

My issue on my Visualforce page:

    <apex:pageBlockSectionItem >
                              

                        <apex:outputLabel value="Allotment Summary" for="AllSum" style="font-family:Ancillary Bold; font-size:15px" />
                      <!--  <apex:outputField value="{!brenup.Allotment__c}" id="a0Wp0000003JTYb" />  -->
                        <apex:outputText value="{!HTMLENCODE(brenup.Allotment__c)}" style="white-space:pre;" escape="false"/>
                      <!--  <apex:inputfield value="{!brenup.Allotment_Summary__c}" id="AllSum" html-disabled="true" /> -->
                      <!--  <apex:inputTextarea richtext="false" value="{!brenup.Allotment__c}"  id="AllSum" readonly="true" cols="150" rows="25"/> -->
                        
                    </apex:pageBlockSectionItem>   

Bold code data is using now and it was not even displaying my data on Visualforce page.

ere below is my issue.
User-added image 
Please help me that i need to display my data in Visualforce page of that field(Allotment(Long Textarea Field)).

Please provide a solution for thisss.

Thanks and Regards,
Azhar Khasim.
Best Answer chosen by azhar khasim
Devi ChandrikaDevi Chandrika (Salesforce Developers) 
Hi azhar,
Try this one.I tried this one in my org and able to display long textarea field data in vf page.If you are using standard controller make sure you are passing BrenUpdates record  id  in the URL using id parameter like this.
Append record id after the pagename in the url like this

https://test.visualforce.com/apex/longtextarea?id=0012v00002jTmLj
<apex:outputText value="{!HTMLENCODE(account.description)}"  escape="false" />

Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.

Thanks and Regards

All Answers

Devi ChandrikaDevi Chandrika (Salesforce Developers) 
Hi azhar,
Try this one.I tried this one in my org and able to display long textarea field data in vf page.If you are using standard controller make sure you are passing BrenUpdates record  id  in the URL using id parameter like this.
Append record id after the pagename in the url like this

https://test.visualforce.com/apex/longtextarea?id=0012v00002jTmLj
<apex:outputText value="{!HTMLENCODE(account.description)}"  escape="false" />

Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.

Thanks and Regards
This was selected as the best answer
azhar khasimazhar khasim
Dear Chandrika,

It was working fine but I need some line breaks because the data which it was showing in the VF page doesn't have any line breaks.

I need the matter to be in proper order as it was before.

Please give some solution for line breaks.

Thanks and Regards,
Azar Khasim.