Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Playframework 2.0 在Play框架中使用CKEditor_Playframework 2.0_Ckeditor - Fatal编程技术网

Playframework 2.0 在Play框架中使用CKEditor

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

如何将CKEditor与play framework一起使用

我正在使用:

@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])