RL2 Updates

249 views
Skip to first unread message

Shaun Smith

unread,
Jan 23, 2012, 9:02:06 AM1/23/12
to RobotLegs Discussion Group
Howdy all,

I recently pushed a bunch of changes to the version2 branch. If you want to crash your browser you can check out the diff on GitHub:


Otherwise, you can read some background here:


Some bits are still missing, but I'm much happier with the overall shape.

If you wrote any extensions for RL2 you'll need to modify your extension integration files:


Any thoughts, concerns or suggestions, feel free to:

Or post a message to this group.

Neil Manuell

unread,
Jan 23, 2012, 9:06:29 AM1/23/12
to robo...@googlegroups.com
cheers shaun.
just wondering what "bender" signifies and whether its a working name or permanent.

--
You received this message because you are subscribed to the Google
Groups "Robotlegs" group.
To post to this group, send email to robo...@googlegroups.com
To unsubscribe from this group, send email to
robotlegs+...@googlegroups.com
for support visit http://knowledge.robotlegs.org

Shaun Smith

unread,
Jan 23, 2012, 9:10:26 AM1/23/12
to robo...@googlegroups.com

Neil Manuell

unread,
Jan 23, 2012, 9:13:34 AM1/23/12
to robo...@googlegroups.com
oh I getcha, 
cheers, I missed that

Adnan Doric P.

unread,
Jan 24, 2012, 6:30:22 AM1/24/12
to robo...@googlegroups.com
Hello Shaun,

Lot of work, I like it more and more :)

I have a small issue with mediators: their "initialize" method is never called.
I'm still trying to understand the issue, but if you can help, I vote for it!

1) I initialize RL in MyApp.mxml (note the <view:Main id="main" />):
��� <fx:Declarations>
��� ��� <rl:ContextBuilderTag>
��� ��� ��� <config:AppBundle />
��� ��� </rl:ContextBuilderTag>
��� </fx:Declarations>
��� <view:Main id="main" />

2) Then in AppBundle.configureContext()� :

context.addLogTarget(new TraceLogTarget(context));
��� ��� ��� context.require(
��� ��� ��� ��� ��� StageSyncExtension,
��� ��� ��� ��� ��� CommandMapExtension,
��� ��� ��� ��� ��� EventCommandMapExtension,
��� ��� ��� ��� ��� ViewManagerExtension,
��� ��� ��� ��� ��� MediatorMapExtension,
��� ��� ��� ��� ���
��� ��� ��� ��� ��� AppConfig
��� ��� ��� ��� );

3) and finaly in AppConfig :
mediatorMap.mapView(Main).toMediator(MainMediator);

4) Problem: when I launch the application, MainMediator.initialize() is never called.

Log:
Main.creationCompleteHandler()
MyApp.creationCompleteHandler()
1103 INFO Context-0-cd Context-0-cd - Initializing...
12:24:23.581 DEBUG - AppConfig - configure()
1118 INFO Context-0-cd Context-0-cd - Initialize complete

It seems that everything is initialized correctly, but I must be doing something wrong.

5) Bonus, unrelated: if I try to add the ContextViewListenerConfig to the bundle, I get the following error:
Error: Injector is missing a mapping to handle injection into property "contextView" of object "[object ContextViewListenerConfig]" with type "[class ContextViewListenerConfig]". Target dependency: "flash.display::DisplayObjectContainer|"
(I tried putting contextView in <rl:ContextBuilderTag> like this <rl:ContextBuilderTag contextView={this}>)

Cheers,
Adnan


On 23/01/2012 15:02, Shaun Smith wrote:
Howdy all,

I recently pushed a bunch of changes to the version2 branch.�If you want to crash your browser you can check out the diff on GitHub:


Otherwise, you can read some background here:


Some bits are still missing, but I'm much happier with the overall shape.

If you wrote any extensions for RL2 you'll need to modify your extension integration files:


Any thoughts, concerns or suggestions, feel free to:

Or post a message to this group.

Shaun Smith

unread,
Jan 24, 2012, 8:08:43 AM1/24/12
to robo...@googlegroups.com
Hi Adnan,

Have you tried it with the Classic bundle? There are a couple of things missing from your custom bundle:

LocalEventMapExtension
StageObserverExtension

Without the StageObserver nothing will be watching the stage for views. Also, without the ContextViewListenerConfig the viewManager will not be wired to the contextView and nothing will be observed.

Another issue might be that the "main" view is already on Stage by the time the context initialises - if this is the issue (which it probably is), I'll be addressing that shortly. In the meantime, you could try adding the main view after initialization (like in the demo I sent you previously).

The LocalEventMapExtension is required by the classic Mediator implementation so you'll need that too.

Let me know how it goes.

On 24 Jan 2012, at 11:30, Adnan Doric P. wrote:

Hello Shaun,

Lot of work, I like it more and more :)

I have a small issue with mediators: their "initialize" method is never called.
I'm still trying to understand the issue, but if you can help, I vote for it!

1) I initialize RL in MyApp.mxml (note the <view:Main id="main" />):
    <fx:Declarations>
        <rl:ContextBuilderTag>
            <config:AppBundle />
        </rl:ContextBuilderTag>
    </fx:Declarations>

    <view:Main id="main" />

2) Then in AppBundle.configureContext()  :

context.addLogTarget(new TraceLogTarget(context));
            context.require(
                    StageSyncExtension,
                    CommandMapExtension,
                    EventCommandMapExtension,
                    ViewManagerExtension,
                    MediatorMapExtension,
                   
                    AppConfig

                );

3) and finaly in AppConfig :
mediatorMap.mapView(Main).toMediator(MainMediator);

4) Problem: when I launch the application, MainMediator.initialize() is never called.

Log:
Main.creationCompleteHandler()
MyApp.creationCompleteHandler()
1103 INFO Context-0-cd Context-0-cd - Initializing...
12:24:23.581 DEBUG - AppConfig - configure()
1118 INFO Context-0-cd Context-0-cd - Initialize complete

It seems that everything is initialized correctly, but I must be doing something wrong.

5) Bonus, unrelated: if I try to add the ContextViewListenerConfig to the bundle, I get the following error:
Error: Injector is missing a mapping to handle injection into property "contextView" of object "[object ContextViewListenerConfig]" with type "[class ContextViewListenerConfig]". Target dependency: "flash.display::DisplayObjectContainer|"
(I tried putting contextView in <rl:ContextBuilderTag> like this <rl:ContextBuilderTag contextView={this}>)

Cheers,
Adnan

On 23/01/2012 15:02, Shaun Smith wrote:
Howdy all,

I recently pushed a bunch of changes to the version2 branch. If you want to crash your browser you can check out the diff on GitHub:


Otherwise, you can read some background here:


Some bits are still missing, but I'm much happier with the overall shape.

If you wrote any extensions for RL2 you'll need to modify your extension integration files:


Any thoughts, concerns or suggestions, feel free to:

Or post a message to this group.
--
You received this message because you are subscribed to the Google
Groups "Robotlegs" group.
To post to this group, send email to robo...@googlegroups.com
To unsubscribe from this group, send email to
robotlegs+...@googlegroups.com
for support visit http://knowledge.robotlegs.org

Adnan Doric P.

unread,
Jan 24, 2012, 9:13:25 AM1/24/12
to robo...@googlegroups.com
Thank you Shaun,

My bad, I was trying to paste only parts of Classic bundle in order to include only used extensions, with you explication it is crystal clear.
Now it works even with "Main" already on Stage!

Best regards,
Adnan


On 24/01/2012 14:08, Shaun Smith wrote:
Hi Adnan,

Have you tried it with the Classic bundle? There are a couple of things missing from your custom bundle:

LocalEventMapExtension
StageObserverExtension

Without the StageObserver nothing will be watching the stage for views.�Also, without the ContextViewListenerConfig the viewManager will not be wired to the contextView and nothing will be observed.

Another issue might be that the "main" view is already on Stage by the time the context initialises - if this is the issue (which it probably is), I'll be addressing that shortly. In the meantime, you could try adding the main view after initialization (like in the demo I sent you previously).

The LocalEventMapExtension is required by the classic Mediator implementation so you'll need that too.

Let me know how it goes.

On 24 Jan 2012, at 11:30, Adnan Doric P. wrote:

Hello Shaun,

Lot of work, I like it more and more :)

I have a small issue with mediators: their "initialize" method is never called.
I'm still trying to understand the issue, but if you can help, I vote for it!

