tag:robotlegs.tenderapp.com,2009-10-18:/discussions/robotlegs-2/13149-mediators-stopped-working-all-of-a-suddenRobotlegs: Discussion 2015-10-28T15:51:48Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T11:59:48Z2015-08-25T11:59:48ZMediators stopped working all of a sudden<div><p>Hello!</p>
<p>So I've been working with RL2 for a bit now. And my project was
going just fine. I was changing some views around, just changing
some widths and heights and repositioning them and then all of a
sudden everything just stopped working up to a certain point. My
mediators no longer got created and intialized. I have literally no
idea where to go to debug it. I can't even setup a simple project
to show what's happening as it's specific to this project. I really
dont think I cahnged anything at all having to do with the config.
I have a MainView that has some children are a part of it's MXML.
Some of those children are mediated. MainView gets mediated just
fine. I've added and Event.ADDED listener to MainView and the
children that are supposed to be mediated are added to the stage
according to the traces from the ADDED handler, but the mediators
for them are no longer being created! The only code I've changed
was width/height/position code.</p>
<p>My code is also under revisiion control and I stashed all
changes I had made since I knew it was working, and it is still
doing the same thing. So it literally CANNOT be my code that made
it stop working.</p>
<p>No clue where to even begin to look. If this sort of thing has
happened to anyone else and you were able to fix it, please let me
know!</p>
<p>Thanks!</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T12:21:11Z2015-08-25T12:21:11ZMediators stopped working all of a sudden<div><p>I've also added an ADDED_TO_STAGE event handler for the view
that isn't getting mediated, and that handler gets fired, but RL2
still isn't creating the mediator for it. I've tripled checked my
config and nothing changed there, it's still properly mapping that
view to it's mediator.</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T12:23:55Z2015-08-25T12:23:55ZMediators stopped working all of a sudden<div><p>Also tried to manually mediate the view after it was created
using mediatorMap.mediate() and the mediator still doesn't get
initialized.</p>
<p>Though views earlier in the startup of the app mediate just fine
still</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T12:31:57Z2015-08-25T12:31:57ZMediators stopped working all of a sudden<div><p>Hi,</p>
<p>Let's start with a few common problems:</p>
<ul>
<li>are you compiling against the the robotlegs source?</li>
<li>are you keeping a reference to your context?</li>
</ul>
<p>See:<br>
- <a href="https://github.com/robotlegs/robotlegs-framework/wiki/Common-Problems#metadata-stripping">
https://github.com/robotlegs/robotlegs-framework/wiki/Common-Proble...</a>
- <a href="https://github.com/robotlegs/robotlegs-framework/wiki/Common-Problems#problem-things-work-for-a-while-and-then-mysteriously-stop">
https://github.com/robotlegs/robotlegs-framework/wiki/Common-Proble...</a></p>
<blockquote>
<p>I was changing some views around, just changing some widths and
heights and repositioning them and then all of a sudden everything
just stopped working up to a certain point.</p>
</blockquote>
<p>Does this mean that the views are repositioned at run time or do
you mean you changed the code for those properties?</p>
<blockquote>
<p>I've added and Event.ADDED listener to MainView and the children
that are supposed to be mediated are added to the stage according
to the traces from the ADDED handler, but the mediators for them
are no longer being created!</p>
</blockquote>
<p>Could you also add a listener for the removed from stage event?
I'm asking that because if you are repositioning the views
dynamically, and if you are using Flex, it may be that the
components are first removed from stage before they are placed
(added to the stage) at the new position.</p>
<p>Can you also show the mapping for the views/mediators in
question?</p>
<p>Can you tell me what kind of a project that is, Flex, AIR,
as3?</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T12:36:30Z2015-08-25T12:36:44ZMediators stopped working all of a sudden<div><p>Oh, I see it's flex, since you're using mxml</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T12:48:44Z2015-08-25T12:48:44ZMediators stopped working all of a sudden<div><p>I'm using this as my code to startup RL2 in my document class.
Do I need to store the context elsewhere?</p>
<pre>
<code><fx:Declarations>
<rl2:ContextBuilder>
<mvcs:MVCSBundle/>
<config:MyAppConfig/>
</rl2:ContextBuilder>
</fx:Declarations></code>
</pre>
<blockquote>
<p>Does this mean that the views are repositioned at run time or do
you mean you changed the code for those properties?</p>
</blockquote>
<p>I am just changing some properties on the views in MXML.</p>
<blockquote>
<p>Could you also add a listener for the removed from stage
event?</p>
</blockquote>
<p>I went ahead and did that but I never get the trace that the
handler is called so I don't think it's being removed.</p>
<blockquote>
<p>Can you also show the mapping for the views/mediators in
question?</p>
</blockquote>
<p>I have a MainView that is mapped and that mapping works fine. In
MainViewMediator I listen for a context event and in that handler,
I create a new NewView and add it to MainView. This is where my
trace for added to stage works for NewView but the mediator is
never created. And this was working fine literally between two
compiles where all I did was change heights/widths of some of the
views (in MXML).</p>
<p>Mappings in my config</p>
<pre>
<code>mediatorMap.map(MainView).toMediator(MainViewMediator);
mediatorMap.map(NewView).toMediator(NewView);</code>
</pre>
<p>MainViewMediator handler to add NewView</p>
<pre>
<code>//in intiialize
addContextListener(DisplayViewEvent.DISPLAY_VIEW, handleDisplayView, DisplayViewEvent);
//in handleDisplayView
switch(viewId)
{
case ViewTypes.POINT_OF_SALE_VIEW:
newView = new PointOfSaleView();
break;
}
newView.top = 46;
newView.right = 5;
newView.bottom = 30;
newView.left = 5;
view.addElement(newView);</code>
</pre>
<p>And I also tried like I said injecting the IMediatorMap into my
MainViewMediator and after adding newView, tried mapping it
manually and the mediator was still never created/initialized</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T12:52:38Z2015-08-25T12:52:38ZMediators stopped working all of a sudden<div><p>I added a constructor to the mediator in question. It DOES get
created as the constructor is called. But the initilize is never
called. and none of that view's children that are also mediated get
theire initailize functions called. I added a constructor to a
random mediator for one of NewView's children's mediator and it's
constructor also gets called. so it's just the initalize function
sthat aren't happening.</p>
<p>Also, the views themselves aren't even showing up on the stage
even though they say they are being added.</p>
<p>I almost feel like I just need to destory the project and
recreate it. Maybe it's some weird workspace issue. I'm using
FlashDevelop. But I've never seemed to have had a problem like this
before.</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T12:59:32Z2015-08-25T12:59:50ZMediators stopped working all of a sudden<div><p>Take a deeeeeeep breath:)<br>
Let's slow down and try things step by step.</p>
<p>Try</p>
<ul>
<li>
<p>adding a NewView directly from the MainView</p>
</li>
<li>
<p>include the NewView as mxml in the MainView</p>
</li>
</ul></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T13:12:48Z2015-08-25T13:12:48ZMediators stopped working all of a sudden<div><p>mediatorMap.map(NewView).toMediator(NewView);</p>
<p>You're mapping a <strong>NewView</strong> to a
<strong>NewView</strong> instead of a NewViewMediator. But maybe
that was just a typo when you wrote the message.</p>
<p>You're creating a new PointOfSaleView, but there is no mapping
for PointOfSaleView.</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T13:18:12Z2015-08-25T13:18:32ZMediators stopped working all of a sudden<div><p>Haha, <em>INnnnnnnhale.... exhhhhhalllllleeee</em></p>
<p>Same results :) The traces for the added and the traces for the
mediators' constructors get called, but not the initialize
methods</p>
<p>Sorry the NewView to NewView was a typo, I do actually have
NewViewMediator.</p>
<p>well actually it's PointOfSaleView and PointOfSaleViewMediator,
I was just using NewView as a shorter name</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T13:22:04Z2015-08-25T13:22:04ZMediators stopped working all of a sudden<div><p>Ummmmm ok. So. One of the children of PointOfSaleView,
ChildViewA, has five child components itself. I added a VGroup
around those five components. And that's when this problem happens.
I removed that VGroup annnnnd everything is fixed....</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T13:24:15Z2015-08-25T13:24:15ZMediators stopped working all of a sudden<div><p>Hey, I didn't say exhale yet :P</p>
<p>So, exhale!</p>
<blockquote>
<p>Also, the views themselves aren't even showing up on the stage
even though they say they are being added.</p>
</blockquote>
<p>If the views are not visible, something is wrong....</p>
<p>Can you create a very simple view with a very simple mediator,
and add that view to the MainView?</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T13:25:29Z2015-08-25T13:25:29ZMediators stopped working all of a sudden<div><blockquote>
<p>I added a VGroup around those five components. And that's when
this problem happens. I removed that VGroup annnnnd everything is
fixed....</p>
</blockquote>
<p>It seems that the views get re-parented.</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T13:31:42Z2015-08-25T13:31:42ZMediators stopped working all of a sudden<div><blockquote>
<p>It seems that the views get re-parented.</p>
</blockquote>
<p>I'm not sure that I understand what that means in this context
and why it breaks it :/</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T13:40:35Z2015-08-25T13:40:35ZMediators stopped working all of a sudden<div><p>Short answer:<br>
When a component is re-parented, Flex is removing it from stage
before adding it to the new parent container, as I mentioned
above.<br>
If a view is removed from stage, its mediator is also removed.</p>
<p>Here details about Flex - reparenting and components' state
changes:<br>
<a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf63611-7ffa.html">
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c...</a></p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T13:43:52Z2015-08-25T13:43:52ZMediators stopped working all of a sudden<div><p>Hmm, OK, but those remove handlers were never being called. And
when they are re-added shouldn't RL2 then recreate/initialize the
mediators?</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T13:44:38Z2015-08-25T13:44:38ZMediators stopped working all of a sudden<div><p>See if this answer is of any use to you:<br>
<a href="http://knowledge.robotlegs.org/discussions/problems/5818-viewmediator-changes-after-windowresize#comment_34028138">
http://knowledge.robotlegs.org/discussions/problems/5818-viewmediat...</a></p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T13:45:43Z2015-08-25T13:45:43ZMediators stopped working all of a sudden<div><p>Have you tried to add a simple view with a simple mediator
already....?<br>
A view with no states, no specified positions, etc.</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T13:48:34Z2015-08-25T13:48:34ZMediators stopped working all of a sudden<div><p>This view in question doesn't have states (at least none
explicitly defined by me. And the overall component it's based on
is simply a Group)</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T13:49:39Z2015-08-25T13:49:39ZMediators stopped working all of a sudden<div><p>I'm not sure why this would affect it anyway as I'm not doing it
dynamically. The VGroup was just added in MXML. There are hundreds
of VGroups/HGroups and such elsewhere surrounding other componets
in other classes and it works fine in those. This is why I hate
Flex. So wish I could just do this in pure ActionScript :)</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T13:50:05Z2015-08-25T13:50:05ZMediators stopped working all of a sudden<div><p>Yeah, but make an effort and do add a simple view as I
said:)</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T13:54:33Z2015-08-25T13:54:33ZMediators stopped working all of a sudden<div><p>Do so:</p>
<p>In main view add a handler for the added to stage event.<br>
Inside that handler do:</p>
<p>var someView:SomeView = new SomeView();<br>
addElement(someView);</p>
<p>where someView is a simple Group.<br>
Create a SomeMediator.<br>
Map SomeView to SomeMediator.</p>
<p>Tell me what happens.</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:03:10Z2015-08-25T14:06:53ZMediators stopped working all of a sudden<div><blockquote>
<p>I'm not sure why this would affect it anyway as I'm not doing it
dynamically. The VGroup was just added in MXML.</p>
</blockquote>
<p>Well, in your previously posted code you added the new view to
the view itself (MainView), not to the VGroup. MainView is probably
the windowed application, right?<br>
You're adding newView dynamically, but maybe not to the right
parent container.</p>
<p>Too bad I can't see your code, because I'm sure I'd find the
culprit. There is something trivial going on, but it's hard to tell
what that is from here.</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:05:59Z2015-08-25T14:05:59ZMediators stopped working all of a sudden<div><p>OK If I did it in the correct wat that you wanted me to it works
just fine.</p>
<p>Created DummyView.mxml that is just an empty spark Group.</p>
<p>In MainView, added event handler for ADDED_TO_STAGE and in the
handler, created new DummyView and added it.</p>
<p>In config file mapped a DummyViewMediator to DummyView.</p>
<p>I traced out the constructor and intiailize of DummyViewMediator
and it all works fine</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:07:28Z2015-08-25T14:07:51ZMediators stopped working all of a sudden<div><p>Ah sorry, no, my structure as of now is</p>
<pre>
<code>WindowedApplication
---> MainView
--->--->PointOfSaleView
--->--->--->KeywordListView
--->--->--->PackageListView
--->--->--->--->Child1
--->--->--->--->Child2
--->--->--->--->Child3
--->--->--->--->Child4</code>
</pre>
<p>If I wrap Child1-4 in a VGroup it all breaks</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:11:27Z2015-08-25T14:11:27ZMediators stopped working all of a sudden<div><blockquote>
<p>I traced out the constructor and intiailize of DummyViewMediator
and it all works fine</p>
</blockquote>
<p>Ok, now try to add PointOfSaleView to the stage exactly like the
DummyView.</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:15:07Z2015-08-25T14:15:07ZMediators stopped working all of a sudden<div><p>Actually to be more accurate I would be wrapping Child3 and
Child4 in a VGroup</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:17:29Z2015-08-25T14:17:29ZMediators stopped working all of a sudden<div><p>OK If I add PointOfSaleView the same way as DummyView then it
still all works (this is without the VGroup by the way).</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:20:21Z2015-08-25T14:20:21ZMediators stopped working all of a sudden<div><p>Now, add the PointOfSaleView to the VGroup (id="vGroup" for the
sake of an example) instead of the MainView</p>
<p>vGroup.addElement( new PointOfSaleView());</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:25:02Z2015-08-25T14:25:02ZMediators stopped working all of a sudden<div><p>After adding PointOfSaleView to MainView, add it to a vGroup
within MainView? or just add it directly to VGroup first?</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:26:09Z2015-08-25T14:26:09ZMediators stopped working all of a sudden<div><p>directly to vgroup</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:26:59Z2015-08-25T14:26:59ZMediators stopped working all of a sudden<div><p>Add event listeners for added to stage and creation complete for
mainview, vgroup and PointOfSaleView. See (trace) if you are
attempting to add children to the vgroup while it is not on stage
yet.</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:37:20Z2015-08-25T14:37:20ZMediators stopped working all of a sudden<div><p>I get in order</p>
<p>MainView added<br>
vGroup added<br>
PointOfSaleView added<br>
PointOfSaleView created<br>
PointOfSaleViewMediator initialized<br>
vGroup created<br>
MainView created<br>
MainViewMediator intialized</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:42:35Z2015-08-25T14:42:35ZMediators stopped working all of a sudden<div><p>Now, add PointOfSaleView from within your MainMediator (as you
had it in your code), but instead of view.addElement(new
PointOfSaleView());<br>
do: view.vGroup.addElement(new PointOfSaleView());</p>
<p>Also put a trace statement inside the method that creates and
adds the subviews, and see if it is called before vGroup is added
to the stage.</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:43:03Z2015-08-25T14:43:17ZMediators stopped working all of a sudden<div><p>Things do break now with that, though the views still show up on
stage unlike before, but they are all wonky</p>
<p>EDIT: Before adding POS in the mediator</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:46:26Z2015-08-25T14:46:26ZMediators stopped working all of a sudden<div><p>I get</p>
<p>MainView added<br>
vGroup added<br>
vGroup created<br>
MainView created<br>
MainViewMediator intiialize<br>
MainViewMediator display view (method that creates
PointOfSaleView)<br>
PointOfSaleView added<br>
PointOfSaleView created<br>
PointOfSaleViewmediator initialize</p>
<p>And things are still wonky but are showing up on screen</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:48:05Z2015-08-25T14:48:05ZMediators stopped working all of a sudden<div><p>Wonky? The position/layout is not as expected or what?</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:49:52Z2015-08-25T14:49:52ZMediators stopped working all of a sudden<div><p>The trace shows that when you add PointOfSaleView to the right
parent it gets added to the stage and its mediator is created. So,
from a robotlegs point of view everything is ok.</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:50:13Z2015-08-25T14:50:13ZMediators stopped working all of a sudden<div><p>it looks like it's all added to the stage, but the widths and
heights of a lot of things seem like they must be set to 0. I can
see some components that have hardcoded widths/heights but ones
that use percentages seem to not be there (which i assuem in this
case means their widths/heights are 0)</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:50:53Z2015-08-25T14:50:53ZMediators stopped working all of a sudden<div><p>By the way, adding subviews to a view should be View's job. So,
after you make it work, you should transfer the logic from within
your main mediator to the main view. MainMediator should only pass
the necessary data to a MainView's API</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:52:12Z2015-08-25T16:58:24ZMediators stopped working all of a sudden<div><blockquote>
<p>it looks like it's all added to the stage, but the widths and
heights of a lot of things seem like they must be set to 0. I can
see some components that have hardcoded widths/heights but ones
that use percentages seem to not be there (which i assuem in this
case means their widths/heights are 0)</p>
</blockquote>
<p>That's a Flex problem. Can't say why it's happening. Maybe
instead of top/bottom etc, you should try x, y</p>
<p>[EDIT] mx.events.FlexEvent.CREATION_COMPLETE:<br>
Dispatched when the component has finished its construction,
property processing, measuring, layout, and drawing.<br>
At this point, depending on its visible property, the component is
not visible even though it has been drawn.</p>
<p>I'm mentioning this because it looks like some of your subviews
are not dispatching the event CREATION_COMPLETE, to which robotlegs
listens to in order to call mediator's initialize() method. This
might have something to do with the way you're setting the layout/
positions of the views. Try to fix the layout issue.</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T14:57:43Z2015-08-25T14:57:43ZMediators stopped working all of a sudden<div><p>I think we solved the mediation problem, right? Can I do
anything else for you?</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T15:00:14Z2015-08-25T15:00:14ZMediators stopped working all of a sudden<div><p>Ok. So.... how does this help with adding Child1/2 in the
previous structure to a VGroup? lol. I'm sorry for being dense.
Buuuuut none of this illustrates any points to me :/</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T15:08:58Z2015-08-25T15:08:58ZMediators stopped working all of a sudden<div><p>The point is, that you should add children to a View or a
subview (vgroup) first after they have a stage property. Also, that
you should add children to the right container.<br>
When views are added to the stage, as it was the case with
PointOfSaleView at last, their mediator is created and
initialized.<br>
The traces show that it worked well for PointOfSaleView, and if you
follow the same logic, it will work for any other subview. I don't
know where and how you add the child1 to 4, so I can't tell you how
to proceed.</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T15:51:40Z2015-08-25T15:51:40ZMediators stopped working all of a sudden<div><p>Last question for today:</p>
<p>I actually wanted to ask it earlier, but I got carried away by
your messages.<br>
It seems like MainMediator is able to listen to the
DisplayViewEvent.DISPLAY_VIEW event, since the traces show the
PointOfSaleViewmediator initialize, but just for the sake of
completeness :</p>
<p>From where and when are you dispatching
DisplayViewEvent.DISPLAY_VIEW?</p>
<p>Is the MainMediator already initialized by the time you dispatch
the event?<br>
Are the mappings for the subviews completed by the time you
dispatch the event?</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T15:58:56Z2015-08-25T15:58:56ZMediators stopped working all of a sudden<div><p>The AppMediator mediates my document class and listens for a
BootStrap complete event which then adds the MainView to the
WindowedApplication view. When the MainViewMediator is initialized
it tells MainView to add a LoginView to itself. When the user logs
in a LOGIN event is dispatched which that MainViewMediator catches
and tells it's view to remove the LoginView. I then have a
PostLoginCommand that runs also which dispatches the DisplayView
event at which point the MainViewMediator tells creates the
PointOfSaleView to add to MainView.</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T16:05:20Z2015-08-25T16:05:20ZMediators stopped working all of a sudden<div><p>Alright. In this case there is really nothing wrong with the
robotlegs part of things.<br>
I don't know what is still unclear to you or what is not working,
besides the Flex layout thing....</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-25T22:14:42Z2015-08-25T22:14:42ZMediators stopped working all of a sudden<div><p>The following links are about flex components and their
lifecycle. I thought they might help you figure out how to make
sure that the subcomponents fire the creation complete event,
which, as I said, is needed to trigger mediator's initialize()
method.</p>
<p><a href="http://help.adobe.com/en_US/flex/using/WS460ee381960520ad-2811830c121e9107ecb-7fff.html">
http://help.adobe.com/en_US/flex/using/WS460ee381960520ad-2811830c1...</a></p>
<p><a href="http://www.developmentarc.com/site/wp-content/uploads/pdfs/understanding_the_flex_3_lifecycle_v1.0.pdf">
http://www.developmentarc.com/site/wp-content/uploads/pdfs/understa...</a></p>
<p><a href="http://www.dlgsoftware.com/primers/Primer_on_Flex3_Component_Lifecycle.htm">
http://www.dlgsoftware.com/primers/Primer_on_Flex3_Component_Lifecy...</a></p>
<p><a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf62b90-7ffc.html">
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c...</a></p>
<p>From the above article:<br>
"creationComplete Dispatched when the component, and all its child
components, and all their children, and so on, have been created,
laid out, and are visible.<br>
Flex dispatches the creationComplete event for a container when
those children that are initially required are fully processed and
drawn on the screen, including all required children of the
children, and so on. Create a listener for the
creationCompleteevent, for example, if you must have the
children’s dimensions and positions in your event handler. Do
not use the creationComplete event for actions that set layout
properties, as doing so results in excess processing time."</p>
<p>Also see if itemcreationpolicy set to imediate changes the
behaviour of your child- components.</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-08-26T01:22:04Z2015-08-26T01:22:04ZMediators stopped working all of a sudden<div><p>Thanks for gathering the links!</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/377504382015-10-28T15:51:47Z2015-10-28T15:51:47ZMediators stopped working all of a sudden<div><p>I hope you found a solution for your Flex problem. Closing this
discussion for now. You can re-open it, if need be.</p></div>Ondina D.F.