+ Start a Discussion
mjohnson-TICmjohnson-TIC 

Rich Text to String

Hi All,

 

I am all of a sudden having an issue when trying to convert rich text from a visualforce page to a string within a controller. When I take the richtext="true" tag off the apex:inputtextarea, it records the value of the text I have in the input just fine, but when I set the tag to true it records the value as null, event when entering text in the input. Has anyone had a problem with this recently (specifically in a spring 12 sandbox) ? I set the version of the page to 24.0 fyi.

 

Simple example:

 

public with sharing class Example {

 

public string test {get;set;}

 

public void debugpage(){

system.debug(test);

 

}

 

<apex:page controller="Example">

 

<apex:inputtextarea value="{!test}/>

<br/>

<apex:commandbutton value="Debug" action="{!debugpage}"/>

 

</apex:page>

 

----------------------

Putting a value in the inputtextarea on this page and clicking the debug button will show the value entered.

----------------------

 

<apex:page controller="Example">

 

<apex:inputtextarea richtext="true" value="{!test}/>

<br/>

<apex:commandbutton value="Debug" action="{!debugpage}"/>

 

</apex:page>

--------------------

Setting the inputtextarea tag of richtext="true" will show the debug of test as null. I have tried creating links, inserting images, just using plain text etc in the rich text editor and the string never returns any value.

 

Any ideas?

Best Answer chosen by Admin (Salesforce Developers) 
mjohnson-TICmjohnson-TIC

I found out the issue, putting a rerender on the button sets the value of the rich text area to null.