unmap and map again
hi,
I thought this would be simple but I get an error when I try to
re-map a view to a Mediator
In my config class
mediatorMap.map( GameOverView).toMediator(GameOverViewMediatorA );
Then in some command later:
mediatorMap.unmap(GameOverView);
mediatorMap.map( GameOverView).toMediator(GameOverViewMediatorB);
But it gives me the evil eye:
Error: [object TypeFilter] already mapped to [object
MediatorMapping]
If you have overridden this mapping intentionally you can use
"unmap()" prior to your replacement mapping in order to avoid
seeing this message.
thanks,
Jeff.
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
Support Staff 1 Posted by creynders on 23 Jul, 2013 12:24 PM
I don't have the time to go bug-hunting but I can confirm it is a bug:
https://github.com/robotlegs/robotlegs-framework/issues/149
2 Posted by JeffW. on 23 Jul, 2013 12:56 PM
are you just getting a warning? Because I'm getting a warning and an error. Is there any other way to re-assign views to (other) mediators?
Support Staff 3 Posted by creynders on 23 Jul, 2013 01:13 PM
Hmmm, an error as well? Could you paste the stacktrace here?
4 Posted by JeffW. on 23 Jul, 2013 01:39 PM
Wasn't sure if you meant just the error output or the whole lot:
295 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension [object VigilanceExtension]
299 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension [object InjectableLoggerExtension]
300 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension [object ContextViewExtension]
300 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension [object EventDispatcherExtension]
301 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension [object ModularityExtension]
302 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension [object EventCommandMapExtension]
303 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension [object LocalEventMapExtension]
304 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension [object ViewManagerExtension]
305 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension [object StageObserverExtension]
306 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension [object MediatorMapExtension]
306 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension [object ViewProcessorMapExtension]
307 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension [object StageCrawlerExtension]
308 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension [object StageSyncExtension]
309 DEBUG Context-0-96 [object ConfigManager] Not yet initialized. Queuing config class [class ContextViewListenerConfig]
309 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension [object SignalCommandMapBundle]
309 DEBUG Context-0-96 [object ExtensionInstaller] Installing extension SignalCommandMapExtension-1-89
310 DEBUG Context-0-96 [object ConfigManager] Not yet initialized. Queuing config class [class ShellConfig]
310 DEBUG Context-0-96 [object ConfigManager] Not yet initialized. Queuing config class [class ModuleConnectorConfig]
310 DEBUG Context-0-96 [object ConfigManager] Not yet initialized. Queuing config object [object ContextView]
311 DEBUG Context-0-96 [object ContextViewExtension] Mapping [object Main] as contextView
311 DEBUG Context-0-96 [object ModularityExtension] Context has a ViewManager. Configuring view manager based context existence watcher...
320 DEBUG Context-0-96 [object ModularityExtension] Context configured to inherit. Broadcasting existence event...
321 DEBUG Context-0-96 [object StageSyncExtension] Context view is now on stage. Initializing context...
324 INFO Context-0-96 Context-0-96 Initializing...
332 DEBUG Context-0-96 [object StageObserverExtension] Creating genuine StageObserver Singleton
333 DEBUG Context-0-96 [object ConfigManager] Now initializing. Instantiating config class [class ContextViewListenerConfig]
337 DEBUG Context-0-96 [object ViewManagerBasedExistenceWatcher] Adding context existence event listener to container [object Main]
337 DEBUG Context-0-96 [object ConfigManager] Now initializing. Instantiating config class [class ShellConfig]
344 DEBUG Context-0-96 [object MediatorMap] [object TypeFilter] mapped to [object MediatorMapping]
366 DEBUG Context-0-96 [object ConfigManager] Now initializing. Instantiating config class [class ModuleConnectorConfig]
369 DEBUG Context-0-96 [object ConfigManager] Now initializing. Injecting into config object [object ContextView]
370 INFO Context-0-96 Context-0-96 Initialize complete
370 DEBUG Context-0-96 [object StageCrawlerExtension] ViewManager is installed. Checking for managed containers...
370 DEBUG Context-0-96 [object StageCrawlerExtension] StageCrawler scanning container [object Main] ...
373 DEBUG Context-0-96 [object StageCrawlerExtension] StageCrawler finished scanning [object Main]
StartUpCommand execute NUM OF SCREENS: 1
[SWF] Main.swf - 1,237,444 bytes after decompression
ShellModel setCurrentTheme: numbers
ShellModel currentModule: module B
ShellView switchModule, add: module B
622 DEBUG Context-0-96 [object ViewManagerBasedExistenceWatcher] Removing context existence event listener from container [object Main]
655 DEBUG Context-0-96 [object ViewManagerBasedExistenceWatcher] Adding context existence event listener to container [object ModuleB]
655 DEBUG Context-0-96 [object ViewManagerBasedExistenceWatcher] Adding context existence event listener to container [object ModuleB]
ModuleBContext
684 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension [object VigilanceExtension]
684 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension [object InjectableLoggerExtension]
684 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension [object ContextViewExtension]
684 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension [object EventDispatcherExtension]
685 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension [object ModularityExtension]
685 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension [object EventCommandMapExtension]
685 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension [object LocalEventMapExtension]
685 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension [object ViewManagerExtension]
685 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension [object StageObserverExtension]
686 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension [object MediatorMapExtension]
686 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension [object ViewProcessorMapExtension]
686 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension [object StageCrawlerExtension]
686 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension [object StageSyncExtension]
687 DEBUG Context-2-58 [object ConfigManager] Not yet initialized. Queuing config class [class ContextViewListenerConfig]
687 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension [object SignalCommandMapBundle]
687 DEBUG Context-2-58 [object ExtensionInstaller] Installing extension SignalCommandMapExtension-3-ae
688 DEBUG Context-2-58 [object ConfigManager] Not yet initialized. Queuing config class [class ModuleBConfig]
688 DEBUG Context-2-58 [object ConfigManager] Not yet initialized. Queuing config class [class ModuleConnectorConfig]
688 DEBUG Context-2-58 [object ConfigManager] Not yet initialized. Queuing config object [object ContextView]
688 DEBUG Context-2-58 [object ContextViewExtension] Mapping [object ModuleB] as contextView
688 DEBUG Context-2-58 [object ModularityExtension] Context has a ViewManager. Configuring view manager based context existence watcher...
689 DEBUG Context-2-58 [object ModularityExtension] Context configured to inherit. Broadcasting existence event...
689 DEBUG Context-0-96 [object ViewManagerBasedExistenceWatcher] Context existence event caught. Configuring child context Context-2-58
689 INFO Context-0-96 Context-0-96 Adding child context Context-2-58
689 DEBUG Context-2-58 [object StageSyncExtension] Context view is now on stage. Initializing context...
690 INFO Context-2-58 Context-2-58 Initializing...
690 DEBUG Context-2-58 [object ConfigManager] Now initializing. Instantiating config class [class ContextViewListenerConfig]
691 DEBUG Context-2-58 [object ViewManagerBasedExistenceWatcher] Adding context existence event listener to container [object ModuleB]
691 DEBUG Context-2-58 [object ConfigManager] Now initializing. Instantiating config class [class ModuleBConfig]
ModuleBConfig.configure()
692 DEBUG Context-2-58 [object MediatorMap] [object TypeFilter] mapped to [object MediatorMapping]
693 DEBUG Context-2-58 [object MediatorMap] [object TypeFilter] mapped to [object MediatorMapping]
694 DEBUG Context-2-58 [object MediatorMap] [object TypeFilter] mapped to [object MediatorMapping]
694 DEBUG Context-2-58 [object MediatorMap] [object TypeFilter] mapped to [object MediatorMapping]
694 DEBUG Context-2-58 [object MediatorMap] [object TypeFilter] mapped to [object MediatorMapping]
695 DEBUG Context-2-58 [object MediatorMap] [object TypeFilter] mapped to [object MediatorMapping]
695 DEBUG Context-2-58 [object ConfigManager] Now initializing. Instantiating config class [class ModuleConnectorConfig]
ModuleConnectorConfig.configure() Module B
696 DEBUG Context-2-58 [object ConfigManager] Now initializing. Injecting into config object [object ContextView]
696 INFO Context-2-58 Context-2-58 Initialize complete
696 DEBUG Context-2-58 [object StageCrawlerExtension] ViewManager is installed. Checking for managed containers...
696 DEBUG Context-2-58 [object StageCrawlerExtension] StageCrawler scanning container [object ModuleB] ...
#################ViewBMediator.initialize()
702 DEBUG Context-2-58 [object StageCrawlerExtension] StageCrawler finished scanning [object ModuleB]
ModuleBConfig init
MASTER RemapMediatorsCommand execute
704 DEBUG Context-2-58 [object MediatorMap] [object TypeFilter] mapped to [object MediatorMapping]
705 WARN Context-2-58 [object MediatorMap] [object TypeFilter] already mapped to [object MediatorMapping]
If you have overridden this mapping intentionally you can use "unmap()" prior to your replacement mapping in order to avoid seeing this message.
Error: [object TypeFilter] already mapped to [object MediatorMapping]
If you have overridden this mapping intentionally you can use "unmap()" prior to your replacement mapping in order to avoid seeing this message.
5 Posted by JeffW. on 23 Jul, 2013 01:47 PM
btw, I'm using a signal to execute the command in which the remapping takes place
Support Staff 6 Posted by creynders on 23 Jul, 2013 02:10 PM
Ah yes, of course, the VigilanceExtension translates logged warnings to errors. I.e. it's normal you got an error and I didn't.
I'll see if I can find the culprit.
Train rides are ideal for bug hunting IMO :)
7 Posted by JeffW. on 23 Jul, 2013 02:10 PM
Has it smt to do with this?
'The Vigilance Extension throws Errors when warnings are logged.'
8 Posted by JeffW. on 23 Jul, 2013 02:11 PM
Okay :)
Support Staff 9 Posted by creynders on 23 Jul, 2013 02:36 PM
LOL. The heat is affecting my brain, clearly. Of course it doesn't work, the unmapping should be:
or
10 Posted by JeffW. on 23 Jul, 2013 02:39 PM
aaah, a hot day indeed, thanks!!
Support Staff 11 Posted by creynders on 23 Jul, 2013 03:06 PM
Closing this up, to hide our ramblings ;)
creynders closed this discussion on 23 Jul, 2013 03:06 PM.