-
12 Feb 2012 12:31 PM #1
Beta2: this.application is undefined in Ext.app.Controller.launch()
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...
Best regards,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 // ... }, });
Frank
-
12 Feb 2012 12:37 PM #2Sencha - Community Support Team
- Join Date
- Jan 2009
- Location
- Palo Alto, California
- Posts
- 1,941
- Vote Rating
- 6
Use this.getApplication()
As a general rule, all properties in your Sencha Touch 2 code should go through a getter function like getApplicationExt JS Senior Software Architect
Personal Blog: http://edspencer.net
Twitter: http://twitter.com/edspencer
Github: http://github.com/edspencer
-
13 Feb 2012 11:08 PM #3
this.getApplication() does the job.
Thank you very much,
Frank
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote