Hi David,

On 05/10/2010 11:13 AM, David Pinn wrote:
> Marius wrote:
> * Inherit the WYSIWYG GWT module in your own GWT module descriptor
> ** Use the same entry point as the WYSIWYG GWT module, which publishes
> a JavaScript API you can use to instantiate the editor, or
> ** Use your own entry point and instantiate the editor in GWT code
>
> How would I instantiate the editor in GWT code? I've been trying to
> achieve this, but I get an editor that will not accept typing. That
> is, typing characters into the editor has no effect; the characters
> don't display, and there is no change to the state of the editor in
> the DOM. I figure it must be something to do with the way I'm creating
> it.

You can use either the RichTextEditorController, which manages a 
RichTextEditor (menu bar + tool bar + rich text area) and a set of rich 
text area plugins, or the WysiwygEditor which extends the 
RichTextEditorController with the ability to switch to source (plain 
text area).

The WysiwygEditor constructor does this:

super(new RichTextEditor(), config, pfm, 
svm.getSyntaxValidator(config.getParameter("syntax", DEFAULT_SYNTAX)));

You can look in the WysiwygEditorFactory to see how to create a 
PluginFactoryManager and a SyntaxValidatorManager.

As for the Config object, the WysiwygEditorApi does this:

Config config = new DefaultConfig(jsConfig);

which creates a configuration object from a JavaScript object (uses 
GWT's Dictionary class behind the scenes). Configuration options are 
listed on 
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/WysiwygEditor (most 
of them are plugin related)

Can you show me how you instantiate the editor? It's hard to understand 
the problem without seeing the code.

Hope this helps,
Marius
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to