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
saas4usaas4u 

HTML Editor in VF page & Rich Text Area

Hi,

 

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.

 

Thanks,

saas4u

 

 

Prajapati.LakhanPrajapati.Lakhan

Hi,

 

Rich text area does not post data to the server if you use rerender property in CommandButton/ActionFunction inside the same apex form the rich text area is used. Check whether you have used the same if so try after removing the rerender property .

 

 

Thanks,
Lakhan

 

bob_buzzardbob_buzzard

While that's true, I've found that I get redirected to an error page rather than the data simply not being saved to the controller.

 

I've posted an answer with example code on the samepost on the Apex Code Development board.

saas4usaas4u

Hi Bob,

 

I went through your comment on my post in apex boards section...Yes i was using the string property in my class..The problem was that i was rerendering the a porion in my page so it was not working. when i removed the rerender condition as lakan said..it worked..

 

Thanks for your response guys..However i am now into a trouble since i need to use rerender in my page...Do you know any workaround for that....

 

Also regarding HTML editor, it would have better if Salesforce supported it...Any ways i observed that using inputtext area with richText set to true, is almot similar to the HTML editor provided..except it does not allow the ability to use coloured fonts.. Any idea how i can achieve this?

bob_buzzardbob_buzzard

The rich text editor is actually an instance of FCKEditor.  This javascript editor has much more functionality than that exposed by default in Salesforce.  You should be able to reconfigure this to add capability via javascript.  That said, I have found that Salesforce strips out some tags if you write this to the database.