Results 1 to 5 of 5

Thread: DwtHtmlEditor -- Exception when started in a hidden tab

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Posts
    6
    Rep Power
    9

    Default DwtHtmlEditor -- Exception when started in a hidden tab

    I'm using a DwtHtmlEditor in HTML mode inside a DwtTabViewPage. When this tab is the only one in the DwtTabView, I have no problem. But if another tab is the default, when I switch to the editor's tab and click inside the widget, I get this exception (in FireFox, not in IE):

    Exception ``[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.queryCommandState]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://.../zimbra/boot.js :: anonymous :: line 15392" data: no]'' thrown from function anonymous()

    line 15392 of our boot.js corresponds with line 620 of DwtHtmlEditor.js:

    Code:
    var iFrameDoc = this._getIframeDoc();
    ev.isBold = iFrameDoc.queryCommandState(DwtHtmlEditor.BOLD_STYLE); // line 620
    ev.isItalic = iFrameDoc.queryCommandState(DwtHtmlEditor.ITALIC_STYLE);
    Any ideas about what's going wrong?
    --Chouser

  2. #2
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    The iFrame may not be in designMode any more. There are some bugs we've seen where the iframe will *forget* it's in design mode and then you get exceptions. If your using Firefox 1.5 it also seems to thrwo mroe exceptions than normal. Does this effect the user of your app? Or are you just seeing the exceptions?

  3. #3
    Join Date
    Aug 2005
    Posts
    49
    Rep Power
    10

    Default

    We have definitely seen this error under FF1.5 (and we have made several fixes to code to deal with it - which will be available in the next release).

  4. #4
    Join Date
    Sep 2005
    Location
    Sunnyvale, CA
    Posts
    269
    Rep Power
    10

    Default

    In the meanwhile, make an extra call to the "_enableDesignMode" method in DwtHtmlEditor - I'm assuming you created a subclass of DwtTabViewPage, so you can make the call by overloading the showMe() method (dont forget to call the base class first).

    This way, you force the html editor (re: iframe) to always remember that its in design mode.

  5. #5
    Join Date
    Oct 2005
    Posts
    6
    Rep Power
    9

    Thumbs down Thanks, but...

    Thanks for all your suggestions.

    I did fail to mention that after clicking in the DwtHtmlEditor, and after the exception, the insertion point (cursor) does NOT show up in the Editor, and typing doesn't insert any text. It just doesn't work.

    I didn't subclass DwtTabViewPage... should I have? I just create a Page and then use it as a parent for the various widgets I want to stick in there. So I did try overriding showMe like this:

    Code:
      var chatmsg = ... // this is my DwtHtmlEditor
      chattab.showMe = function() {
        DwtTabViewPage.prototype.showMe.call(this);
        alert('_enableDesignMode');
        chatmsg._enableDesignMode();
      };
    The alert shows up when I switch to the chat tab, but I still get the exception when I try to use the Editor. I was playing with some resize event handling elsewhere and found it useful to delay examining the DOM object sizes for a moment, so I thought something similar might work here:

    Code:
      var chatmsg = ... // this is my DwtHtmlEditor
      chattab.showMe = function() {
        DwtTabViewPage.prototype.showMe.call(this);
        setTimeout( function() {
          alert('_enableDesignMode');
          chatmsg._enableDesignMode();
        }, 1 );
      };
    Now the alert doesn't show up until the Editor is visible in the window (after switching to its tab). But all to no avail -- same exception, same failing Editor widget.

    So how soon is that new version coming?
    --Chouser

Similar Threads

  1. Tab Key: Focus Mechanism or Composition Tool?
    By bhickey in forum Administrators
    Replies: 0
    Last Post: 03-29-2007, 10:45 AM
  2. Replies: 2
    Last Post: 10-02-2006, 08:44 AM
  3. 3.2 M2 tab key behavior
    By pepijn in forum Administrators
    Replies: 4
    Last Post: 09-30-2006, 11:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •