Modules and DragManager bug in Flex 3

In my last RIA project based on Flex 3, I find a bug working with modules that I’d like to sharing in this blog.

I create a dashboard where 4 custom components, that extend Panel component, load in a ModuleLoader differents sections.
In those sections there are components based on List component and when I run my project I’ve this kind of error:

TypeError: Error #1034: Type Coercion failed: cannot convert mx.managers::DragManagerImpl@21ef6df9 to mx.managers.IDragManager.

Surfing on web I don’t find anything about this kind of problem, finally on JIRA Adobe Flex bugs, I find it!
You can find workaround on JIRA ticket, it’s so easy to solve it, you only create a new instance of DragManager in your Default Application and everything works well.
This bug is created because you have more instance of DragManager in this sample, but DragManager in Flex framework is used like a Singleton so only one instance per time.
Each module has a List component that use DragManager when you have in the same application 2 or more modules you must put in Default Application file a DragManager instance and that’s it!
I think could be useful for anybody in the same situation.

Advertisement

First impressions about Flash Catalyst

Yesterday I was in Milan at From A to Web and I saw Serge Jespers session about RIA workflow with Flash Catalyst and Flash Builder.

In 30 minutes he made a real Flex application that interact with Coldfusion to retrieve data from a database and he started from a normal and static AI file… that’s totally AMAZING!
Flash Catalyst will be a great software that will help us to create desktop applications and rich internet application, in particular could be very interesting to create animations and user interaction on own GUI.

When Serge showed Flash Builder he interacted with a CF script (you can work with WS, XML and other back end tecnologies also) trough a panel and in few steps he was connected to data source… COOL!
I’m so excited, Flash Catalyst will change RIA and desktop apps workflow definitely! I’m sure about that… BUT…

I’d like to investigate more about Flash Catalyst when Adobe decides to release public BETA on Labs, but I asked a couple of questions to Serge during his session to understand better the power of this new software.
For me the first problem is that FC doesn’t work with Flex Modules but only with States and in big projects it could be a problem.
Yes, you can copy MXML code and  paste on a Module, but it could be more easy to choose if you want to work with states or modules or better, export your GUI like module and not only custom component.
Another thing that I’m scared is that FC is very easy to use, open new way of business and make your daily work more fast, so designers and developers that approach for first time RIA and Desktop apps could start to release tons and tons of “bad apps” like Flash in 90s… I hope that Adobe will teach around the world with free training courses, not only with one day events, or will begin a new HORROR ERA for RIA and Desktop apps.

That’s my 2 cents, if you’d like to talk about FC on this blog, feel free to leave a comment.