that is what I do. enable disable for me means add/remove to/from a component, while the javascript is loaded as the page is loaded.
but, after removing the behavior, the save generate that error. or maybe you mean something different with enable/disable. On Wed, Sep 30, 2009 at 4:50 PM, bgooren <b...@iswd.nl> wrote: > > 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: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> > > -- > 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: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Daniele Dellafiore http://blog.ildella.net http://twitter.com/ildella --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org