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
Rajesh_SFGRajesh_SFG 

Rich Text values show in HTML visualforce page

Hi all

  I have created Visualforce page for PDF usage. I have listed some Rich text values from controller class like given below

<page  standardController="Shipment_Header__c">

<apex:outputText value="{!PackingSlipSignature}"/>

</page>

 

The 'packingSlipSignature'  Return some company address from controller class. This i want dispaly one by one but this  display as given below

CompanyName<br> RK Salai<br> chennai<br> <br>

 

What can i do for this.

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

You'll need to set the escape="false" attribute on the outputtext to tell VF to render out the HTML.  This does introduce a security issue though, especially if the user is allowed to enter whatever they like into this property - see the following doc for more details:

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_security_tips_scontrols.htm

All Answers

bob_buzzardbob_buzzard

You'll need to set the escape="false" attribute on the outputtext to tell VF to render out the HTML.  This does introduce a security issue though, especially if the user is allowed to enter whatever they like into this property - see the following doc for more details:

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_security_tips_scontrols.htm

This was selected as the best answer
RamsRams
Hi Bob,

I have a Rich Text area field. In that field i have only 300 characters. Now i am trying to display this data in to vf page. I have used the below tag for displaying rich text area in to vf.

<apex:outputText value="{!s.body1__C}" escape="false"/>

In my vf, It will displaying 300 characters with empty space after that data. I need to display only 300 characters. I dont want that space. Is it possible. Please help me.

Thanks
DevelopersDevelopers

Hi Bob,

 

We create a single page and a controller in which 'isEditMode' Boolean decides the page is Detail Page or it is an Edit Page.

1. We first keep isEditMode = True as the User will enter the information, We will have a Save button there click on which will Save the Case Record . We use inputFields and inputText to get the information from the users.

2. Once It is clicked on Save , isEditMode becomes False and Now you render the Page to show the 2nd part of the code which takes the ID of the above created case and shows everything with OutPut FIeld and OutPutLabel.

 

But, the whole text of long text area is not displaying in the page block of the VF Page. I used <apex:outputField> as well as <apex:outputText>. But, i am not able to fix the issue to show the whole text on the VFPage.

 

Kindly suggest and help me to fix this issue.

 

Regards,

Kumar

Prem ranjan 8Prem ranjan 8
 Hi bob,
    i have  Rich Text Area(32768)
 with video data
 <iframe frameborder="0" allowfullscreen="" height="315" src="https://www.youtube.com/embed/NZSZiGuXn24?wmode=opaque" width="560"></iframe>
 but this video in not showing in visualforce page 

i tried with <apex:outputText value="{!how_to.Description__c}" escape="false" />

Pls help me.
VenkateshVenkatesh
What if .we have a rich text area in fieldset.how to display it in VF page .
gopinadh randhigopinadh randhi
correct answer, its worked for me
Akshay AmbhureAkshay Ambhure
@bob_buzzard
thannks , it worked for me