Package wicket.contrib.examples.tinymce

Source Code of wicket.contrib.examples.tinymce.InlineTinyMCEPage

package wicket.contrib.examples.tinymce;

import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;

import wicket.contrib.tinymce4.InPlaceEditComponent;
import wicket.contrib.tinymce4.ajax.TinyMceAjaxButton;

public class InlineTinyMCEPage extends TinyMCEBasePage
{
  private static final long serialVersionUID = 1L;
  private Component modelValue;

  public InlineTinyMCEPage()
  {
    Form<Void> form = new Form<>("form");
    InPlaceEditComponent editableComponent = new InPlaceEditComponent("editableComponent",
        "<p><b>Click me</b> and <i>edit me</i> with <font color=\"red\">tinymce</font>. "
            + "This is a new feature introduced with version 4.</p>");
    form.add(editableComponent);
    form.add(modelValue = new Label("modelValue", editableComponent.getModel()));

    modelValue.setEscapeModelStrings(false);
    modelValue.setOutputMarkupId(true);

    form.add(new TinyMceAjaxButton("submit")
    {
      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {
        super.onSubmit(target, form);
        target.add(modelValue);
      }
    });
    add(form);
  }
}
TOP

Related Classes of wicket.contrib.examples.tinymce.InlineTinyMCEPage

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.