Announcement

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

    Bug in SmartClient's core while using jQuery and Internet Explorer 10

    Hi,

    we encountered a bug in SmartClient's core while using jQuery and Internet Explorer 10.
    SmartClient Version: v9.1p_2014-09-30/LGPL Deployment (built 2014-09-30)
    IE v10.0.9200.16750, update version 10.0.12 under Windows 7.

    The issue can be triggered by firing an event through jQuery. SmartClient's dispatch() gets called and throws a JavaScript error. Thus further code after triggering the event will not be executed anymore.

    We are using this test page:
    [HTML]
    <!DOCTYPE html>
    <html>
    <head>
    <script type="text/javascript">
    window.isomorphicDir = '/isomorphic/';
    </script>

    <script type="text/javascript" src="/isomorphic/system/modules-debug/ISC_Core.js"></script>
    <script type="text/javascript" src="/isomorphic/system/modules-debug/ISC_Foundation.js"></script>
    <script type="text/javascript" src="/isomorphic/system/modules-debug/ISC_Containers.js"></script>
    <script type="text/javascript" src="/isomorphic/system/modules-debug/ISC_Grids.js"></script>
    <script type="text/javascript" src="/isomorphic/system/modules-debug/ISC_Forms.js"></script>
    <script type="text/javascript" src="/isomorphic/system/modules-debug/ISC_RichTextEditor.js"></script>
    <script type="text/javascript" src="/isomorphic/system/modules-debug/ISC_DataBinding.js"></script>
    <script type="text/javascript" src="/isomorphic/system/modules-debug/ISC_Drawing.js"></script>
    <script type="text/javascript" src="/isomorphic/skins/Enterprise/load_skin.js"></script>
    <script type="text/javascript" src="/isomorphic/locales/frameworkMessages_de.properties"></script>

    <script type="text/javascript" src="/inc/jquery-1.9.1.min.js"></script>
    </head>

    <body>
    <div>Foo</div>

    <script type="text/javascript">
    $(function() {
    $('div').click(function() {
    $(this).css('color', 'red');
    });

    $('div').click(); // trigger error in SmartClient
    $('div').text('Bar'); // will NOT be executed because of SmartClient
    });
    </script>
    </body>
    </html>[/HTML]IE's console shows this error:
    Code:
    SCRIPT5007: Die Eigenschaft "type" eines undefinierten oder Nullverweises kann nicht abgerufen werden. 
    ISC_Core.js, Zeile 35161 Zeichen 5
    Result in IE: Text is "Foo"
    Expected result: Text is "Bar"

    We looked into this problem and suggest to replace
    Code:
     # ISC_Core.js, l. 35158
    if (isc.Browser.isIE) event = this.getWindow().event;
    with
    Code:
    if (isc.Browser.isIE) event = this.getWindow().event || event;
    This will avoid overriding the actual event the method got by parameter with a null value getWindow().event returns.

    #2
    This isn't actually a SmartClient bug - what's happening is that jQuery implements its own synthetic event dispatching (instead of EventTarget.dispatchEvent()) where it iterates up the DOM, invoking event handlers manually. When JQuery does this, window.event, which should normally never be non-null during event processing, is in fact null.

    Regardless, we've worked around this so that JQuery's approach works. The change will be present in tomorrow's builds.

    Comment

    Working...
    X