Modules and PopUps again

25 views
Skip to first unread message

Michael Harper

unread,
Aug 16, 2010, 5:11:44 AM8/16/10
to Swiz Framework
Hi

I've seen this issue before so it may have been exhausted by now so
sorry in advance.

The issue: within modules popup [Inject] tags don't work so you have
to pass instances of the classes you need within the popup window
instead.

I'm really looking for advice on a clean way to handle this or if
there will be a future release that will support the module popup
injections. My questions more clearly;

1) Is any work being carried out or being planned to be carried
out to make module popup inject tags work?
2) Has anyone found a workaround that isn't to code heavy

Thanks

Mike

PS. Very impressed with Swiz generally, I would just like to enforce
the same clarity on popup code that Swiz gives you elsewhere

Brian Kotek

unread,
Aug 16, 2010, 11:17:55 AM8/16/10
to swiz-fr...@googlegroups.com
First, a bit of background. Swiz listens for objects being added to the display list to trigger setting up the view as a bean. Since PopUps are not added to the display list, Swiz also listens for objects being added to the SystemManager, which is where PopUps are added (and to me is a very questionable decision on the part of the SDK team, but that's just how it is). Since the PopUp is not an actual child of any Swiz instance, Swiz assumes that the top-level (root) Swiz instance should be the parent of the PopUp. 

We're already looking at one solution, which should allow you to create a PopUp in a Module by checking the document property of the PopUp and trying to use that to determine which Swiz instance is the correct parent. Assuming this change is incorporated into the source code, this should work for most situations. Where this WON'T work is if you have a module that creates a PopUp, and PopUp creates another PopUp. In that case, the document of the second PopUp is the first PopUp. We're also thinking about ways to try and deal with that, but that gets much more difficult. 

So, to answer your question, most situations like this SHOULD be handled correctly in the final 1.0 release. But depending on what else we can do, there may still be edge cases where you'll have to inject the correct Swiz instance or BeanFactory into whatever component is kicking off the creation of multiple levels of PopUps, and manually setting up the PopUp. I believe that should work but if you can test that setting up the PopUp manually works correctly, that would be helpful.

Thanks,

Brian



--
You received this message because you are subscribed to the Google Groups "Swiz Framework" group.
To post to this group, send email to swiz-fr...@googlegroups.com.
To unsubscribe from this group, send email to swiz-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/swiz-framework?hl=en.


Michael Harper

unread,
Aug 17, 2010, 3:14:20 AM8/17/10
to swiz-fr...@googlegroups.com
Thanks Brian that's good news. 

Once I understand manual creation I'll give it a go and post the results.

Mike

maxim.porges

unread,
Aug 18, 2010, 4:30:10 PM8/18/10
to Swiz Framework
Just my $0.02, but if Swiz provided a solid mechanism for registering
interest in/intercepting these different popup event types, and some
standard pluggable strategies for dealing with them, then that would
seem like a great start. It would also give developers the opportunity
to code their own strategies if they have special cases and configure
them in to the Swiz container. This is the approach I have typically
seen Spring for Java take for problems like this, and it's always
seemed to work nicely.

Cheers,

- max
> > swiz-framewor...@googlegroups.com<swiz-framework%2Bunsubscribe@go oglegroups.com>
> > .

Brian Kotek

unread,
Aug 24, 2010, 1:02:17 AM8/24/10
to swiz-fr...@googlegroups.com
Max, I think the problem is really that the only place you can even listen for the PopUp being added is the SystemManger, and since that is shared across the entire app, there's no way to guarantee which Swiz instance actually owns the PopUp. Or am I misunderstanding what you mean? If so, can you elaborate?

Thanks,

Brian

PS Nice Arduinome ;-) 

To unsubscribe from this group, send email to swiz-framewor...@googlegroups.com.

Michael Harper

unread,
Aug 24, 2010, 1:30:26 PM8/24/10
to Swiz Framework
Brian,

Using the SwizPopUpManager that Daniel Kroger supplied in answer to
SWIZ-30 I was able to manually set up a popup within a module
providing...

a) The parent application PopUpManager was set first, i.e import
mx.managers.PopUpManager and declare a variable in the parent
application (This is required anyway because of the flex domains)

b) I resisted making the parent application the parent of all popups,
and made sure the module view was the parent of it's popups. Obvious
really since your main application can't find the components to be
injected if they are only declared in your module swiz.

One limitation I found was because I am using a custom TitleWindow for
all my popups so the main work goes on in a sub-view of my dialog with
the TitleView being there for decoration. Although the TitleWindow
dialog was set up correctly in terms of [Inject] etc, the sub-view
wasn't. I guess I could modify the SwizzPopupManager to manually set
up the sub-views but I've almost lost the will to live with popups in
modules, so I'm happy with a manual binding.

If it weren't an absolute necessity to use modules I would ditch them.
Has anybody built a large application (in a sizeable team) without
using modules?

Cheers

Mike
> > swiz-framewor...@googlegroups.com<swiz-framework%2Bunsubscribe@go oglegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages