Results 1 to 3 of 3

Thread: Beta2: this.application is undefined in Ext.app.Controller.launch()

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Aug 2010
    Posts
    25
    Vote Rating
    1
      0  

    Default Beta2: this.application is undefined in Ext.app.Controller.launch()

    Hi,

    I am accessing this.application within the controller's launch() function.
    This worked with pr3 and earlier releases.
    Isn't this.application supposed to be available within all controller functions?
    But it seams to be undefined within launch(). This is my code...

    Code:
    Ext.define('app.controller.MyController', {
        extend: 'Ext.app.Controller',
    
        launch: function() { // called after the launch method of Application is executed.
            this.application.on({...}); // --> Uncaught TypeError: Cannot call method 'on' of undefined
           // ...
        },
    });
    Best regards,
    Frank

  2. #2
    Sencha User edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    11
      0  

    Default

    Use this.getApplication()

    As a general rule, all properties in your Sencha Touch 2 code should go through a getter function like getApplication
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  3. #3
    Sencha User
    Join Date
    Aug 2010
    Posts
    25
    Vote Rating
    1
      0  

    Default

    this.getApplication() does the job.
    Thank you very much,
    Frank

Tags for this Thread

Posting Permissions

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