Playframework 2.0 在Play框架中使用CKEditor
如何将CKEditor与play framework一起使用 我正在使用:Playframework 2.0 在Play框架中使用CKEditor,playframework-2.0,ckeditor,Playframework 2.0,Ckeditor,如何将CKEditor与play framework一起使用 我正在使用: @helper.textarea(ProfileForm("aboutme"), '_label -> "About Me")</br> <script> CKEDITOR.replace( 'aboutme', {height: 164} ); </script> 删除编辑器脚本时,表单将加载te
@helper.textarea(ProfileForm("aboutme"), '_label -> "About Me")</br>
<script>
CKEDITOR.replace( 'aboutme', {height: 164} );
</script>
删除编辑器脚本时,表单将加载textarea数据,但添加时,textarea中的数据不会到达我的控制器。我猜您希望呈现预填充的textarea 要做到这一点,您应该在控制器中预先填充表单,如下所示:
public static Result textArea() {
Form<ProfileForm> profileForm = form(ProfileForm.class);
ProfileForm profileForm_ = new ProfileForm();
profileForm_.aboutMe = "hello";
profileForm = profileForm.fill(profileForm_);
return ok(views.html.textarea.render(profileForm));
}
@helper.form(action = routes.Application.textAreaSubmit()) {
@helper.textarea(
profileForm("aboutMe"),
'_label -> "About me : ",
'class -> "editable"
)
<input type="submit" value="Send" name="submit"/>
}
<script>
CKEDITOR.replace( 'aboutMe', {height: 164} );
</script>
@(profileForm: Form[beans.ProfileForm])