tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/321-new-window-context-and-view-component-not-being-reconizedRobotlegs: Discussion 2013-04-28T09:55:49Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/73565592011-05-20T17:08:27Z2011-05-20T17:08:29ZNew Window, context and view component not being reconized.<div><p>I am fairly new to RL, I have been playing with it for a few
weeks now and have a question. I Created a view component in Air
called FoodCategoryInput.mxml, this is a simple pull down list. In
my Context I mapped it to a mediator like so :
mediatorMap.mapView(FoodCategoryInput, FoodCategoryMediator);</p>
<p>In my main App.mxml file I have the FoodCategoryInput.mxml
component nested within a few other view components, When I run my
App, the FoodCategoryInput.mxml is instantiated, does it's thing
and a Ilist is eventually returned to the mapped
FoodCategoryMediator so the drop down is populated when selected.
It works fine.</p>
<p>However I also have a pup up window that holds this same
FoodCategoryInput.mxml view component, This does not seem to be
recognized at all by my app. I assumed since it was mapped in the
Context I could just drop it anywhere else in my app and it would
work, but this does not seem to be the case.</p>
<p>Do I have to map it a different way to get this to work?</p>
<p>Thanks for any help.</p></div>Joetag:robotlegs.tenderapp.com,2009-10-18:Comment/73565592011-05-20T17:19:04Z2011-05-20T17:19:04ZNew Window, context and view component not being reconized.<div><p>Hi Joe, there are a bunch of previous similar threads. Your
fastest answer is probably going to come by searching for 'popup'
in the existing questions on the forum.</p>
<p>The short answer is that you need to do
mediatorMap.createMediator(myPopup) after the view is created, as
the popup isn't a child of the contextView so can't be
auto-magically mediated.</p>
<p>Let us know if you still have questions once you've had a read
around,</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/73565592011-05-20T23:58:16Z2011-05-20T23:58:18ZNew Window, context and view component not being reconized.<div><p>Stray,</p>
<p>Thanks for your previous reply, I did some searching as you
suggested and it seems all roads lead to the 'How to Mediate a Flex
Popup" post located here: <a href=
"http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/how-to-mediate-a-flex-popup">
http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/how...</a></p>
<p>Where it says "In the class that maps the mediator", I assume it
means the Context, as this is where I have mapped all my view
components and mediators thus far.</p>
<p>In my context I have the following lines of code:<br>
mediatorMap.mapView(IngredientWindow, IngredientWindowMediator);
//popup window<br>
mediatorMap.mapView(NewIngredientButton, NewIngredientMediator);
//button to cause window to popup</p>
<p>in my NewIngredientMediator class I have the following:<br>
var popUP:Window = new IngredientWindow;<br>
PopUpManager.addPopUp(popUP, contextView);<br>
mediatorMap.createMediator(popUP);</p>
<p>Odd thing happens, My main app window disappears and just the
popup shows, and my FoodCategoryInput pulldown still does not seem
to work. I am defiantly doing something wrong.</p>
<p>thanks for any additional help/clarification you can
provide.</p></div>Joetag:robotlegs.tenderapp.com,2009-10-18:Comment/73565592011-05-25T08:03:55Z2011-05-25T08:03:55ZNew Window, context and view component not being reconized.<div><p>Hi Joe,</p>
<p>I'm going to assume you also got this fixed as part of your
corrupt files problem that was causing the null injection
issues?</p>
<p>If not, feel free to reopen it.</p>
<p>Stray</p></div>Stray