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
Amn12345Amn12345 

Rich text area is not displaying correctly in visual force page

I have used escape attribute for richTextArea field still content of my Visualforce page is showing me RTF data on UI like '<span><p> this is desc. </p> </Span>' instead of 'this is desc.'

 

Below is the VF,

 

<apex:pageBlockSection columns="1" >
<apex:repeat value="{!PPPInfo}" var="v">
<apex:outputtext escape="false"> {!v.Status__c} </apex:outputtext>
</apex:repeat>
</apex:pageBlockSection>

 

Is it because the value of richTextArea field is coming from Child of Child Record?

 

Please Help!!

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

I would use the outputfield tag instead - I've always found that handled the HTML correctly:

 

<apex:outputField value="{!v.Status__c}"/>

 For the sake of completeness, I think the reason that your outputext isn't working is because you aren't supplying the field as a value to the component, rather you are nesting the field inside the component which I wouldn't expect to have the same effect.  If you have to use the outputtext component, try:

 

<apex:outputText escape="false" value="{!v.Status__c}"/>

 

All Answers

bob_buzzardbob_buzzard

I would use the outputfield tag instead - I've always found that handled the HTML correctly:

 

<apex:outputField value="{!v.Status__c}"/>

 For the sake of completeness, I think the reason that your outputext isn't working is because you aren't supplying the field as a value to the component, rather you are nesting the field inside the component which I wouldn't expect to have the same effect.  If you have to use the outputtext component, try:

 

<apex:outputText escape="false" value="{!v.Status__c}"/>

 

This was selected as the best answer
Amn12345Amn12345

Thanks so much Bob!! It works perfectly.. :)