How to fire a command after initialization?

micros's Avatar


17 Jan, 2013 02:54 PM

I have a pretty big application set up with RobotLegs 2, including the SignalCommandMap. It's been great using RL2, but it's so hard to find answers to very specific questions. Matter of time I hope. So here's my question:
After initialization of the config, I'm hooking into the lifeCycle to start my app:

context.lifecycle.afterInitializing( init );

Now I would really like to startup my application using a command, triggered by a signal. Though the Config itself has some injections, based on the example by Pixels4Nickels, the make of the SignalCommandMap, you cannot inject commandTriggers (signals) here, as you can in Mediators and other Commands.
So I tried getting the trigger from the Injector. But dispatching it won't fire the command.
I could of course go via the Mediator of one of my first view components to trigger the Command, but I wouldn't want to put that kind of start up spaghetti in there.

Any help would be much appreciated!

  1. Support Staff 1 Posted by Shaun Smith on 19 Jan, 2013 02:26 PM

    Shaun Smith's Avatar


    You might need to open an Issue over at the SignalCommandMap GitHub Issue Tracker.

    In the meantime, here's something you could look into.

    You could use another config class instead of a 'startup' type command. Configs were designed to replace startup commands. It's the new way to configure and bootstrap your app. Just create a config that does whatever the command was going to do.

    Let me know how it goes.

  2. Ondina D.F. closed this discussion on 07 Feb, 2013 04:22 PM.

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

Keyboard shortcuts


? 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