Hi,

I solved the problem by changing the TinyMceBehavior.renderHead()-method.

It now looks like this:

/**
     * @see org.apache.wicket.behavior.AbstractAjaxBehavior#renderHead(
org.apache.wicket.markup.html.IHeaderResponse)
     */
    public void renderHead(IHeaderResponse response)
    {
        // add wicket-ajax support
        super.renderHead(response);

        // since wicket modifies the src attribute of a pre-loaded script
tag
        // then we
        // need this workaround to safely import tinymce script

        // import script
        // IS NOT NEEDED ANY LONGER
//        StringBuilder importBuilder = new StringBuilder();
//        importBuilder.append("var script = document.createElement
('script');\n");
//        importBuilder.append("script.id='tinyMCEScript';\n");
//        importBuilder.append("script.src='" +
RequestCycle.get().urlFor(reference)
+ "';\n");
//        importBuilder.append("script.type='text/javascript';\n");
//        importBuilder.append("document.getElementsByTagName
('head')[0].appendChild(script);\n");
//        response.renderJavascript(importBuilder.toString(), "import");

      // THE NEW LINE
        response.renderJavascriptReference(reference);

        // init script
        StringBuilder initBuilder = new StringBuilder();
        initBuilder.append("tinyMCE.init({" + settings.toJavaScript(ajax) +
"\n});\n");
        initBuilder.append(settings.getLoadPluginJavaScript());
        initBuilder.append(settings.getAdditionalPluginJavaScript());
        response.renderJavascript(initBuilder.toString(), "init");
    }


I don´t really know why the script was not imported this way.
But now it works fine in IE6.


Benjamin

2007/9/3, Benjamin Ernst <[EMAIL PROTECTED]>:
>
> Hi Iulian,
>
> I just want to check if there is any progress with this issue? Did you
> find anything?
>
> Benjamin
>
> 2007/8/21, Iulian Costan <[EMAIL PROTECTED]>:
> >
> > hey guys,
> >
> > i am supposed to be the maintainer of tinymce module but lately i didnt
> > put
> > much effort into it.
> > let me take a look and see how i can fix that issue.
> >
> > /iulian
> >
> > On 8/21/07, Benjamin Ernst < [EMAIL PROTECTED]> wrote:
> > >
> > > Hi Thijs,
> > > Thank you for opening the JIRA. At least there is someone who has the
> > same
> > > error.
> > >
> > > So let's hope for the best.
> > >
> > > Benjamin
> > >
> > > 2007/8/20, Thijs <[EMAIL PROTECTED]>:
> > > >
> > > > He Benjamin,
> > > >
> > > > I have the same problem. I have opened a JIRA issue for it:
> > > > http://wicketstuff.org/jira/browse/WCTINYMCE-2 But no response so
> > far. I
> > > > can't help you any further but lets hoop the maintainer of the
> > tinymce
> > > > project picks it up...
> > > >
> > > > Thijs
> > > >
> > > > Benjamin Ernst wrote:
> > > > > Hi,
> > > > >
> > > > > has nobody an idea? Any help would be great!
> > > > >
> > > > > Thanks,
> > > > > Benjamin
> > > > >
> > > > > 2007/8/16, Benjamin Ernst <[EMAIL PROTECTED]>:
> > > > >
> > > > >> Hi,
> > > > >>
> > > > >> I have a problem with the wicket-stuff Tinymce-Editor in the
> > > > >> InternetExplorer:
> > > > >>
> > > > >> the first time the page is loaded, there are no tool-icons, just
> > the
> > > > >> text-area. And IE gives the following Error:
> > > > >>
> > > > >> Error: 'tinyMCE is undefined'
> > > > >>
> > > > >> It' s an Java-Script-Error and it might be, that the scripts are
> > not
> > > > >> loaded the right way. But I don´t know how to fix this. Here are
> > the
> > > > scripts
> > > > >> from generated the HTML-Source:
> > > > >>
> > > > >> <script type="text/javascript"
> > > id="import"><!--/*--><![CDATA[/*><!--*/
> > > > >> var script = document.createElement('script');
> > > > >> script.id='tinyMCEScript ';
> > > > >>
> > > > >>
> > > >
> > >
> > script.src='resources/wicket.contrib.tinymce.TinyMCEPanel/tiny_mce/tiny_mce_src.js
> > > > >> ';
> > > > >> script.type='text/javascript';
> > > > >> document.getElementsByTagName ('head')[0].appendChild(script);
> > > > >>
> > > > >> /*-->]]>*/</script>
> > > > >>
> > > > >> <script type="text/javascript"
> > id="init"><!--/*--><![CDATA[/*><!--*/
> > > > >> tinyMCE.init({
> > > > >>     mode : "specific_textareas",
> > > > >>     editor_selector : "mceEditor",
> > > > >>     theme : "advanced",
> > > > >>     language : "en",
> > > > >>     plugins : "contextmenu, save, paste, searchreplace,
> > > insertdatetime,
> > > > >> preview, zoom, table, emotions, iespell, flash, print,
> > > directionality,
> > > > >> fullscreen, spellchecker",
> > > > >>     theme_advanced_buttons1_add_before : "save, newdocument,
> > > > separator",
> > > > >>     theme_advanced_buttons1_add : "fontselect, fontsizeselect",
> > > > >>     theme_advanced_buttons2_add_before: "cut, copy, paste,
> > pastetext,
> > > > >> pasteword, separator, search, replace, separator",
> > > > >>     theme_advanced_buttons2_add : "separator, inserttime,
> > insertdate,
> > > > >> separator, preview, zoom, separator, forecolor, backcolor",
> > > > >>     theme_advanced_buttons3_add_before : "tablecontrols",
> > > > >>     theme_advanced_buttons3_add : "emotions, iespell, flash,
> > > separator,
> > > > >> print, separator, ltr, rtl, separator, fullscreen",
> > > > >>     theme_advanced_buttons4 : "spellchecker",
> > > > >>     theme_advanced_toolbar_location : "top",
> > > > >>     theme_advanced_statusbar_location : "bottom",
> > > > >>     theme_advanced_toolbar_align : "left",
> > > > >>     theme_advanced_resizing : true,
> > > > >>     theme_advanced_resize_horizontal : false,
> > > > >>     plugin_insertdate_timeFormat : "Time: %H:%M",
> > > > >>     plugin_insertdate_dateFormat : "Date: %m-%d-%Y",
> > > > >>     fullpage_default_xml_pi : "false",
> > > > >>     spellchecker_languages : "+English=en"
> > > > >> });
> > > > >>
> > > > >> /*-->]]>*/</script>
> > > > >>
> > > > >> Sometimes when the page is loaded again, the tool-icons are
> > there. In
> > > > >> FireFox it works fine, but unfortunately I have to use IE for
> > this
> > > > project.
> > > > >>
> > > > >> Thanks in advance,
> > > > >> Benjamin
> > > > >>
> > > > >>
> > > >
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> >
>
>

Reply via email to