Open GoogleCodeExporter opened 9 years ago
Can you post the the exact MXML that is causing this issue? Also what version
of the Flex SDK are you using?
Original comment by darshan....@gmail.com
on 11 Feb 2009 at 4:48
The Flex SDK version is 3.2.0
main application mediator:
MainAppMediator
override public function onRegister():void
{
registerMediator(new LoginControlMediator(this.resolve(application)..rex
("loginControl") )); //works fine for this component it's path is
application.loginControl LoginControlMediator's onRegister fires as expected
registerMediator(new MyRunLogMediator(this.resolve(application)..rex
("myRunLogs") )); //this one never fires MyRunLogMediator's onRegister. It's
hierarchical path is application.customPanel.tabNavigator.myRunLogs
}
I tried debugging the ComponentResolver but without success.
If I do the following:
registerMediator(new MyRunLogMediator(this.resolve(application)..rex
("tabNavigator") )); - it works (meaning that onRegister method of the Mediator
gets
fired and, obviously, I get a null object coercion error since the
viewComponent is
of different type.
Original comment by a.mikhai...@gmail.com
on 11 Feb 2009 at 5:02
[deleted comment]
...forgot to add:
So once you switch it back from ..rex("tabNavigator") to ..rex("myRunLogs") it
never
fires Mediator's onRegister.
I can set up a few break points at ComponentResolver and see what happens if
you can
point me in the right direction.
Original comment by a.mikhai...@gmail.com
on 11 Feb 2009 at 5:06
[deleted comment]
Your registration code looks ok, Can you please post the actual MXML you are
using. I
tried running ..rex on some simple layouts like the TabNavigator you suggested
which
worked. I would like to test against your actual MXML. Thanks.
Original comment by darshan....@gmail.com
on 11 Feb 2009 at 5:28
My suspicion is that some event doesn't bubble up. Is framework attaching
listeners
to the main <fab:FlexApplication/> and listening for creationComplete from any
descendant component, then running through a dictionary of registered mediators
to
instantiate mediators with component reference as oppose to ComponentResolver
instance? Is that the logic? Which event are you listening for from the
children
components?
Original comment by a.mikhai...@gmail.com
on 11 Feb 2009 at 5:29
It's a big solution (project) with a bunch of references. I'll have to
extrapolate a
subset specifically for this test.
Original comment by a.mikhai...@gmail.com
on 11 Feb 2009 at 5:31
I've posted a "View Source" section, which I think is best in this situation.
http://mikhailau.com/fabrication/srcview/
Original comment by a.mikhai...@gmail.com
on 11 Feb 2009 at 5:42
The focus is on:
view.mediators.MyRunLogMediator
view.components.tabcomponents.MyRunLog
Original comment by a.mikhai...@gmail.com
on 11 Feb 2009 at 5:45
It would be great if you could post some mxml. Or try using only the descendant
operators. resolve(application)..myRunLogs.
The resolved logic is to listen for the childAdd event from the main component
which
gets bubbled up. Then wait for the source component to be initialized. Some
components like Containers need coaxing where you have to locate the child by
using
getChildByName. This is also used when the component could already have been
created
at the time the registration was invoked.
Original comment by darshan....@gmail.com
on 11 Feb 2009 at 5:48
I have tried using the descendant operator and got the same results. So that is
why
I was leaning towards the thought of the event not bubbling through.
The src is up http://mikhailau.com/fabrication/srcview/
These are the bad boys:
view.mediators.MyRunLogMediator
view.components.tabcomponents.MyRunLog
Original comment by a.mikhai...@gmail.com
on 11 Feb 2009 at 5:55
Ok got it. Let me debug this a little.
Original comment by darshan....@gmail.com
on 11 Feb 2009 at 6:06
np
Original comment by a.mikhai...@gmail.com
on 11 Feb 2009 at 6:13
Any news from debugging it?
Original comment by a.mikhai...@gmail.com
on 11 Feb 2009 at 1:58
I have replicated the bug. But haven't found a solution yet. The childAdd event
doesn't seem to bubble up...
Original comment by darshan....@gmail.com
on 11 Feb 2009 at 3:06
That was my suspicion without even going farther because a level higher
component
(such as tabNavigator) would work fine or any component for that matter, but
the
myRunLogs. Is it something to do with the TabNavigator component you think? I
know
it is poorly built because to pre-define the "selectedIndex" you have to
override
commitProperties as the tabBar never receives the value of selectedIndex...
things
like that. Just a thought.
Original comment by a.mikhai...@gmail.com
on 11 Feb 2009 at 3:11
An interesting finding:
if i add "childAdd" event listener to the tabNavigator I see relatedObject
as "myRunLogs" coming through. When I trace out each event's event.bubbles
value, I
get false.
Original comment by a.mikhai...@gmail.com
on 11 Feb 2009 at 3:46
Is this the problem? (from mx.core.Container.as)
override mx_internal function childAdded(child:DisplayObject):void
{
dispatchEvent(new Event("childrenChanged"));
var event:ChildExistenceChangedEvent =
new ChildExistenceChangedEvent(
ChildExistenceChangedEvent.CHILD_ADD);
event.relatedObject = child;
dispatchEvent(event);
child.dispatchEvent(new FlexEvent(FlexEvent.ADD));
super.childAdded(child); // calls createChildren()
}
Original comment by a.mikhai...@gmail.com
on 11 Feb 2009 at 3:54
If I try to force event to bubble as in mx.container.Container.as
override mx_internal function childAdded(child:DisplayObject):void
{
dispatchEvent(new Event("childrenChanged"));
var event:ChildExistenceChangedEvent =
new ChildExistenceChangedEvent(
ChildExistenceChangedEvent.CHILD_ADD,true);
event.relatedObject = child;
dispatchEvent(event);
child.dispatchEvent(new FlexEvent(FlexEvent.ADD));
super.childAdded(child); // calls createChildren()
}
it breaks the framework
Original comment by a.mikhai...@gmail.com
on 11 Feb 2009 at 4:04
I came to a similar conclusion. I am going to look at the resolver
implementation
over the weekend and try to figure out a better way to do deeper resolution.
For the moment I think you may have to listen for creationComplete from the
myRunLogs
component and then register its mediator.
Original comment by darshan....@gmail.com
on 12 Feb 2009 at 5:25
any update?
Original comment by gretel....@gmail.com
on 17 Jun 2009 at 12:00
Hi, we are having the same issue on a quite a large project.
Is there any change this will be fixed?
We are working around the issue now by listening to the creationComplete of the
child ... but it would be nice if
it would just work as you suppose ;-)
Cheers,
Frederik Jacques
Original comment by frederik...@me.com
on 30 Mar 2010 at 10:50
I've tried the Slaker Demo and modified it a little bit to use it with Flex
Spark components. I found out that onRegister method is only called if I use
the the mx components (instead of Spark). So is there any solution or fix for
this problem?
If not can somebody please explain the creationComplete workaround described
above?
Thanks.
Original comment by holger.s...@gmail.com
on 15 Dec 2011 at 3:39
Addition to former post: Also the reactTo method doesn't work with any(?) Spark
component. I've testet it with the s:NavigatorContent in a mx:ViewStack.
Original comment by holger.s...@gmail.com
on 15 Dec 2011 at 3:46
In my case it works, when I replaced the mx:ViewStack with the CustomViewStack
from the Flex 4 Cookbook
(http://cookbooks.adobe.com/post_Creating_a_Spark_based_ViewStack-17726.html).
Original comment by holger.s...@gmail.com
on 15 Dec 2011 at 4:52
Original issue reported on code.google.com by
a.mikhai...@gmail.com
on 10 Feb 2009 at 11:22