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 / Re: Blank notification returned to Mediator on: August 26, 2009, 03:03:16
I didn't know that option existed! I can see the inaccessible properties now.
Thanks for letting me know :)
Ali

2  Announcements and General Discussion / General Discussion / Re: Blank notification returned to Mediator on: August 24, 2009, 04:48:23
I have everything working now so thought I'd write my findings:

My blank notification problem was that I was trying to debug the properties of INotification as it entered handleNotification() which made me think it was blank when in fact it wasn't. As the properties (body and name) aren't exposed I wasn't getting anything until I called these methods and the Flex debugger wouldn't let me drill down into the properties.

I've set a drinks ArrayCollection property in the view component that the view mediator updates so now I have encapsulation here, thanks!

My final problem with accessing the view component was solved by calling notifyObservers() in the facade, triggered by the applicationComplete event which also passes a reference to the Application. This then registers the ApplicationMediator and also passes it a ref to the Application which it in turn passes onto it's children view components.

All of this is pretty basic stuff, I hope it makes sense and may be useful to someone.
Thanks
Ali

3  Announcements and General Discussion / General Discussion / Re: Blank notification returned to Mediator on: August 24, 2009, 02:21:24
Hi Cliff, thanks for responding to my question and also for the advice on breaking the encapsulation, that completely makes sense. I'm going to step through all of my code to see where the notification is getting lost now.
Thanks for taking the time out to respond, and thanks for such a great framework!
Ali
4  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]