PropertyValueInjector's to mediators

brndn's Avatar

brndn

03 Jun, 2013 11:43 AM

Hi There
Very quickly.
I am wanting to dynamically inject properties into a mediator, but from what I see this would be an unorthodox approach in the RL2 lifecycle.

Somewhat like.

 IMediatorMap.map(MyMediator)
                .toProcess(new PropertyValueInjector({prop:this.prop}));

As a work around I have used the viewProcessorMap, and then access the properties from the [Injected] view, via its mediator.

Just wondering if there is a different or better way to achieve this.

Thanks

brndn

  1. Support Staff 1 Posted by Shaun Smith on 05 Jun, 2013 11:18 AM

    Shaun Smith's Avatar

    Hi Brndn,

    Sorry for the delay. There isn't currently a good solution for this. Looking at it now, "hooks" could be a way to do this if they were expanded a little. Will think it over..

  2. 2 Posted by brndn on 05 Jun, 2013 02:28 PM

    brndn's Avatar

    Hi Shaun
    I opted to do it at runtime.
      ** viewProcessorMap.map(View)
                    .toProcess(new PropertyValueInjector({prop:this.prop}));

            viewProcessorMap
                    .map(View)
                    .toProcess(new MediatorCreator(MyMediator)) **

    then once the mediator is initialised I
        ** viewProcessorMap.unmap(View).fromAll(); **

  3. Ondina D.F. closed this discussion on 09 Jul, 2013 01:43 PM.

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