1) I initialize RL in MyApp.mxml (note the <view:Main id="main" />):
��� <fx:Declarations>
��� ��� <rl:ContextBuilderTag>
��� ��� ��� <config:AppBundle />
��� ��� </rl:ContextBuilderTag>
��� </fx:Declarations>
��� <view:Main id="main" />

2) Then in AppBundle.configureContext()� :

context.addLogTarget(new TraceLogTarget(context));
��� ��� ��� context.require(
��� ��� ��� ��� ��� StageSyncExtension,
��� ��� ��� ��� ��� CommandMapExtension,
��� ��� ��� ��� ��� EventCommandMapExtension,
��� ��� ��� ��� ��� ViewManagerExtension,
��� ��� ��� ��� ��� MediatorMapExtension,
��� ��� ��� ��� ���
��� ��� ��� ��� ��� AppConfig
��� ��� ��� ��� );


3) and finaly in AppConfig :
mediatorMap.mapView(Main).toMediator(MainMediator);

4) Problem: when I launch the application, MainMediator.initialize() is never called.

Log:
Main.creationCompleteHandler()
MyApp.creationCompleteHandler()
1103 INFO Context-0-cd Context-0-cd - Initializing...
12:24:23.581 DEBUG - AppConfig - configure()
1118 INFO Context-0-cd Context-0-cd - Initialize complete

It seems that everything is initialized correctly, but I must be doing something wrong.

5) Bonus, unrelated: if I try to add the ContextViewListenerConfig to the bundle, I get the following error:
Error: Injector is missing a mapping to handle injection into property "contextView" of object "[object ContextViewListenerConfig]" with type "[class ContextViewListenerConfig]". Target dependency: "flash.display::DisplayObjectContainer|"
(I tried putting contextView in <rl:ContextBuilderTag> like this <rl:ContextBuilderTag contextView={this}>)

Cheers,
Adnan

On 23/01/2012 15:02, Shaun Smith wrote:
Howdy all,

I recently pushed a bunch of changes to the version2 branch.�If you want to crash your browser you can check out the diff on GitHub:


Otherwise, you can read some background here:


Some bits are still missing, but I'm much happier with the overall shape.

If you wrote any extensions for RL2 you'll need to modify your extension integration files:


Any thoughts, concerns or suggestions, feel free to:

Or post a message to this group.
--
You received this message because you are subscribed to the Google
Groups "Robotlegs" group.
To post to this group, send email to robo...@googlegroups.com
To unsubscribe from this group, send email to
robotlegs+...@googlegroups.com
for support visit http://knowledge.robotlegs.org

--
You received this message because you are subscribed to the Google
Groups "Robotlegs" group.
To post to this group, send email to robo...@googlegroups.com
To unsubscribe from this group, send email to
robotlegs+...@googlegroups.com
for support visit http://knowledge.robotlegs.org

Shaun Smith

unread,
Jan 24, 2012, 9:17:51 AM1/24/12
to robo...@googlegroups.com
Cool, no problem :)

It does raise the question of whether extensions should automatically pull in their dependencies. For now I've decided against it, but it might be more convenient (and less verbose) if they do.

On 24 Jan 2012, at 14:13, Adnan Doric P. wrote:

Thank you Shaun,

My bad, I was trying to paste only parts of Classic bundle in order to include only used extensions, with you explication it is crystal clear.
Now it works even with "Main" already on Stage!

Best regards,
Adnan

On 24/01/2012 14:08, Shaun Smith wrote:
Hi Adnan,

Have you tried it with the Classic bundle? There are a couple of things missing from your custom bundle:

LocalEventMapExtension
StageObserverExtension

Without the StageObserver nothing will be watching the stage for views. Also, without the ContextViewListenerConfig the viewManager will not be wired to the contextView and nothing will be observed.

Another issue might be that the "main" view is already on Stage by the time the context initialises - if this is the issue (which it probably is), I'll be addressing that shortly. In the meantime, you could try adding the main view after initialization (like in the demo I sent you previously).

The LocalEventMapExtension is required by the classic Mediator implementation so you'll need that too.

Let me know how it goes.

On 24 Jan 2012, at 11:30, Adnan Doric P. wrote:

Hello Shaun,

Lot of work, I like it more and more :)

I have a small issue with mediators: their "initialize" method is never called.
I'm still trying to understand the issue, but if you can help, I vote for it!

1) I initialize RL in MyApp.mxml (note the <view:Main id="main" />):
    <fx:Declarations>
        <rl:ContextBuilderTag>
            <config:AppBundle />
        </rl:ContextBuilderTag>
    </fx:Declarations>
    <view:Main id="main" />

2) Then in AppBundle.configureContext()  :

context.addLogTarget(new TraceLogTarget(context));
            context.require(
                    StageSyncExtension,
                    CommandMapExtension,
                    EventCommandMapExtension,
                    ViewManagerExtension,
                    MediatorMapExtension,
                   
                    AppConfig
                );

3) and finaly in AppConfig :
mediatorMap.mapView(Main).toMediator(MainMediator);

4) Problem: when I launch the application, MainMediator.initialize() is never called.

Log:
Main.creationCompleteHandler()
MyApp.creationCompleteHandler()
1103 INFO Context-0-cd Context-0-cd - Initializing...
12:24:23.581 DEBUG - AppConfig - configure()
1118 INFO Context-0-cd Context-0-cd - Initialize complete

It seems that everything is initialized correctly, but I must be doing something wrong.

5) Bonus, unrelated: if I try to add the ContextViewListenerConfig to the bundle, I get the following error:
Error: Injector is missing a mapping to handle injection into property "contextView" of object "[object ContextViewListenerConfig]" with type "[class ContextViewListenerConfig]". Target dependency: "flash.display::DisplayObjectContainer|"
(I tried putting contextView in <rl:ContextBuilderTag> like this <rl:ContextBuilderTag contextView={this}>)

Cheers,
Adnan

On 23/01/2012 15:02, Shaun Smith wrote:
Howdy all,

I recently pushed a bunch of changes to the version2 branch. If you want to crash your browser you can check out the diff on GitHub:


Otherwise, you can read some background here:


Some bits are still missing, but I'm much happier with the overall shape.

If you wrote any extensions for RL2 you'll need to modify your extension integration files:


Any thoughts, concerns or suggestions, feel free to:

Alessandro Bianco

unread,
Jan 24, 2012, 11:46:28 AM1/24/12
to Robotlegs AS3
First of all: Hello list!

Now, i'm still having some problems with this issue...

I know RL is under active development, I just want to report that to
understand if it's something under development which is supposed not
to work or if i'm doing something wrong with the new rl-reloaded
architechture.

having a ContextBuilderTag like this, declared in the main mxml file:
<rl:ContextBuilderTag contextView="{this}">
<rl:configs>
<classic:ClassicRobotlegsBundle/>
<imagegallery:GalleryConfig />
</rl:configs>
</rl:ContextBuilderTag>

And using my GalleryConfig to map the view' mediators:

[Inject]
public var mediatorMap:IMediatorMap;
public function configureContext(context:IContext):void
{
mediatorMap.mapView(IGalleryView).toMediator(GalleryViewMediator);
...
}

ends up in an error because mediatorMap remains null.

I overheard that there're still problems when the contextView is
already on stage when the context is created, is this the case? or i'm
doing something terribly wrong?

Thanks,
Alessandro
> >>>>https://github.com/robotlegs/robotlegs-framework/compare/919e0186bc75...82d985b5508bb8dde7c257d3dddb0917fe2d1ec1
>
> >>>> Otherwise, you can read some background here:
>
> >>>>http://shaun.boyblack.co.za/blog/2012/01/23/rl-reloaded/
>
> >>>> Some bits are still missing, but I'm much happier with the overall shape.
>
> >>>> If you wrote any extensions for RL2 you'll need to modify your extension integration files:
>
> >>>>https://github.com/robotlegs/robotlegs-framework/blob/version2/src/ro...
>
> >>>> Any thoughts, concerns or suggestions, feel free to:
>
> >>>> Send a pull request:https://github.com/robotlegs/robotlegs-framework
> >>>> Submit an issue:https://github.com/robotlegs/robotlegs-framework/issues/new
> >>>> Or post a message to this group.
> >>>> --
> >>>> You received this message because you are subscribed to the Google
> >>>> Groups "Robotlegs" group.
> >>>> To post to this group, send email to robo...@googlegroups.com
> >>>> To unsubscribe from this group, send email to
> >>>> robotlegs+...@googlegroups.com
> >>>> for support visithttp://knowledge.robotlegs.org
>
> >>> --
> >>> You received this message because you are subscribed to the Google
> >>> Groups "Robotlegs" group.
> >>> To post to this group, send email to robo...@googlegroups.com
> >>> To unsubscribe from this group, send email to
> >>> robotlegs+...@googlegroups.com
> >>> for support visithttp://knowledge.robotlegs.org
>
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "Robotlegs" group.
> >> To post to this group, send email to robo...@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> robotlegs+...@googlegroups.com
> >> for support visithttp://knowledge.robotlegs.org

Adnan Doric P.

unread,
Jan 24, 2012, 11:54:37 AM1/24/12
to robo...@googlegroups.com
Hello Alessandro,

Try this in GalleryConfig:


[Inject]
public var mediatorMap:IMediatorMap;

[PostConstruct]
public function init():void

{
    mediatorMap.mapView(IGalleryView).toMediator(GalleryViewMediator);
}

The PostConstruct tag takes care of calling init() after everything is initialized.

Cheers,
Adnan

Shaun Smith

unread,
Jan 24, 2012, 11:59:27 AM1/24/12
to robo...@googlegroups.com
Hi Alessandro,

The problem is that you're using IContextConfig - which is used to build extensions/bundles. When configureContext() is called the context won't necessarily by fully initialized yet. However, for what you're doing you don't need to implement that interface. A plain config class is what you want:

public class GalleryConfig
{
[Inject]
public var mediatorMap:IMediatorMap;

[PostConstruct]
public function configure():void
{
mediatorMap.mapView(IGalleryView).toMediator(GalleryViewMediator);
}
}

You can read more about bundles and extensions here:


But for normal configs you can just use plain classes and [PostConstruct].

Hope that helps!

Alessandro Bianco

unread,
Jan 24, 2012, 12:00:56 PM1/24/12
to Robotlegs AS3
Hell, that's some kind of magick :)
tnx Adnan for the quick tip, everythink seems to work now

Still, I don't understand why my config should be a IContextConfig
now ...
Between configs, bundles and extensions i'm quite confused on who does
what and how, but I guess everything's will be clear in due time.

Thanks again

On Jan 24, 5:54 pm, "Adnan Doric P." <astronaute....@gmail.com> wrote:
> Hello Alessandro,
>
> Try this in GalleryConfig:
>
> [Inject]
> public var mediatorMap:IMediatorMap;
>
> *[PostConstruct]
> public function init():void*
> *{*
>      mediatorMap.mapView(IGalleryView).toMediator(GalleryViewMediator);
> *}*
>
> The *PostConstruct* tag takes care of calling init() after everything is

Alessandro Bianco

unread,
Jan 24, 2012, 12:03:41 PM1/24/12
to Robotlegs AS3
@Shaun, perfect, got the explanation before posting the question :)

So in the configs list of the ContextBuilder we can use also non-
IContextConfig classes that does only the setup ... not very clear but
I got it, thanks

Shaun Smith

unread,
Jan 24, 2012, 12:10:42 PM1/24/12
to robo...@googlegroups.com
Yeh, there's very little documentation at the moment, but we'll be addressing that very soon.

Adnan Doric P.

unread,
Jan 24, 2012, 12:13:21 PM1/24/12
to robo...@googlegroups.com

Another issue might be that the "main" view is already on Stage by the time the context initialises - if this is the issue (which it probably is), I'll be addressing that shortly. In the meantime, you could try adding the main view after initialization (like in the demo I sent you previously).

Alright, further testing shows that the MainMediator.initialize() is indeed called even though the Main view was already added to stage when config was called, BUT, another mediator of an embedded view inside Main is sometimes not initialized at all:
If I launch the application 10 times without changing anything, it initializes 4-5 times out of 10, not consistent behavior.

Stray

unread,
Jan 24, 2012, 12:22:26 PM1/24/12
to robo...@googlegroups.com
Hi Adnan,

that usually indicates that you're not keeping a hard reference to your Robotlegs context, and that eventually it's being garbage collected - sometimes before and sometimes after initialization.

Could that be the case? I know we're in v2 here, but that's still the most sensible source of that kind of inconsistent behaviour.

Stray

Shaun Smith

unread,
Jan 24, 2012, 12:22:44 PM1/24/12
to robo...@googlegroups.com
Indeed, for now you shouldn't rely on views being mediated if they are already on stage - there's nothing in place yet to ensure that that happens. I'd recommend only adding the main view once initialization is complete. This will be fixed later, but it's something you'll have to opt-in for (by adding an extension) as it's expensive to recurse the whole display list looking for matching views.

On 24 Jan 2012, at 17:13, Adnan Doric P. wrote:

Adnan Doric P.

unread,
Jan 24, 2012, 12:56:43 PM1/24/12
to robo...@googlegroups.com
I understand that and will avoid messing with mediators for view that are already on stage :)

For others that are created later:
I tracked the problem down to DefaultMediatorManager.onMediatorCreate where it adds the event listener for "creationComplete" on some components in order to initialize the mediator later.
For some reason, the anonymous listener is not always called even though the "creationComplete" is triggered correctly (checked with another handler which is triggered each time).

I have three components that are still not initialized when the mediator is created, but the listener is not called for all of them, and it is again not consistent.

Can it be the useWeakReference = true when adding the listener in there ?

Also, like Stray suggested, is it enough to have only this in MyApp.mxml:
    <fx:Declarations>
        <rl:ContextBuilderTag contextView="{this}">

            <config:AppBundle />
        </rl:ContextBuilderTag>
    </fx:Declarations>


Or do I have to make a real hard reference to the Context somewhere in my app ?

The thing that make me think the Context is still around is that when I switch states, other mediators are initialized and destroyed as intended, so it is maybe not related to Context being gc'd.

Thank you in advance and sorry for all those questions :)

Cheers,
Adnan

Shaun Smith

unread,
Jan 24, 2012, 1:06:18 PM1/24/12
to robo...@googlegroups.com
Hi Adnan, no problem about all the questions. When using the Flex ContextBuilder you don't need another reference to the context as the builder hold on to it for you.

Aha! Nicely spotted! Yup that anonymous creationComplete listener will definitely by gc'd.. my bad. Will fix that shortly.

Shaun Smith

unread,
Jan 24, 2012, 1:24:54 PM1/24/12
to robo...@googlegroups.com
Ok, I've pushed that fix. Let me know if it helps. I've also updated the docs a bit (Quickstart):

Adnan Doric P.

unread,
Jan 24, 2012, 1:28:10 PM1/24/12
to robo...@googlegroups.com
I'm glad to be of some help :)

Do you plan to dispatch an event when context initialization is completed (maybe relayed by ContextBuilderTag) in order to create views afterwards?

Adnan Doric P.

unread,
Jan 24, 2012, 1:32:54 PM1/24/12
to robo...@googlegroups.com
It works as intended now, than you for fixing it :)

I continue to test it now and will keep you informed if anything weird comes out! hehe

pixels4nickels

unread,
Jan 25, 2012, 3:38:14 PM1/25/12
to Robotlegs AS3
I have updated my SignalCommandMap extension and example here:

https://github.com/pixels4nickels/SignalCommandMap
https://github.com/pixels4nickels/SignalCommandMap-example

I will be getting the tests up and README in order today. Also expect
a project name change to keep in line with preferred extension naming.
Let me know if you find anything not working or just have suggestions.

Best,
Ken

On Jan 23, 6:02 am, Shaun Smith <dars...@gmail.com> wrote:
> Howdy all,
>
> I recently pushed a bunch of changes to the version2 branch. If you want to crash your browser you can check out the diff on GitHub:
>
> https://github.com/robotlegs/robotlegs-framework/compare/919e0186bc75...82d985b5508bb8dde7c257d3dddb0917fe2d1ec1
>
> Otherwise, you can read some background here:
>
> http://shaun.boyblack.co.za/blog/2012/01/23/rl-reloaded/
>
> Some bits are still missing, but I'm much happier with the overall shape.
>
> If you wrote any extensions for RL2 you'll need to modify your extension integration files:
>
> https://github.com/robotlegs/robotlegs-framework/blob/version2/src/ro...

Alessandro Bianco

