【问题标题】:how to auto save inputRichText content before validate如何在验证之前自动保存 inputRichText 内容
【发布时间】:2012-10-04 03:39:21
【问题描述】:

inputRichText 组件有一些问题(icefaces 3)

<ice:inputRichText  id="content" value="#{CchcDmFeedbackController.objFeedback.fbContent}"
       required="true" requiredMessage="This is required" skin="office2003" 
       styleClass="editor"  saveOnSubmit="true" toolbar="MyToolbar"
       customConfigPath="#{resource['js:CKConfig.js']}"/>   
<ice:message for="content"/>

还有我的 CKConfig.js

CKEDITOR.editorConfig = function( config )
{
   config.toolbar = 'MyToolbar';
   config.toolbar_MyToolbar = [['Bold','Italic', 'Underline'], ['Save']];
   config.contentsCss = '/css/CKStyle.css';
};
  1. 这段代码返回javascript错误,似乎找不到我的工具栏配置,我的js路径是正确的(我确定)

  2. 虽然我第一次提交表单时使用 saveOnSubmit="true",但内容没有保存,验证器将其内容捕获为空(显示验证消息),第二次提交表单它会通过,我认为它之前验证过保存内容(而不是先保存后验证)

谁能帮帮我:(

【问题讨论】:

    标签: ckeditor validation icefaces fckeditor icefaces-3


    【解决方案1】:

    对这篇文章感到抱歉。我想我在配置文件中遗漏了一些东西,它现在工作正常。 我的新配置文件:

    CKEDITOR.config.resize_maxWidth = "100%";
    CKEDITOR.config.tabSpaces = 5;
    CKEDITOR.config.defaultLanguage = 'vi';
    CKEDITOR.config.toolbar = 'MyToolbar';
    CKEDITOR.config.toolbar_MyToolbar =
        [
            [ 'Source','-','Save','Preview'],
            [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] ,
            [ 'Find','Replace','SelectAll' ] ,
            '/',                    
            [ 'Bold','Italic','Underline','-','Strike','Subscript','Superscript','-','RemoveFormat' ] ,
            [ 'NumberedList','BulletedList','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock' ] ,
            [ 'TextColor','BGColor' ],
            '/',        
            [ 'Format','Font','FontSize' ],
            ['Maximize', 'ShowBlocks' ] ,
            [ 'Link','Unlink'] , 
            [ 'Image','Smiley']             
        ];
    

    和xhtml

    <ice:inputRichText  id="noidung" value="#{CchcDmFeedbackController.objFeedback.fbNoidung}" required="true" requiredMessage="Vui lòng nhập nội dung" skin="kama" styleClass="editor" saveOnSubmit="true" toolbar="MyToolbar"  customConfigPath="/resources/js/CKConfig.js"/> 
    <h:message for="noidung"/>
    

    注意: 我使用 CK v3.5,在配置文件中不能使用组名,只是 [] 而不是 {[]} 而在 xhtml 文件中,customConfigPath 必须是静态 url

    【讨论】:

      猜你喜欢
      • 2012-02-18
      • 1970-01-01
      • 1970-01-01
      • 2013-01-11
      • 1970-01-01
      • 1970-01-01
      • 2021-11-26
      • 2012-02-05
      • 1970-01-01
      相关资源
      最近更新 更多