Results 1 to 2 of 2

Thread: Controllers can be initialized twice

    You found a bug! We've classified it as EXTJS-7822 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member Fredric Berling's Avatar
    Join Date
    Sep 2007
    Location
    Sweden
    Posts
    198
    Vote Rating
    17
      0  

    Default Controllers can be initialized twice

    REQUIRED INFORMATION


    Ext version tested:
    • Ext 4.1.3


    Browser versions tested against:
    • Chrome



    Description:
    • 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.





    HELPFUL INFORMATION




    Possible fix:
    • Access controllers with the shorter namespace name . Not the full.



    Operating System:
    • Mac OSx

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,421
    Vote Rating
    1271
      0  

    Default

    Here are my steps to reproduce:

    1. Generate a new app using Cmd
    2. 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
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •