views:

185

answers:

3

A component is created at runtime and a mediator is created and registered. All is well.

In a separate view, another instance of that component is created. The mediator is created but onRegister() isn't called the 2nd time. I don't know if this is normal... but if it is, how do I get it to call onRegister() the second time? Thanks. :)

A: 

I suspect the mediator name not unique, in which case the second mediator is not registered.

From the PureMVC View class:

public function registerMediator( mediator:IMediator ) : void
{
   // do not allow re-registration (you must to removeMediator fist)
   if ( mediatorMap[ mediator.getMediatorName() ] != null ) return;
   ...

For more help with how to assign the mediator a unique name, it would be good to see a little more of how you're trying to instantiate and register your mediator.

Michael Brewer-Davis
A: 

Thanks, Mike!!! After posting here, I did a few more research and I came up with the same conclusion. I didn't have the pureMVC source code in the project I'm working on, and since the project is using pureMVC v.1.0, I didn't know if I could still get the source code for that. It'll be upgraded to v.2 soon.

Anyways, I assigned a unique name to the mediator and assigned that unique name as the id of the component. Here is the link to where it helped me debug:

http://forums.puremvc.org/idex.php?topic=596.0

Hopefully, it'll be useful to other pureMVC noobie (like me) in the future. :)

LazerWonder
You can of course get the source for your version from the PureMVC SVN repository: http://svn.puremvc.org/PureMVC_AS3/tags/
Michael Brewer-Davis
A: 

not working, i want to simple register a mediator for a specific mediator.

manish sharma
Need more details to help, Manish.
LazerWonder