tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/313-list-itemrenderer-problem-for-itemrenderview-and-itemrenderermediator-classRobotlegs: Discussion 2018-10-18T16:35:26Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/71574392011-05-11T05:52:55Z2011-05-11T08:00:39ZList Itemrenderer problem for ItemrenderView and itemrendererMediator class.<div><p>1.MainContext.as<br>
override public function startup(): void<br>
{ mediatorMap.mapView(ItemrenderView, itemrendererMediator );<br>
} 2.Container.mxml<br>
<s:List itemRenderer="ItemrenderView "/><br>
3.itemrendererMediator.as</p>
<pre>
<code>public override function onRegister():void
{</code>
</pre>
<p>}</p>
<p>now i am adding a component to List by using drag and drop.<br>
Sometimes, onRegister() function executes of itemrendererMediator
when creating an instance of ItemrenderView<br>
in list itemrenderer. sometimes, onRegister() function doesnot
call.<br>
That means mediator class are not correctly mapped always with
itemrenderer class.<br>
How can I resolve the problem?</p>
<p>NB. This part is a separate module from main application. When
we are loading this module in the main application, we inject the
parentInjector to this modules's inject.</p></div>rasel200209tag:robotlegs.tenderapp.com,2009-10-18:Comment/71574392011-05-11T08:16:17Z2011-05-11T08:16:17ZList Itemrenderer problem for ItemrenderView and itemrendererMediator class.<div><p>Hi there -you're actually having the same problem as Tony in
this thread, which is also active:</p>
<p><a href=
"http://knowledge.robotlegs.org/discussions/problems/312-a-modules-mediator-not-calling-onregister-when-added-to-stage">
http://knowledge.robotlegs.org/discussions/problems/312-a-modules-m...</a></p>
<p>So - do you want to join us in there? I think the stuff that has
been explained might help you.</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/71574392011-05-11T08:51:37Z2011-05-11T08:51:39ZList Itemrenderer problem for ItemrenderView and itemrendererMediator class.<div><p>thanks for your reply. I have read your link. But for my
problem,<br>
it always happen, seems not like that.<br>
When I drag and drop my view component to the List, sometimes, the
itemrendererViewMediator class of that itemrendererView,
instantiate successfully, sometimes mediator class are not called
for the itemrendererView, and the component are not registered. So
why sometimes call mediator class and sometimes not?<br>
and it is uncertain.....</p></div>rasel200209tag:robotlegs.tenderapp.com,2009-10-18:Comment/71574392011-05-11T08:52:26Z2011-05-11T08:52:26ZList Itemrenderer problem for ItemrenderView and itemrendererMediator class.<div><p>It <em>is</em> I think the same as the other discussion - in
that your best bet is to override preRegister and find out what is
happening.</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/71574392011-05-11T09:20:12Z2011-05-11T09:20:12ZList Itemrenderer problem for ItemrenderView and itemrendererMediator class.<div><p>i have use Alert() in mediator class constructor, and mediator
class are not called.... so override preRegister(), it would do
any?</p>
<p>Actually, when i am running this module as individual project
and</p>
<pre>
<code>override public function startup(): void
{</code>
</pre>
<p>injector.mapValue(IInjector, injector);<br>
} use this as its own injector then it works fine. no problem.</p>
<p>but we are following <a href=
"http://joelhooks.com/2010/05/02/modular-robotlegs/">http://joelhooks.com/2010/05/02/modular-robotlegs/</a><br>
for our project modularization programming.<br>
and we inject the parentInjector the the modules like..</p>
<pre>
<code> public function DashboardContext(contextView:DisplayObjectContainer, parentInjector:IInjector)
{
super(contextView, true, parentInjector);
}
override public function startup(): void
{</code>
</pre>
<p>//there is no injector }</p>
<p>so my problem relates to injector communication??</p></div>rasel200209tag:robotlegs.tenderapp.com,2009-10-18:Comment/71574392011-05-11T09:29:32Z2011-05-11T09:29:32ZList Itemrenderer problem for ItemrenderView and itemrendererMediator class.<div><p>It does sound like that's your problem.</p>
<p>The reason to override preRegister is that onRegister is only
run after certain things happen in flex - so, if you read the
thread I pointed you at - there is a way of using preRegister to
trace out things, so that you can find out whether the mediatorMap
has even created the mediator and run preRegister.</p>
<p>But, if your injector doesn't exist... hmmm - I'd dig further
around that.</p>
<p>Stray</p></div>Stray