Jean-Vincent Drean wrote:
> Notice the hookId in the constructor, the WYSIWYG editor will find the
> element (must be a textarea I guess) with the given ID. In your case
> you need to put the content you wish to edit in a textarea with
> id="content".

Unfortunately this doesn't work right now because the editor relies 
entirely on the inputURL parameter to get its initial content. It should 
be easy though to make the editor fall back on the plain text area value 
when the inputURL parameter is not specified (hookId parameter is 
required while inputURL is optional, defaulting to 'about:blank').

Mohammed, can you open a Jira issue for this?

In the mean time, the following workaround should work:

{{html}}
...
<textarea id="demo"></textarea>
...
<script type="text/javascript">
Wysiwyg.onModuleLoad(function() {
   new WysiwygEditor({
     hookId:'demo',
     inputURL: 'javascript:parent.document.getElementById("demo").value'
   });
});
</script>
...
{{/html}}

Hope this helps,
Marius

> 
> JV.
> 
> On Wed, Mar 10, 2010 at 11:13 AM, Mohammed BOUZERTA
> <[email protected]> wrote:
>> Hi,
>>  I need your help.
>> So I have used an Editor WYSIWYG in my form for adding some article.
>> http://code.xwiki.org/xwiki/bin/view/Modules/WysiwygEditorModule
>> There is no problem to create new article but when I need to edit and modify
>> this I don't find any way to set the default conent of textarea(Inwysiwyg
>> editor)
>>
>> <textarea id="demo"></textarea>
>> Wysiwyg.onModuleLoad(function() {
>>  Editor = new WysiwygEditor({hookId: 'content'});
>> });
>> My question is: is there setRichTextArea()  method or similar to set default
>> content to textarea (dem).
>> I think you so much for.
>> _______________________________________________
>> devs mailing list
>> [email protected]
>> http://lists.xwiki.org/mailman/listinfo/devs
>>
>>
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to