1. #1
    Ext JS Premium Member n3rd's Avatar
    Join Date
    Nov 2007
    Location
    Munich
    Posts
    72
    Vote Rating
    0
    n3rd is on a distinguished road

      0  

    Question Firing events on popups (IE)

    Firing events on popups (IE)


    Hello,

    we're currently developing an application that makes extensive use of popup windows(*) and have run into an issue on IE (this has been reported before but I couldn't find any solution).

    The problem is this: our main window M opens a popup window P and keeps a reference to it. P then registers an event handler on an object in M. When the event fires, IE8 bombs out with the following error message:
    Code:
    JScript object expected
    ext-all-debug.js (Line 1735, Char 17)
    Code: 0
    which is the fire-function in EXTUTIL.Event.prototype. The code works fine in Firefox, Opera and Chrome.

    You can see a minimal example of this here (click "open popup" and then "fire event").


    Any hints as to how I can resolve this issue?


    (*) Yes, there's a good reason for that. And no, Ext.Window is not an option.

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,506
    Vote Rating
    54
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Why is Ext.Window not an option?

  3. #3
    Ext JS Premium Member n3rd's Avatar
    Join Date
    Nov 2007
    Location
    Munich
    Posts
    72
    Vote Rating
    0
    n3rd is on a distinguished road

      0  

    Default


    Because the popups are "satellite windows" that the user can place on his screen whereever he likes. Ext.Windows can only be positioned inside the original browser window. Our customer wants it this way and there really isn't much leeway on this.

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    92
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    I just posted an answer to the same question:

    Ext is NOT safe to be used across windows. Each window should have it's own Ext instance and communication between the two windows should only be done using primitive datatypes (String, Number, Boolean, Date).

    This means that you can't register an event handler in a different window, because that would mean passing objects to the other window.

  5. #5
    Ext JS Premium Member n3rd's Avatar
    Join Date
    Nov 2007
    Location
    Munich
    Posts
    72
    Vote Rating
    0
    n3rd is on a distinguished road

      0  

    Default


    Well, that sucks :-/

    Do I understand you correctly that this is a limitation within Ext and not impossible per se? In that case, shouldn't this be filed as a bug? Or is IE the bad guy here?

    What workaround would you suggest? Marshalling the objects that are being passed to a different window?

  6. #6
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    92
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    That fact that you can't use a single Ext instance for 2 windows is a limitation in Ext (the ManagedIframe user extension has a lot of code to make this possible).

    The fact that you can't pass objects from one window to another is a problem in IE (every window has it's own memory management and one window could destroy the object while the other is still using it).

  7. #7
    Ext JS Premium Member n3rd's Avatar
    Join Date
    Nov 2007
    Location
    Munich
    Posts
    72
    Vote Rating
    0
    n3rd is on a distinguished road

      0  

    Default


    Ah okay. Because I do not share Ext instances. I simply have references from one window to objects in the other.

    I see if I can find a way around this. Thank you.

Similar Threads

  1. Window Events Not Firing
    By Delete in forum Ext GWT: Help & Discussion (1.x)
    Replies: 2
    Last Post: 17 Jul 2008, 2:11 AM
  2. Firing Custom Events
    By seanodonnell in forum Ext 2.x: Help & Discussion
    Replies: 13
    Last Post: 20 Mar 2008, 5:14 AM
  3. HtmlEditor events not firing?
    By laurie in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 28 Nov 2007, 8:35 PM

Thread Participants: 2