Receiving events in popup

Tom's Avatar

Tom

10 Aug, 2010 12:27 AM

I've been looking around and can't seem to find anyone having this issue.

I have a popup that I have loaded with the following code in a different mediator class:

var clazz:Class = MedicationSelectorView;
var popup:* = clazz(PopUpManager.createPopUp(this.contextView, clazz, false));
PopUpManager.centerPopUp(popup);
mediatorMap.createMediator(popup);

In my module context, I have:

mediatorMap.mapView(MedicationSelectorView, MedicationSelectorMediator, null, false, false);

The mediator of my popup is executed and I register for an event:

eventMap.mapListener(eventDispatcher, 
    AsthmaMedicationEvent.GOT_MEDICATION_LIST_BY_CATEGORY, 
    gotMedicationListByCategory_handler);

In my model, I do the following:

    dispatch(new AsthmaMedicationEvent(AsthmaMedicationEvent.GOT_MEDICATION_LIST_BY_CATEGORY,
              null, null, this._patientType, this._medicationsByCategory));

The event is not received by my popup mediator. I don't know why.

A little more information - this is a child module of a child module. They are loaded with ModuleManager. I followed the "module doodads" example and loaded that library, so I know that things are working. All of my other events are being received correctly and managed, but not with this popup.

Any thoughts?

Thanks,
Tom

  1. 1 Posted by Jason Dias on 10 Aug, 2010 12:30 AM

    Jason Dias's Avatar

    Does your event override and implement the clone method?

    On Mon, Aug 9, 2010 at 5:27 PM, Tom <
    [email blocked]<tender%[email blocked]>
    > wrote:

  2. 2 Posted by Tom on 10 Aug, 2010 12:47 AM

    Tom's Avatar

    Hi Jason,

    It does. However, I found the problem. My service is so fast and threw the event I was trying to listen for before my class had time to register the listener. I changed the order of initialization and it worked.

    Sorry for the boneheaded post.

    Tom

  3. 3 Posted by Jason Dias on 10 Aug, 2010 12:55 AM

    Jason Dias's Avatar

    No problem, I am glad you got it worked out.

  4. Stray closed this discussion on 10 Feb, 2011 05:34 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac