You found a bug! We've classified it as
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
Controllers can be initialized twice
Ext version tested:
Browser versions tested against:
- a controllers init function is runned again if you access a controller with the full namespace.
Steps to reproduce the problem:
- Have a controller loaded with controllers:['document.Main'] in your Ext.applications
- Access the controller with App.getController('app.controller.document.Main');
The result that was expected:
- That init was NOT runned when just doing getController
The result that occurs instead:
- Init() is runned again. I suspect the Controller get registered again because the key in the Controller Manager does not match.
- Access controllers with the shorter namespace name . Not the full.
Here are my steps to reproduce:
- Generate a new app using Cmd
- In app.js add var controller = this.getController('MyApp.controller.Main'); to a the launch method
The key in the controllers mixed collection has Main but since you are using MyApp.controller.Main it doesn't find the key as Main !== MyApp.controller.Main