You need to sign in to do that
Don't have an account?
Michael M
Remove tags from rich text area being displayed on VF page
Hello, I am displaying a rich text area (specifically, the body of chatter notes) on a VF page. The issue is that the html tags are showing on the page, e.g. if the note says "hello", my page shows: "<p> hello</p>". How can I get rid of those tags?
Here are the relevent snippets from the PAGE:
<apex:pageBlockTable value="{!listofNotes}" var="noteslist">
<apex:column >
<apex:facet name="header">Note</apex:facet>
<apex:outputText value="{!noteslist.Body}"/>
</apex:column>
and from the Controller:
listofNotes = [SELECT ID, CreatedDate, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, ParentId, Parent.Name, Body
FROM feeditem
WHERE Parentid IN (Select id from Discharge__c where Name =: discharge.name AND Date_of_Birth__c =: discharge.date_of_birth__c)];
Here are the relevent snippets from the PAGE:
<apex:pageBlockTable value="{!listofNotes}" var="noteslist">
<apex:column >
<apex:facet name="header">Note</apex:facet>
<apex:outputText value="{!noteslist.Body}"/>
</apex:column>
and from the Controller:
listofNotes = [SELECT ID, CreatedDate, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, ParentId, Parent.Name, Body
FROM feeditem
WHERE Parentid IN (Select id from Discharge__c where Name =: discharge.name AND Date_of_Birth__c =: discharge.date_of_birth__c)];
Try to use escape ="false" attribute with in <apex:outputtext> .
<apex:outputText escape="false" value="{!noteslist.Body}"/>
Hope above information was helpful.
Please mark as Best Answer so that it can help others in the future.
Thanks,
Vinay Kumar
All Answers
Try to use escape ="false" attribute with in <apex:outputtext> .
<apex:outputText escape="false" value="{!noteslist.Body}"/>
Hope above information was helpful.
Please mark as Best Answer so that it can help others in the future.
Thanks,
Vinay Kumar