My main view does not result in mediator methods being called
Hi,
I am using Robotlegs for the first time, I think I have the concepts nailed down, but it would appear I can't get much working ;-)
First, I have a main view, that's an MXML file for Flex 4. I've added the declaration for the context and confirmed that the context is being initialised successfully.
Within the context I have an entry to map the view class to a mediator class.
The mediator does not get invoked, I have checked that it has an [Inject] annotation for the main view.
I feel that this is something to do with the MXML file existing prior to the context being initialised, is this correct?
I would post the code, but that's on a different machine that I don't have access to, but I'm hoping to learn something new here for the train journey home.
On a slightly different note, I have seen examples that refer to 'Sprite', when do I need to know / worry about that - is it an alternative to Flex?
Once I have this correct, I plan to either blog or create a screencast to help others - the ones I have followed jump around a lot, or are too basic to get to grips with.
Cheers,
Rob.
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
Support Staff 1 Posted by Shaun Smith on 26 Aug, 2010 11:17 AM
Hi Rob,
Are you setting the contextView in your MXML context declaration? It should look something like this:
<fx:Declarations>
</fx:Declarations>
Does your context's startup() method run? Your context might look something like this:
Hope that helps!
2 Posted by rob on 26 Aug, 2010 12:32 PM
Hi Shaun,
Thanks for a quick reply.
Yes, my MXML file (the main application view that's created by Flex)
I have stepped through the debugger within the context file, so yes, this has been invoked correctly, the view is mapped to the mediator last...
And the mediator looks like this...
Oh.. .wait...
I just notice that I registered the LoginView with the LoginViewMediator whereas I read that as MainView with my MainViewMediator, which of course wouldn't run because I never registered it!
I'm starting to think that I might be dyslexic!! Problem solved! Thanks.
Thanks again!
Rob.
Support Staff 3 Posted by Shaun Smith on 26 Aug, 2010 12:36 PM
Hehe, glad you're back on track =)
Shaun Smith closed this discussion on 26 Aug, 2010 12:36 PM.