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
dev_forcedev_force 

Using actionFunction with rerender does not submit InputTextarea richText content

Here is the scenario:

- Page has an InputTextarea with richText="true" specified

- An action function is used to promt the user and submit the page

- When the actionFunction reRender property is set, the content from the inputTextarea is NOT passed to the controller

- When the actionFunction reRender property is NOT set, the content from the inputTextarea IS passed to the controller

- Using a normal command button, the value is ALWAYS passed to the controller

 - If the InputTextarea richText="false", using the actionFunction or command button BOTH submit the content to the controller without issue. 


After hitting either button, the results can be seen in the "System Log" window

 

 

Any ideas?

 

 

 

visualforce page

 

<apex:page controller="TestRichTextAreaController">

<script language="javascript">
function confirmAction()
{
var answer = confirm("Proceed?");
if (answer)
{
//call actionFunction
proceedWithSave();
}
else
{
alert('nto done');
}
}
</script>

<apex:Form id="mainForm">

<apex:actionFunction action="{!doSave}" name="proceedWithSave" rerender="testSection"/>


<apex:pageBlock title="Test Input Text Area - Rich Text" mode="edit">

<apex:pageBlockButtons >
<input id="confirmButton" type="button" OnClick="confirmAction();" name="confirmButton" value="Save via action function" class="btn" />
<apex:commandButton action="{!doSave}" value="Save via button"/>
</apex:pageBlockButtons>

<apex:pageBlockSection columns="1" id="contentSection" title="Content">

<apex:pageBlockSectionItem >
<apex:outputLabel value="Content" for="contentInput"/>
<apex:inputTextarea id="contentInput" value="{!content}" richText="true" rows="10" cols="100" />
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem id="testSection">
<apex:outputLabel value="Content" for="contentInput"/>
<apex:outputLabel value="Content" for="contentInput"/>
</apex:pageBlockSectionItem>

</apex:pageBlockSection>

</apex:pageBlock>
</apex:Form>

</apex:page>

 

 

 

controller

 

public class TestRichTextAreaController {

public String content{get;set;}

public TestRichTextAreaController()
{
this.content='';

}

public void doSave()
{
System.Debug('$$ content: '+content);

}
}

 

 


 

Message Edited by dev_force on 03-23-2009 09:33 AM
ankitjainankitjain

I am facing the same issue.

 

I used inputTextArea tag, and set richtext attribute to true. I also tried creating an Rich Text Area field in my org, and used inputfield tag with reference field as the field created.

 

Either way, the rerender attribute is not supporting richText content.