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

HTML Editor in VF page & Rich Text Area



I want to use the HTML Editor that salesforce provides when we click on "send an email" button on account/contact/ Lead's  ActivityHistory related list and seecting the email format to "HTML", in my visualforce page...Can i use that in my vf page? if yes, what will be the data type for the variable that i will bind with this editor area?


Also I want to use a inputTextArea in my page with its "richText" attribute set to true..Below is the way i am using it


<apex:inputTextArea richText="true" value="{!InpValue}"/>


when i debug the value of Inpvalue in my class it comes as blank...any ideas how to use this? The datatype for InpValue is String..


any help would be appreciated.





I doubt you'll be able to use that editor - its a jsp page in an iframe so wouldn't be easy to hook into.


WRT using an apex:inputtextarea in richtext mode, this should work when backed by a string property.  An example of using this is below.





<apex:page controller="RichTextController">
 <apex:form >
   <apex:pageBlock >
      <apex:pageBlockSection title="Last entered">
         <apex:outputText value="{!body}" escape="false"/>
      <apex:pageBlockSection title="Edit">
         <apex:inputtextarea richtext="true" value="{!body}"></apex:inputtextarea>
         <apex:commandButton value="Save"/>






public with sharing class RichTextController {
	public String body {get; set;}


Thus I can enter the value, click save and it appears in the "Last entered" section, based on the value written to the controller property.