Announcement Announcement Module
Collapse
No announcement yet.
Flex 4.5 (Hero) Login Example for Mobile Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Flex 4.5 (Hero) Login Example for Mobile

    Hi there,

    I am trying to create a Flex 4.5 (Hero) Login Example for Mobile devices, see:

    http://code.google.com/p/masuland/wiki/LoginExample or
    http://code.google.com/p/masuland/wi...MVCpshCtl_PInj

    When running the application I am getting this error:

    Code:
    VerifyError: Error #1014: Class mx.modules::Module could not be found.
    
    	at com.masuland.loginexample::AppConfig/initialized()[/Users/masu/Documents/Adobe Flash Builder 4.5/LoginExampleFx4HeroSpringMobileMVCpshCtl_PInj/src/main/flex/com/masuland/loginexample/AppConfig.as:52]
    	at index/_index_AppConfig1_i()
    	at index()[/Users/masu/Documents/Adobe Flash Builder 4.5/LoginExampleFx4HeroSpringMobileMVCpshCtl_PInj/src/main/flex/index.mxml:9]
    	at _index_mx_managers_SystemManager/create()[_index_mx_managers_SystemManager.as:50]
    	at mx.managers.systemClasses::ChildManager/initializeTopLevelWindow()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\systemClasses\ChildManager.as:311]
    	at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\SystemManager.as:3063]
    	at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::kickOff()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\SystemManager.as:2849]
    	at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::preloader_completeHandler()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\SystemManager.as:2729]
    	at flash.events::EventDispatcher/dispatchEventFunction()
    	at flash.events::EventDispatcher/dispatchEvent()
    	at mx.preloaders::Preloader/timerHandler()[E:\dev\hero_private\frameworks\projects\framework\src\mx\preloaders\Preloader.as:542]
    	at flash.utils::Timer/_timerDispatch()
    	at flash.utils::Timer/tick()
    The source code can be found in the SVN of Google Code:
    http://masuland.googlecode.com/svn/t...tl_PInj/trunk/

    Any ideas?

  • #2
    Flex dependency

    The FlexXMLApplicationCOntext has a dependency on the Flex mx.modules.Module class which isn't available in the mobile SDK. We're planning to remove this dependency in future version of SpringAS.
    For now the only workaround is to use the XMLApplicationContext.

    Hope that helps,

    cheers,

    Roland

    Comment


    • #3
      Thanks Roland,

      just tried your quick fix ... I have switched FlexXMLApplicationContext to XMLApplicationContext:

      PHP Code:
              public var applicationContext:XMLApplicationContext
      ... and added the FlexStageDefaultObjectSelector class because it was needed:

      PHP Code:
              // Force inclusion of classes not referenced elsewhere in the code
              
      {
                  
      AppController
                  
      AppMockDelegate
                  
      FlexStageDefaultObjectSelector,
                  
      EventHandlerMetadataProcessor
                  
      DefaultAutowiringStageProcessor
                  
      RouteEventsMetaDataProcessor
              

      Now I am getting another error:

      PHP Code:
      ErrorCan't autowire property by name: Unsatisfied dependency in object [settingsBoxCP] for property [currentLocale]
          at org.springextensions.actionscript.ioc.autowire::DefaultAutowireProcessor/autoWireFieldByName()[C:\projects\tmp\spring-actionscript-core\src\main\actionscript\org\springextensions\actionscript\ioc\autowire\DefaultAutowireProcessor.as:324]
          at org.springextensions.actionscript.ioc.autowire::DefaultAutowireProcessor/autoWireField()[C:\projects\tmp\spring-actionscript-core\src\main\actionscript\org\springextensions\actionscript\ioc\autowire\DefaultAutowireProcessor.as:262]
          at org.springextensions.actionscript.ioc.autowire::DefaultAutowireProcessor/autoWire()[C:\projects\tmp\spring-actionscript-core\src\main\actionscript\org\springextensions\actionscript\ioc\autowire\DefaultAutowireProcessor.as:183]
          at org.springextensions.actionscript.ioc.factory.support::AbstractObjectFactory/wire()[C:\projects\tmp\spring-actionscript-core\src\main\actionscript\org\springextensions\actionscript\ioc\factory\support\AbstractObjectFactory.as:592]
          at org.springextensions.actionscript.ioc.factory.support::AbstractObjectFactory/buildObject()[C:\projects\tmp\spring-actionscript-core\src\main\actionscript\org\springextensions\actionscript\ioc\factory\support\AbstractObjectFactory.as:528]
          at org.springextensions.actionscript.ioc.factory.support::AbstractObjectFactory/getObject()[C:\projects\tmp\spring-actionscript-core\src\main\actionscript\org\springextensions\actionscript\ioc\factory\support\AbstractObjectFactory.as:388]
          at org.springextensions.actionscript.ioc.factory.support::DefaultListableObjectFactory/preInstantiateSingletonsWithObjectDefinition()[C:\projects\tmp\spring-actionscript-core\src\main\actionscript\org\springextensions\actionscript\ioc\factory\support\DefaultListableObjectFactory.as:214]
          at org.springextensions.actionscript.ioc.factory.support::DefaultListableObjectFactory/preInstantiateSingletons()[C:\projects\tmp\spring-actionscript-core\src\main\actionscript\org\springextensions\actionscript\ioc\factory\support\DefaultListableObjectFactory.as:191]
          at org.springextensions.actionscript.context.support::AbstractApplicationContext/resourceLoadQueue_completeHandler()[C:\projects\tmp\spring-actionscript-core\src\main\actionscript\org\springextensions\actionscript\context\support\AbstractApplicationContext.as:455]
          at org.springextensions.actionscript.context.support::AbstractApplicationContext/loadComplete()[C:\projects\tmp\spring-actionscript-core\src\main\actionscript\org\springextensions\actionscript\context\support\AbstractApplicationContext.as:306]
          at org.springextensions.actionscript.context.support::XMLApplicationContext/parse()[C:\projects\tmp\spring-actionscript-core\src\main\actionscript\org\springextensions\actionscript\context\support\XMLApplicationContext.as:398]
          at org.springextensions.actionscript.context.support::XMLApplicationContext/loadNextConfigLocation()[C:\projects\tmp\spring-actionscript-core\src\main\actionscript\org\springextensions\actionscript\context\support\XMLApplicationContext.as:436]
          at org.springextensions.actionscript.context.support::XMLApplicationContext/loader_completeHandler()[C:\projects\tmp\spring-actionscript-core\src\main\actionscript\org\springextensions\actionscript\context\support\XMLApplicationContext.as:370]
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at flash.net::URLLoader/onComplete() 
      For some reason the property injection seems to be broken now:

      PHP Code:
              [Inject(name='appModel'property='currentLocale')]
              [
      Bindable]
              public function 
      get currentLocale():LocaleVO
              
      {
                  return 
      _currentLocale;
              }
              
              public function 
      set currentLocale(value:LocaleVO):void
              
      {
                  
      _currentLocale value;
                  
                  
      _isCurrentLocaleDirty true;
                  
      invalidateProperties();
              } 
      ... see SettingsBoxCP.as file in the SVN:
      http://masuland.googlecode.com/svn/t...ttingsBoxCP.as

      Any ideas how to fix that?

      Comment


      • #4
        springas bug

        Hey there,

        there is a known issue with external property files and metadata based injections, are you using multiple property files perhaps?
        There is a forum post here somewhere that describes the same problem.
        Normal injections will work fine, but injecting external properties sometimes fail. I'll try and look up the post.

        cheers,

        Roland

        Comment


        • #5
          Hey Roland,

          Maybe you mean that post "Context does not autowire external properties anymore" ... see:

          http://forum.springsource.org/showth...bject+property

          Not sure how this could help us!? Thanks for your help!

          Comment


          • #6
            Hey there,

            Flash Builder 4.5 has been released yesterday:

            http://www.adobe.com/products/flash-builder.html

            ... which means we could use Spring AS for Mobile development. When do you think there will be an update of Spring AS available so that we can continue working with common Spring AS features like property injection ... see code:

            PHP Code:
            [Autowired(name='ModelLocator'property='products')]
             public var 
            products:ArrayCollection
            PHP Code:
            [Inject(name='ModelLocator'property='productManager.products')]
             public var 
            products:ArrayCollection
            ... and the Spring AS documentation section "2.1.2.17. Binding an object property to a property of an object in the container":

            http://www.springactionscript.org/do..._the_container

            Thanks and sorry for the rush,
            masu

            Comment


            • #7
              unsure

              Hi there,

              a version 1.2 is in the making, it might even be released as a v1.5, we're not sure yet. We are also in the process of preparing for v2.0 development.

              Unfortunately all of our opensource activities are being done in our spare time, therefore it virtually impossible for us to give any kind of timeline on when things will be ready and released. We can't predict when family, work and life in general gets in the way of OS development.

              I'm sorry I don't have a definitive answer for you.

              cheers,

              Roland

              Comment


              • #8
                currently in version 1.1 with Flex 4.5 SDK,when you got the error "mx.modules::Module could not be found", please replace "import mx.modules.Module" to "import spark.modules.Module", then rebuild the lib, and be fine.

                Comment


                • #9
                  Hi there,

                  I have filed a bug for this issue:
                  https://jira.springsource.org/browse...ONSCRIPTAS-140

                  Thanks @NeoGuo ... I will give it a try!

                  Comment


                  • #10
                    I had the same issue, but it is not too hard to remove the mx.Module dependency from Spring AS, the compiled workaround can be found at http://www.igindo.com/springASMob.zip, you can then use SparkXMLApplicationContext.

                    Alternatively, there's no harm to include the mx package manually to your mobile project

                    Comment


                    • #11
                      v2

                      Hey guys,

                      for now I would ask you to use the aforementioned workarounds. Spring Actionscript v2.0 will make use of as3commons.stageprocessing for the stage autowiring and this library (which is actually lifted and improved from Spring Actionscript 1.1) doesn't have any dependency on any kind of module.
                      It uses a root view which can be any DisplayObject, so that way a context can be associated with a module, but also a subapplication, or just a particular component.

                      But that'll be in v2.0, which is still quite a long way away

                      Any feature request for v2.0, please use JIRA

                      cheers,

                      Roland

                      Comment

                      Working...
                      X