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

Pages: [1]
Print
Author Topic: App update and PureMVC - urgent  (Read 8110 times)
vladakg85
Full Member
***
Posts: 22


View Profile Email
« on: August 14, 2009, 02:34:02 »

Hi,

I need to add update functionlity. I have everything ready but I put my first call to update method in startup command like this:
sendNotification(UpdaterCommand.UPDATE);
this should open update popup (if there is update) and rest is up to user. Problem... I receive bunch of errors and my view component and mediator are not connected properly.

Where is the best place to put call to update command?
Logged
vladakg85
Full Member
***
Posts: 22


View Profile Email
« Reply #1 on: August 14, 2009, 05:43:31 »

Nope, not my error (partly). A little bug in PureMVC.

A have made View component and mediator. But in mediator:
:
override public function listNotificationInterests():Array
{
return null;
}
instead
:
return [];

Because of this I received following error:
:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
                at org.puremvc.as3.multicore.core::View/registerMediator()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\View.as:193]
                at org.puremvc.as3.multicore.patterns.facade::Facade/registerMediator()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:227]
                at org.puremvc.as3.multicore.patterns.proxy::PopManagerProxy/openPopUpWindow()[D:\workspace\workspace-flex\SpinnakerFlexLib\src\org\puremvc\as3\multicore\patterns\proxy\PopManagerProxy.as:44]
                at org.puremvc.as3.multicore.patterns.proxy::PopManagerProxy/retrievePopUp()[D:\workspace\workspace-flex\SpinnakerFlexLib\src\org\puremvc\as3\multicore\patterns\proxy\PopManagerProxy.as:79]
                at com.spinnaker.poppo.control::UpdaterCommand/execute()[D:\poppo_projekat\poppo\trunk\air\src\com\spinnaker\poppo\control\UpdaterCommand.as:24]
                at org.puremvc.as3.multicore.core::Controller/executeCommand()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\Controller.as:117]
                at Function/http://adobe.com/AS3/2006/builtin::apply()
                at org.puremvc.as3.multicore.patterns.observer::Observer/notifyObserver()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Observer.as:100]
                at org.puremvc.as3.multicore.core::View/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\View.as:127]
                at org.puremvc.as3.multicore.patterns.facade::Facade/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:294]
                at org.puremvc.as3.multicore.patterns.facade::Facade/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:277]
                at org.puremvc.as3.multicore.patterns.observer::Notifier/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Notifier.as:60]
                at com.poppo.main.control::StartupCommand/execute()[D:\poppo_projekat\poppo\trunk\air\src\com\poppo\main\control\StartupCommand.as:125]
                at org.puremvc.as3.multicore.core::Controller/executeCommand()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\Controller.as:117]
                at Function/http://adobe.com/AS3/2006/builtin::apply()
                at org.puremvc.as3.multicore.patterns.observer::Observer/notifyObserver()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Observer.as:100]
                at org.puremvc.as3.multicore.core::View/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\View.as:127]
                at org.puremvc.as3.multicore.patterns.facade::Facade/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:294]
                at org.puremvc.as3.multicore.patterns.facade::Facade/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:277]
                at com.spinnaker.poppo::ApplicationFacade/startup()[D:\poppo_projekat\poppo\trunk\air\src\com\spinnaker\poppo\ApplicationFacade.as:61]
                at Poppo/initApp()[D:\poppo_projekat\poppo\trunk\air\src\Poppo.mxml:72]
                at Poppo/___Poppo_WindowedApplication1_applicationComplete()[D:\poppo_projekat\poppo\trunk\air\src\Poppo.mxml:11]
                at flash.events::EventDispatcher/dispatchEventFunction()
                at flash.events::EventDispatcher/dispatchEvent()
                at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9308]
                at mx.managers::SystemManager/preloader_preloaderDoneHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:3024]
                at flash.events::EventDispatcher/dispatchEventFunction()
                at flash.events::EventDispatcher/dispatchEvent()
                at mx.preloaders::Preloader/displayClassCompleteHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:434]
                at flash.events::EventDispatcher/dispatchEventFunction()
                at flash.events::EventDispatcher/dispatchEvent()
                at mx.preloaders::DownloadProgressBar/timerHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\preloaders\DownloadProgressBar.as:1451]
                at mx.preloaders::DownloadProgressBar/initCompleteHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\preloaders\DownloadProgressBar.as:1503]
                at flash.events::EventDispatcher/dispatchEventFunction()
                at flash.events::EventDispatcher/dispatchEvent()
                at mx.preloaders::Preloader/dispatchAppEndEvent()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:291]
                at mx.preloaders::Preloader/appCreationCompleteHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:442]
                at flash.events::EventDispatcher/dispatchEventFunction()
                at flash.events::EventDispatcher/dispatchEvent()
                at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9308]
                at mx.core::UIComponent/set initialized()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169]
                at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
                at mx.managers::LayoutManager/validateNow()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:748]
                at mx.core::UIComponent/commitCurrentState()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:7200]
                at mx.core::UIComponent/setCurrentState()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:7118]
                at mx.core::UIComponent/set currentState()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:4361]
                at com.spinnaker.poppo.view.child.components::ApplicationBottomBar/init()[D:\poppo_projekat\poppo\trunk\air\src\com\spinnaker\poppo\view\child\components\ApplicationBottomBar.mxml:25]
                at com.spinnaker.poppo.view.child.components::ApplicationBottomBar/___ApplicationBottomBar_Canvas1_creationComplete()[D:\poppo_projekat\poppo\trunk\air\src\com\spinnaker\poppo\view\child\components\ApplicationBottomBar.mxml:4]
                at flash.events::EventDispatcher/dispatchEventFunction()
                at flash.events::EventDispatcher/dispatchEvent()
                at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9308]
                at mx.core::UIComponent/set initialized()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169]
                at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
                at Function/http://adobe.com/AS3/2006/builtin::apply()
                at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8633]
                at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8573]

It would be much better to throw some error information, "You cannot return null from this method. .."
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 on: August 15, 2009, 06:31:45 »

I'm not sure how you could construe this is a bug. Why would you go to the trouble of overriding that method just to return null?

The framework implementation already handles the case of no interests:
:
        /**
         * List the <code>INotification</code> names this
         * <code>Mediator</code> is interested in being notified of.
         *
         * @return Array the list of <code>INotification</code> names
         */
        public function listNotificationInterests():Array
        {
            return [ ];
        }

-=Cliff>
Logged
Pages: [1]
Print