Announcement

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

    DrawImages throw JavaScript error after they are destroyed

    I have an application that creates DrawImages and attaches them to DrawPanes. These are destroyed and recreated as part of using the app. As of Smart GWT EE 4.1-20160210, I discovered that a JavaScript error is thrown after the DrawImages are destroyed. I tried with the debug version of the models, and get the following stack trace:

    ISC_Drawing.js:8971 Uncaught TypeError: Cannot read property 'redrawBitmap' of null
    image.onload @ ISC_Drawing.js:8971

    This is attached to the onload event of the <img> tag underlying the DrawImage object:
    Code:
                image.onload = function () {
                    if (self.drawingBitmap) {
                        self.drawPane.redrawBitmap();
                    }
                };
    To be transparent, I don't understand why the image is firing a load event after the DrawImage has been destroyed. I was able to verify that the values for self.destroyed and self.destroying are true in the Chrome debugger. Our app code doesn't change the value of src or set the drawPane to null explicitly, so I don't know. However, I was able to correct this with a simple fix:

    Code:
                image.onload = function () {
                    if (self.drawingBitmap [B]&& self["drawPane"][/B] != null) {
                        self.drawPane.redrawBitmap();
                    }
                };
    Any chance a fix like this could be rolled into 4.1? Let me know if I need to provide more detailed code a or a reproduction case.

    Key details:
    -SmartGWT EE 4.1-20160210
    -SmartClient console version: v9.1p_2016-02-10/Enterprise Deployment (built 2016-02-10)
    -Browsers where issue was observed:
    1. Chrome 49.0.2623.112
    2. Internet Explorer 11.212.10586.0
    Last edited by tory_mckeag; 21 Apr 2016, 12:45. Reason: Uh strike 2? Sorry, should have hit preview before I posted the first time.

    #2
    Any thoughts? Sorry to be annoying, but it's been a couple weeks and no response.

    Comment


      #3
      Hi, we'll take a look - in the future if you botch a post please reply to the thread rather than editing the post in place. If you edit in place there is no new notification, so we may not notice that you have added information sufficient for us to look into the issue.

      Comment

      Working...
      X