This content has been marked as final.
Show 5 replies
-
1. Re: How to get contents of the editor in a Javascript
nbelaevski May 17, 2009 4:40 PM (in response to onyii5119)Hello Jonathan,
Most RF component have "component" property bound to root HTML element. It can be obtained by calling rich:component function, e.g.:var component = #{rich:component('editorId')};
For the case of rich:editor, TinyMCE object can be obtained by calling:var tinyObj = #{rich:component('editorId')}.tinyMCE_editor;
-
2. Re: How to get contents of the editor in a Javascript
onyii5119 May 18, 2009 8:30 AM (in response to onyii5119)Thanks you so much.
-
3. Re: How to get contents of the editor in a Javascript
onyii5119 May 18, 2009 8:30 AM (in response to onyii5119)Thank you so much.
-
4. Re: How to get contents of the editor in a Javascript
onyii5119 May 18, 2009 10:47 AM (in response to onyii5119)I tried it, it did not work. Could you please give a concrete example.
use the following as the sample editor where the editor ID is editorId:
<rich:editor id="editorId" width="400" height="150" value="#{manageTerms.bannerImageText}" language="#{manageTerms.editorLanguageCode}"
configuration="editorFull" theme="advanced" >
<f:param name="encoding" value="utf-8" />
</rich:editor> -
5. Re: How to get contents of the editor in a Javascript
nbelaevski May 18, 2009 6:12 PM (in response to onyii5119)<a4j:outputPanel onclick="alert(#{rich:component('editorId')}.tinyMCE_editor.getContent())">get content</a4j:outputPanel> <rich:editor configuration="#{editorBean.currentConfiguration}" id="editorId" width="400" height="300" value="#{editorBean.value}" useSeamText="#{editorBean.useSeamText}"> <a4j:support event="onchange" reRender="result" ajaxSingle="true" requestDelay="1000" /> </rich:editor>