It's not possible to add TinyMCE dynamically due to the way TinyMCE works.
What you can do however, is pre-load TinyMCE, and dynamically enable/disable
it on a component.
Daniele Dellafiore wrote:
>
> Hi. I have a problem with this example code:
>
> tinyMceBehavior = new TinyMceBehavior();
> PropertyModel<Boolean> richProperty = new PropertyModel(model,
> "rich");
> add(new AjaxCheckBox("switchRte", richProperty) {
>
> @Override
> protected void onUpdate(AjaxRequestTarget target) {
> if (getModelObject()) {
> textArea.add(tinyMceBehavior);
> } else {
> textArea.remove(tinyMceBehavior);
> tinyMceBehavior = new TinyMceBehavior();
> }
> refresh(target);
> }
> });
>
> the purpose is to have a checkbox that add and remove the
> TinyMceBehavior from a text area.
> It works fine but I have this problem: when I Submit the form the
> textArea is in after REMOVING the behavior, I have a javascript error:
>
> t.win.document is null
>
> firebug show the error in tiny_mce_src.js at line 5376
>
> if (!r)
> r = isIE ? t.win.document.body.createTextRange() :
> t.win.document.createRange();
>
> I am using tinymce 3.2.7 but the same problem occurs with tinymce used
> in trunk version of wicket-contrib-tinymce.
>
> the effect is that "submit" does not work.
> if I click on checkbox again, everything continue to work.
> Any idea?
>
> --
> Daniele Dellafiore
> http://blog.ildella.net
> http://twitter.com/ildella
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
View this message in context:
http://www.nabble.com/-tinymce--problem-adding-removing-TinyMceBehavior-dinamically-tp25681833p25682644.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]