tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/462-when-adding-many-views-of-the-same-type-to-the-stage-view-and-mediators-order-can-get-mixed-upRobotlegs: Discussion 2012-02-02T10:33:17Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/128617132012-01-12T18:18:28Z2012-01-12T18:18:28ZWhen adding many Views of the same type to the stage, View and Mediators order can get mixed up.<div><p>Hi Hays,</p>
<p>In 2 years + of working with Robotlegs I haven't heard of a
'bug' in relation to this at the Robotlegs side - but I think
you're trying to rely on order-of-operations here in a way that is
potentially flaky - especially as onRegister waits for
creationComplete in flex UIComponents, and I couldn't begin to
vouch for the flex internals ordering on that - events should
generally be considered to be asynchronous (there are a couple of
key exceptions such as reparenting).</p>
<p>My 'sanity' rule of thumb is that I never rely on strings or
order-of-ops when another simple solution will let me be specific
about what I want to happen.</p>
<p>I don't have a problem with the passing around of an ID from the
model to the view then to the mediator - it always works and the
code involved is minimal. More importantly, it makes the situation
completely opaque to some developer who is trying to work with your
code while you're off sick or taking the holiday of your life
:)</p>
<p>I realise that might not be the answer you were hoping for,
someone else may have a more VGroup specific suggestion, but the ID
solution is a solid one IMO.</p>
<p>hth,</p>
<p>Stray</p></div>Stray