Hi,

I want to construct popup WYSIWYG editor using TinyMCE and ModalWindow. What
I got was an ordinary un-mocked up plain textarea in the pop up dialog box.
I have included my codes, the page and panel here. TinyMCE works well in the
page. Did I miss any "settings"? Any suggestion? Thank you.

public class TinyMCEPage extends WebPage
{
    private static final long serialVersionUID = 1L;

    public TinyMCEPage()
    {
        final ModalWindow editorDialog = new ModalWindow("editorDialog");
        editorDialog.setTitle("Edit Text");
        editorDialog.setContent(new
TinyEditor(editorDialog.getContentId()));

        add(editorDialog);
        add(new AjaxLink("edit")
        {
            public void onClick(AjaxRequestTarget target)
            {
                editorDialog.show(target);
            }
        });
    }
}

TinyMCEPage.html
<html>
<body>
<div wicket:id="editorDialog"></div>
<a wicket:id="edit">Edit</a>
</body>
</html>


public class TinyEditor extends Panel
{
    private static final long serialVersionUID = 1L;

    public TinyEditor(String id)
    {
        super(id);

        add(new TextArea("editor", new Model("Write here"))
            .add(new TinyMceBehavior(new
TinyMCESettings(TinyMCESettings.Theme.advanced))));
    }
}

TinyEditor.html
<wicket:panel>
    <textarea wicket:id="editor"></textarea>
</wicket:panel>

/lim/

Reply via email to