tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/35-mediation-of-components-contained-within-a-flex-popupRobotlegs: Discussion 2018-10-18T16:35:08Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/8878022010-01-21T07:08:49Z2010-01-21T07:08:49ZMediation of components contained within a flex PopUp<div><p>I know this horse has been beat to death. But I don't think this
particular issue has been handled yet (sorry if it has).</p>
<p>So - I know some of you have said "don't ever mediate an
itemRenderer" and to those people I say - choose the next problem 1
post down, haha. Seriously though I've had no issues whatsoever
until now.</p>
<p>With that said the problem is very simple. I have a PopUp that
I've put on stage using the following:</p>
<pre>
<code> PopUpManager.addPopUp(distroForm, contextView, true, PopUpManagerChildList.POPUP);
mediatorMap.createMediator(distroForm);</code>
</pre>
<p>This works great! But my current problem is that the above
mentioned distroForm contains a list of information. The
itemRenderer for this list is highly customized and contains
clickable controls along with the data element.<br></p>
<p>In order to respond to those clicks my first inclination is to
mediate the itemRenderer. I've done this in other places in the
application (that are not popups) and it seems to work great. But
this one perplexes me.</p>
<p>I'm thinking that there is no way to have automatic mediation in
this instance, and I would have to create each item renderer for
each data record of the data property. I won't do this obviously
but I'm just not sure there is another way to do this without
including logic in my view.</p>
<p>My entire goal is to have no logic in the popup. No binding tags
or anything. Just a view. Same with the itemRenderer on said
popup.</p>
<p>I know that because the pop up is created on a different display
list than what RobotLegs can listen to; that I have to use
<code>createMediator()</code>. <strong>But what do I do for child
components on that same pop-up that also require
mediation?</strong></p>
<p>Thanks in advance!<br></p>
<p>I'm open to criticism on mediating the itemRenderer. I know they
can get rather complicated, but I've had nothing but success until
now. I welcome alternative suggestions that still allow me to keep
the view/popup as skeletal like as possible while not having to add
logic to the itemRenderer itself.</p>
<p>-Levi</p></div>levi.stropetag:robotlegs.tenderapp.com,2009-10-18:Comment/8878022010-01-21T07:15:01Z2010-01-21T07:15:01ZMediation of components contained within a flex PopUp<div><p>I'm currently thinking of constructing the list object myself
within the PopUp's mediator and then adding it to the popup after
I've provided binding for the list data.<br></p>
<p>Even so I think I would still have to loop through the data and
manually create a mediator for each renderer needed to receive the
list. Am I wrong?</p></div>levi.stropetag:robotlegs.tenderapp.com,2009-10-18:Comment/8878022010-01-21T07:18:31Z2010-01-21T07:18:31ZMediation of components contained within a flex PopUp<div><p>I just don't see any good reason to mediate an item renderer
outside of convenience. Flex 3 item renderers are JACKED. If you
implement mx.controls.listClasses.IDropInListItemRenderer it is
easy to get at the list/grid and dispatch the events from there.
Item renderers are just so volatile... In the Signals/RL example I
posted recently I did inject a Signal into my renderers. That
worked well.</p>
<p>We need to make a Robotlegs PopupManager...</p></div>Joel Hookstag:robotlegs.tenderapp.com,2009-10-18:Comment/8878022010-01-21T07:33:08Z2010-01-21T07:33:08ZMediation of components contained within a flex PopUp<div><p>You guys never sleep! I'll take that to my team this morning, in
about 7 hours, and see if we can't figure this one out based on
your advice Joel.</p>
<p>I do find it funny you call my mediation of the item renderer
<code>convenient</code> :) I thought convenience would have me just
put all the logic in the renderer and be done with it! But based on
everything else you've said, that might be the lesser of the evils.
And you're absolutely right on all accounts - item renderers are
more like list obfuscators.<br></p></div>levi.strope