New Window, context and view component not being reconized.

Joe's Avatar

Joe

20 May, 2011 05:08 PM

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);

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.

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.

Do I have to map it a different way to get this to work?

Thanks for any help.

  1. 1 Posted by Stray on 20 May, 2011 05:19 PM

    Stray's Avatar

    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.

    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.

    Let us know if you still have questions once you've had a read around,

    Stray

  2. 2 Posted by Joe on 20 May, 2011 11:58 PM

    Joe's Avatar

    Stray,

    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: http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/how...

    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.

    In my context I have the following lines of code:
    mediatorMap.mapView(IngredientWindow, IngredientWindowMediator); //popup window
    mediatorMap.mapView(NewIngredientButton, NewIngredientMediator); //button to cause window to popup

    in my NewIngredientMediator class I have the following:
    var popUP:Window = new IngredientWindow;
    PopUpManager.addPopUp(popUP, contextView);
    mediatorMap.createMediator(popUP);

    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.

    thanks for any additional help/clarification you can provide.

  3. Support Staff 3 Posted by Stray on 25 May, 2011 08:03 AM

    Stray's Avatar

    Hi Joe,

    I'm going to assume you also got this fixed as part of your corrupt files problem that was causing the null injection issues?

    If not, feel free to reopen it.

    Stray

  4. Stray closed this discussion on 25 May, 2011 08:03 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac