Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-10-2005, 02:04 PM
Junior Member
 
Posts: 6
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
Reply With Quote
  #2 (permalink)  
Old 11-10-2005, 02:26 PM
Zimbra Employee
 
Posts: 4,792
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?
Reply With Quote
  #3 (permalink)  
Old 11-10-2005, 03:30 PM
Zimbra Employee
 
Posts: 49
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).
Reply With Quote
  #4 (permalink)  
Old 11-10-2005, 05:25 PM
Zimbra Employee
 
Posts: 269
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.
Reply With Quote
  #5 (permalink)  
Old 11-11-2005, 12:02 PM
Junior Member
 
Posts: 6
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.