• Has anyone solved this bug? Maybe some workaround??

    By Dominik Myszkowski 1 decade ago

    Rich text control doesn't work in tab container pane. After partial refresh it ends with an error - "k.contentWindow is null". Also it's not possible to create more than one rt control insidetab container - only first one appears.

    Below is an example of XPage resulting in such error. After creating a tab with rt control and clicking "partial refresh" error appears. If the tab is closed using X sign, then after trying to create the tab again there is another error - trying to register id which has already been registered.

    This bug totally blocks using RT in tab container.

     

    • sample

      By Dominik Myszkowski 1 decade ago

      I included text file with XSP code of a very simple XPage presenting the case. One tab pane is static and the other one is delared as a facet and created dynamically by the first button. After creating a tab, the second button (partial refresh) is enough to invoke the bug.

    • We're looking into this | PHAN8P2EGZ

      By Paul Hannan 1 decade ago
      • Temporary workaround...

        By Wojciech Klicki 1 decade ago

        Its high time for You to do this because clearly You have not tested this combination (tabs + rich text) at all.

        In the mean time here is workaround:

        dojo.require('ibm.xsp.widget.layout.xspCKEditor');
        /**
         * Solves k.contentWindow is null error in Rich text CKEditor.
         * Problem was appearing when user done partial refresh on tab with rich text field.  
         */
        ibm.xsp.widget.layout.CKEditorWrapper.prototype.destroy = function(){
            console.log('Destroying rt editor ' + this.id);
            // destroys ckeditor but without html update
            CKEDITOR.instances[this.domNode.id].destroy(true/*No editor html update*/);
            // delegate rest of the action to dijit
            dijit._WidgetBase.prototype.destroy.apply(this, arguments);
        }

         

        The problem with tabs is that the html is deleted before the destroy code of CKEditor have the chance to clean it.

        • RichText & partial Refresh

          By Tiago Nobrega 1 decade ago

          Thanks, I was looking for it everywhere!!

          The code posted as a workaroud wasn't working for me, but i´ve managed to get it working making these little changes:

           

          Its high time for You to do this because clearly You have not tested this combination (tabs + rich text) at all.

          In the mean time here is workaround:

          dojo.require('ibm.xsp.widget.layout.xspCKEditor');

          dojo.require('dijit._Widget');//included this line
          /**
           * Solves k.contentWindow is null error in Rich text CKEditor.
           * Problem was appearing when user done partial refresh on tab with rich text field.  
           */
          ibm.xsp.widget.layout.CKEditorWrapper.prototype.destroy = function(){
              console.log('Destroying rt editor ' + this.id);
              // destroys ckeditor but without html update
              CKEDITOR.instances[this.domNode.id].destroy(true/*No editor html update*/);
              // delegate rest of the action to dijit
              dijit._WidgetBase.prototype.destroy.apply(this, arguments);//Removed this line...

              dijit._Widget.prototype.destroy.apply(this, arguments);//Replaced with this one


          }

    • By Jens Winkelmann 9 years ago

      This problem was fixed with Domino 9.

      But the problem comes back with Domino 9.0.1 (Fix Pack 2)

      If I shorten the old workaround and than it still works for me.

      dojo.require('ibm.xsp.widget.layout.xspCKEditor');

      /**

       * Solves k.contentWindow is null error in Rich text CKEditor.
      
       * Problem was appearing when user done partial refresh on tab with rich text field.  
      
       */
      
      ibm.xsp.widget.layout.CKEditorWrapper.prototype.destroy = function(){
      
          console.log('Destroying rt editor ' + this.id);
      
         // delegate rest of the action to dijit
      
          dijit._WidgetBase.prototype.destroy.apply(this, arguments);
      
      }
      

      I have to remove the row

      CKEDITOR.instances[this.domNode.id].destroy(true/No editor html update/);