Skip to content

Instantly share code, notes, and snippets.

@newtriks
Created October 19, 2011 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save newtriks/1297937 to your computer and use it in GitHub Desktop.
Save newtriks/1297937 to your computer and use it in GitHub Desktop.
PMVC Nested View Registration
public class ProfileDisplayMediatorsCommand extends SimpleCommand implements ICommand
{
override public function execute( note:INotification ):void
{
var profileDisplay:ProfileDisplay = note.getBody() as ProfileDisplay;
facade.registerMediator( new ProfileDisplayMediator( profileDisplay ) );
facade.registerMediator( new BalanceDisplayMediator( profileDisplay.balanceComponent ) );
}
}
@jonnyreeves
Copy link

SimpleCommand already implements ICommand so there's no need to specify it! (sorry pet peeve! ;)

@newtriks
Copy link
Author

No good catch :) TBH though this was a quickly typed out example to highlight a potential solution to your query, so untested, could be cleaner and I have not done pmvc for a while now :P

@jonnyreeves
Copy link

Lucky you :( Stuck with PureMVC on this project - although thanks to RobotLegs dev from previous projects it's pretty easy to write clean PMVC code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment