Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

| * |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / General Discussion / Blank notification returned to Mediator on: August 18, 2009, 03:45:54
Hi there, thanks for checking my post. I've read through the best practice and other introductory documents and have completed a couple of AS3/Flex tutorials so this is my first attempt at building a puremvc app from the ground up. I guess I've missed something obvious but if someone could take time to let me know what that obvious thing is I would be really grateful!

I'm building a simple app that populates a combo box with a list of drinks and then stores the order in a proxy.

My problem is that when my DrinksListProxy sends a notification (to populate the combo box where you select a drink) it is received by my DrinkComboMediator but the notification is blank (flex traces org.puremvc.as3.patterns.observer.Notification (@222254e9)). I've put breakpoints in my code to check the notification is generated correctly and the body and name seem to be set but when my handleNotification method is reached, I get the blank notification. Here's my code from DrinkComboMediator:
:
override public function listNotificationInterests():Array
{
var retA:Array = [
ApplicationFacade.DRINKS_LIST_RECEIVED

];
return retA;
}

override public function handleNotification(notification:INotification):void
{
//blank notification received here!
var drinksListProxy:DrinksListProxy = facade.retrieveProxy(DrinksListProxy.NAME) as DrinksListProxy;
switch ( notification.getName() )
{
case ApplicationFacade.DRINKS_LIST_RECEIVED:
//set data provider  TODO target the drinks combo correctly
viewComponent.drinksCombo.dataProvider = notification.getBody() as ArrayCollection;
break
default : break;
}

}

You can download the source from here:
http://dl.getdropbox.com/u/65140/DrinkTouchLight.zip


My second problem (which is more flex related than puremvc) is that I can't target my drinksCombo mxml component from my DrinksMediator class. This is the view component that contains the combo box. Again I think I've made a pretty basic error here but if someone could point it out I'd be really grateful.

If anyone could assist it would be a massive help as I'm really enjoying working with puremvc but I've hit an obstacle I can't seem to get over.

Thanks in advance,
Ali



Pages: [1]