CkEditor textarea not updated on SubmitLink or AjaxSubmitLink

74 views
Skip to first unread message

serban.balamaci

unread,
Dec 4, 2011, 1:58:38 PM12/4/11
to jqwicket-user
Hi ,
Right now it seems that using CKEditorTextArea and SubmitLink or
AjaxSubmitLink does not update the backend textarea(and therefore the
Model).
My current workaround is to add the following SubmitModifier(inspired
from TinyMceAjaxSubmitModifier) to the submit links.

public class CKEditorSubmitModifier extends AttributeModifier {

public CKEditorSubmitModifier() {
super("onclick", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return "$('.ckeditor').each(function() { var aval = $
(this).val(); $(this).text(aval);});";//ofcourse the ckeditor class
must be specified for the textarea
}
});
}

@Override
protected String newValue(String currentValue, String
replacementValue) {
// Call the trigger, before submitting the form
String result = replacementValue;
if (currentValue != null) {
result = result + currentValue;
}
return result;
}
}

Maybe there is something I'm doing wrong or you can include a better
SubmitModifier with the library.

Thanks.

Reply all
Reply to author
Forward
0 new messages