You need to sign in to do that
Don't have an account?
sp13
How to get value of rich text area field
The code below works if you enter/select values on any other fields after entering BODY but if you enter/select values for all the other fields and enter text to the BODY last, it doesn't save / newIdea.Body returns null.
//{!validateButton} == action for checking if all fields are !=null
//{!disablePostButton} == boolean; disable button until all fields are !=null
//{!postNewIdea} == insert newIdea;
<apex:form> <apex:inputField value="{!newIdea.Title}" id="myTitle"/> <!--text field--> <apex:inputField value="{!newIdea.Body}" id="newText"/> <!--rich text field--> <apex:outputPanel id="form2"> <apex:actionRegion > <apex:selectList value="{!selectedPostIdeaLineOfBusiness}" size="1"> <apex:selectOptions value="{!LineOfBusinessValues}"/> <apex:actionSupport event="onchange" reRender="form2"/> </apex:selectList> </apex:actionRegion> <apex:outputPanel rendered="{!selectedPostIdeaLineOfBusiness!=null && selectedPostIdeaLineOfBusiness!='Platform Solutions'}"> <h2>Device/Channel</h2> <apex:selectRadio value="{!selectedPostIdeaDevice}" layout="pageDirection" rendered="{!selectedPostIdeaLineOfBusiness!=null}"> <apex:selectOptions value="{!DeviceValues}"/> <apex:actionSupport event="onchange" reRender="form2, buttonFormId" action="{!validateButton}"/> </apex:selectRadio> </apex:outputPanel> <apex:outputPanel rendered="{!selectedPostIdeaLineOfBusiness!=null}"> <h2>Solution</h2> <apex:selectRadio value="{!selectedPostIdeaCategory}" layout="pageDirection" rendered="{!selectedPostIdeaLineOfBusiness!=null}"> <apex:selectOptions value="{!CategoryValues}"/> <apex:actionSupport event="onchange" reRender="form2, buttonFormId" action="{!validateButton}"/> </apex:selectRadio> </apex:outputPanel> </apex:outputPanel> </apex:form> <apex:form > <apex:inputFile value="{!newIdea.AttachmentBody}"/> </apex:form> <apex:form id="buttonFormId"> <apex:commandButton value="Post Idea" reRender="form2" action="{!postNewIdea}" disabled="{!disablePostButton}"/> </apex:form>
//{!validateButton} == action for checking if all fields are !=null
//{!disablePostButton} == boolean; disable button until all fields are !=null
//{!postNewIdea} == insert newIdea;