Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Errors trying to use RichTextEditor

    Hi,

    I'm trying to use the RichTextEditor with your latest nightly (8.3) and I'm seeing an error in Firefox and Chrome (but not IE) with the latest versions of those browsers. I tried the same thing recently with 8.2 as well and had the same errors.

    We do set document.domain. I tried hard-coding document.domain into the empty.html file referenced by Chrome but that didn't fix the "domains, ports, and protocols" message.

    This is what the loadModules tag references resolves to:
    <SCRIPT SRC=isoversion/8.3.5.15.12/isomorphic/system/modules/ISC_RichTextEditor.js?isc_version=SNAPSHOT_v8.3d_2012-05-15.js></SCRIPT><SCRIPT>isc._lastModule='RichTextEditor';</SCRIPT>

    And, this is what the RichText field looks like:
    {name:"notes", type:"richText", showTitle:true, colSpan:3,height:395,width:"*"}


    Everything works fine in IE9.

    Firefox:

    Code:
    17:02:24.966:TMR5:WARN:Log:undefined: [Exception... "Access to property denied"  code: "1010" nsresult: "0x805303f2 (NS_ERROR_DOM_PROP_ACCESS_DENIED)"  location: "http://ourdomain.com:8080/dev/isoversion/8.3.5.15.12/isomorphic/system/modules/ISC_RichTextEditor.js?isc_version=SNAPSHOT_v8.3d_2012-05-15.js Line: 161"]  [No error.stack available]
    
    Line 161:
    ,isc.A.$23i=function isc_RichTextCanvas__setHandleEditable(_1,_2){if(this.$22y()){var _3=this.getContentDocument();if(_3){if(_1||_2)_3.designMode="on";if(isc.Browser.isMoz)_3.execCommand("readonly",false,_1);if(!_1)_3.designMode="off"}}else{var _4=this.getHandle();if(_4!=null){_4.contentEditable=(_1?true:"inherit");if(isc.Browser.isIE){if(!this.isVisible()&&this.$224())

    Chrome
    Code:
    Uncaught TypeError: Object [object DOMWindow] has no method 'addEventListener'
    isc_RichTextCanvas__setupEditAreaISC_RichTextEditor.js:85
    isc_RichTextCanvas__frameLoadedISC_RichTextEditor.js:50
    (anonymous function)dpt.form:1
    onload
    
    
    
    ISC_RichTextEditor.js:85Unsafe JavaScript attempt to access frame with URL http://ourdomain.com:8080/dev/isoversion/8.3.5.15.12/isomorphic/system/helpers/empty.html from frame with URL http://ourdomain.com:8080/dev/dpt.form#. Domains, protocols and ports must match.
    isc_RichTextCanvas__setupEditAreaISC_RichTextEditor.js:85
    isc_RichTextCanvas__frameLoadedISC_RichTextEditor.js:50
    (anonymous function)dpt.form:1
    onload

    #2
    Nothing has changed in the framework in this area in a long time - almost certainly longer than whenever you tested a previous nightly. Most likely you had added a cross-domain hack to empty.html that you forgot to re-apply, or in re-applying it, something subtle went wrong such as an HTML tag that isn't closed?

    Comment


      #3
      Sorry, I should clarify I've never gotten the RichTextEditor to work correctly. I tried it awhile back and had these same errors. Then, put it on the back burner hoping the problems would resolve themselves magically with new releases. A customer has asked us for Rich text functionality so I'm picking it back up now.

      All I added to empty.html was document.domain="ourdomain.com" and I removed it because it wasn't making a difference.

      Is it possible this is a legit error message?

      Uncaught TypeError: Object [object DOMWindow] has no method 'addEventListener'
      isc_RichTextCanvas__setupEditAreaISC_RichTextEditor.js:85
      isc_RichTextCanvas__frameLoadedISC_RichTextEditor.js:50
      (anonymous function)dpt.form:1
      onload

      Comment


        #4
        Chrome seems to be giving the clearest indication that it thinks your document.domain settings are wrong. Is it possible both document.domain settings need to incorporate the port number?

        Comment


          #5
          Replacing the logic you have in empty.html with just document.domain="ourdomain.com" fixed our problem. So, there is something not quite right with your domain synchronization code in there. I noticed it is somewhat different than the domain synching code you have in Log.html which works fine for us. I tried a few tweaks on my own to see if I could get it to work in empty.html. But, no luck.

          So, now we have to hard-code the domain in two places whenever we pull down a new release from you: empty.html and printFrame.html. It isn't the end of the world. But, it would be nice to get those fixed at some point so the manual work isn't needed.

          Comment


            #6
            We've addressed this for empty.html in 8.2p and 8.3d - please retry with a fresh nightly.

            Comment


              #7
              Thanks, would it be possible for you to post the new domain synch code here so I can try it out without going through the entire process of pulling a new release down?

              Comment


                #8
                Sure - just remove the null check from the if condition in the first try block. So, it should just say this:

                if (window.opener.isc === undefined) {

                Comment


                  #9
                  Domain sync code in printFrame.html should now be fine - please retest with a nightly from 29/5 or later.

                  Comment


                    #10
                    Both work fine now, thanks.

                    Comment


                      #11
                      Unfortunately, I have the exact same error, on the 30/5 nightly build of 8.2.
                      This seems to be because window.opener is null, but window.top != window.
                      This means that the outer if condition in empy.html passes, but no further reference is made to window.top.

                      Removing "|| window.top != window" from the first script line of empty.html seems to have fixed the issue in my case (as it prevents all changes to document.domain, and the original domain is correct). But as far as I can tell it will also prevent any domain checking for empty.html when used in a frame (which is how it is used in RichTextEditor).

                      changing the if statement in the first try block to check both window.opener.isc and window.top.isc, and only changing the domain if both fail (which as I understand it is closer to the desired workflow) also seems to fix the error. something like:
                      Code:
                      if ((window.opener == null || window.opener.isc === undefined) && (window.top == window || window.top.isc === undefined)) {
                      Are either of these viable solutions, in terms of the usage of empty.html and printFrame.html in the rest of the application?

                      SmartClient Version: v8.2p_2012-05-30/LGPL Deployment (built 2012-05-30)

                      Google Chrome 19.0.1084.52
                      Code:
                      Unsafe JavaScript attempt to access frame with URL http://domain/isomorphic/system/helpers/empty.html from frame with URL http://domain/sc#committee:3. Domains, protocols and ports must match.
                       ISC_RichTextEditor.js:63
                      Uncaught TypeError: Object [object Window] has no method 'addEventListener' ISC_RichTextEditor.js:63
                      Last edited by sirjames; 3 Jun 2012, 16:55.

                      Comment


                        #12
                        Thanks for the report - further changes have been made to all internal domain sync code and all should now work in all browsers and versions.

                        Comment

                        Working...
                        X