ICEfaces
  1. ICEfaces
  2. ICE-9792

richTextEntry not submitted by ace:pushButton

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.3
    • Fix Version/s: None
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      All Browsers, JBoss AS 7.1.1
    • Workaround Exists:
      Yes
    • Workaround Description:
      Use h:commandButton instead and style it like a pushButton.

      Description

      The saveOnSubmit from the richTextEntry doesn't work if the form will be submitted by an ace:pushButton.

        Activity

        Hide
        Krashan Brahmanjara added a comment -

        Yes it's true also for Icefaces 4 from trunk , rev. 41800.
        This is because push event is called before richtextentry.js/onBlur is executed.

        Problem is well known http://ckeditor.com/forums/CKEditor/CKEditor.editable.blur-or-other-scheme-to-detect-user-left-the-editor.

        Workaround is simply

        • do not mix saveOnSubmit=true with ace:ajax in richTextEntry
        • do not use (remove) save button from richtext toolbar
        • fix richtextentry.js and add this code:
          editorInstance.on('change', onBlur);
          after this line
          editorInstance.on('blur', onBlur);
        • additionaly reduce four setTimeout's to values 40-50ms
        Show
        Krashan Brahmanjara added a comment - Yes it's true also for Icefaces 4 from trunk , rev. 41800. This is because push event is called before richtextentry.js/onBlur is executed. Problem is well known http://ckeditor.com/forums/CKEditor/CKEditor.editable.blur-or-other-scheme-to-detect-user-left-the-editor . Workaround is simply do not mix saveOnSubmit=true with ace:ajax in richTextEntry do not use (remove) save button from richtext toolbar fix richtextentry.js and add this code: editorInstance.on('change', onBlur); after this line editorInstance.on('blur', onBlur); additionaly reduce four setTimeout's to values 40-50ms
        Hide
        Markus Guenther added a comment -

        Calling the following JavaScript Method in the onClick Handler of the ace:pushButton did the trick for me:

        function saveRichEditor() {
        for ( var i in CKEDITOR.instances)

        { // console.log(CKEDITOR.instances[i]); var myName = CKEDITOR.instances[i].name; // updating the value of the textarea from all the found the CKEDITOR CKEDITOR.instances[i].updateElement(); var myValue = CKEDITOR.instances[i].getData(); console.log('Updating CKEDITOR for RichEditName:' + myName + ' Value:' + myValue); var doc = document.getElementById(myName); doc.value = myValue; }

        }

        The value is updated when the button is pressed this way in any case before it is submitted.

        Show
        Markus Guenther added a comment - Calling the following JavaScript Method in the onClick Handler of the ace:pushButton did the trick for me: function saveRichEditor() { for ( var i in CKEDITOR.instances) { // console.log(CKEDITOR.instances[i]); var myName = CKEDITOR.instances[i].name; // updating the value of the textarea from all the found the CKEDITOR CKEDITOR.instances[i].updateElement(); var myValue = CKEDITOR.instances[i].getData(); console.log('Updating CKEDITOR for RichEditName:' + myName + ' Value:' + myValue); var doc = document.getElementById(myName); doc.value = myValue; } } The value is updated when the button is pressed this way in any case before it is submitted.

          People

          • Assignee:
            Unassigned
            Reporter:
            Florian Hell
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: