Search code examples
oracle-adfjdeveloper

How can I save data in Rich Text Editor?


How can i save data in rich text editor into another text item.please help me.i am using jdeveloper 11g.how can i insert save and cancel button in rich text item


Solution

  • In which component do you want to show the contents of RichTextEditor?

    I am assuming here that you want the content of RichTextEditor component show up in the OutputText which can be done as:

    <af:richTextEditor id="rte1" label="Enter text" 
                       value="#{viewScope.richValue}" 
                       autoSubmit="true" />
    <af:outputText id="ot1" value="${viewScope.richValue}"
                   partialTriggers="rte1" />
    

    From the above code the data entered in the RichTextEditor component gets stored in the richValue variable which is in the viewScope and then the OutputText refreshes itself (due to the partial trigger) to display the value.

    You cannot insert "Save" and "Cancel" button within the RichTextEditor. But instead you can do something like this:

    <af:panelGroupLayout id="pgl1" layout="vertical">
      <af:richTextEditor id="rte1" label="Enter text" 
                             value="#{viewScope.richValue}" 
                             autoSubmit="true" />
      <af:panelGroupLayout id="pgl2" layout="horizontal">
        <af:commandButton text="Save" />
        <af:commandButton text="Cancel" />
      </af:panelGroupLayout>
    </af:panelGroupLayout>