unread,
Jan 26, 2012, 3:53:31 AM1/26/12
to Robotlegs AS3
Anyone is having problems with injections?

I'm getting this runtime error the first time an injection is
required:

Error: Injector is missing a mapping to handle injection into property
"gallerySearch" of object "[object GallerySearchMediator]" with type
"[class GallerySearchMediator]". Target dependency:
"eu.alebianco.demos.rl.imagegallery.views.api::IGallerySearch|"

In this case I was trying to inject the mediator's view mapped to it's
interface.

[Inject]
public var gallerySearch:IGallerySearch;

And the relationship is configured in my config class, which is ran
after the ClassicRobotlegsBundle

[PostConstruct]
public function init():void {

mediatorMap.mapView(IGallerySearch).toMediator(GallerySearchMediator);
}

it's something to be expected at this stage? my fault again ^_^?


On Jan 25, 9:38 pm, pixels4nickels <pixels4nick...@gmail.com> wrote:
> I have updated my SignalCommandMap extension and example here:
>
> https://github.com/pixels4nickels/SignalCommandMaphttps://github.com/pixels4nickels/SignalCommandMap-example
>
> I will be getting the tests up and README in order today. Also expect
> a project name change to keep in line with preferred extension naming.
> Let me know if you find anything not working or just have suggestions.
>
> Best,
> Ken
>
> On Jan 23, 6:02 am, Shaun Smith <dars...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Howdy all,
>
> > I recently pushed a bunch of changes to the version2 branch. If you want to crash your browser you can check out the diff on GitHub:
>
> >https://github.com/robotlegs/robotlegs-framework/compare/919e0186bc75...
>

Adnan Doric P.

unread,
Jan 26, 2012, 5:33:32 AM1/26/12
to robo...@googlegroups.com

The injector cannot figure out what to inject for IGallerySearch if you
don't specify it :)

for ex:
injector.map(IGallerySearch).toSingleton(GallerySearch);

HTH

Alessandro Bianco

unread,
Jan 26, 2012, 6:11:31 AM1/26/12
to robo...@googlegroups.com
hum, sorry, I don't get it ...

it's a view mapped to a mediator, I don't want it to be treated as a singleton

for a moment I though that it was the interface who was causing the problem, so I tried to map the mediator to the concrete view class
mediatorMap.mapView(GalleryView).toMediator(GalleryViewMediator);

but it throws the same exceptions :(

Eventually I found the solution in someone else's code:
mediatorMap.mapView(GalleryView).toMediator(GalleryViewMediator).asType(IGalleryView);

but I don't understand if (and why) the "asType" is required, because also:
mediatorMap.mapView(IGalleryView).toMediator(GalleryViewMediator).asType(IGalleryView);

works fine (but looks ugly)

Bianco Alessandro


--
You received this message because you are subscribed to the Google
Groups "Robotlegs" group.
To post to this group, send email to robo...@googlegroups.com
To unsubscribe from this group, send email to

Shaun Smith

unread,
Jan 26, 2012, 7:17:28 AM1/26/12
to robo...@googlegroups.com
Hi Alessandro,

Yeh, that's a current limitation with the mediator map (needing to call asType) - will sort that out shortly.

Alessandro Bianco

unread,
Jan 26, 2012, 7:32:55 AM1/26/12
to robo...@googlegroups.com
uh, ok, glad to hear it :)
thanks shaun

Bianco Alessandro

Shaun Smith

unread,
Jan 26, 2012, 7:47:36 AM1/26/12
to robo...@googlegroups.com

pixels4nickels

unread,
Jan 26, 2012, 2:25:41 PM1/26/12
to Robotlegs AS3
You should not have to create this extra mapping. After Shaun's
changes last night, you should be able to simply use the interface as
the view type.

mediatorMap.mapView(IGallerySearch).toMediator(GallerySearchMediator);
instead of
mediatorMap.mapView(GallerySearch).toMediator(GallerySearchMediator).asType(IGallerySearch);

I just tested it with my SignalCommandMap app example and it works.
You can see how I set it up here:

https://github.com/pixels4nickels/SignalCommandMap-example

Best,
Ken
> >>https://github.com/pixels4nickels/SignalCommandMaphttps://github.com/...
Reply all
Reply to author
Forward
0 new messages