All Downloads are FREE. Search and download functionalities are using the official Maven repository.

wicket.contrib.tinymce.ajax.TinyMceAjaxSubmitModifier Maven / Gradle / Ivy

There is a newer version: 10.0.0-M2
Show newest version
package wicket.contrib.tinymce.ajax;

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.model.Model;

/**
 * Modifier to modify the onclick method so that the tinyMce data will be updated to the model
 * 

* Solution found at: http://dwairi.blogspot.com/2006/12/tinymce-ajax.html
* For more details see: http://www.crossedconnections.org/w/?p=88
* * @author Sander van Faassen */ public class TinyMceAjaxSubmitModifier extends AttributeModifier { /** serialVersionUID */ private static final long serialVersionUID = 1L; /** Trigger that has to be called */ public static final String SAVE_TRIGGER = "tinyMCE.triggerSave(true,true);"; /** * Constructor */ public TinyMceAjaxSubmitModifier() { super("onclick", Model.of(SAVE_TRIGGER)); } /** * @see org.apache.wicket.AttributeModifier#newValue(java.lang.String, java.lang.String) */ @Override protected String newValue(final String currentValue, final String replacementValue) { // Call the trigger, before submitting the form String result = replacementValue; if (currentValue != null) { result = result + currentValue; } return result; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy