Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    30
    Answers
    6
    Vote Rating
    2
    gendaful is on a distinguished road

      0  

    Default Answered: Getting Eror 'undefined variable' on function call from controller in productionbuild

    Answered: Getting Eror 'undefined variable' on function call from controller in productionbuild


    BackGround: I am loading a sencha mobile site in the webview of the Android device and accessing a function declared inside sencha controller from the java class as below.


    webView.loadUrl("javascript:getMeNumbers();");
    This function is declared inside my controller


    getMeNumbers : function(value) { console.log('Controller: Function called >> getMeNumbers');


    },
    Issue : I am able to call this controller function from java class when I am running this application in development mode. But as soon as I create production build and try to call this controller function from java class, it starts giving me the 'error ReferenceError: Can't find variable: getMeNumbers at undefined:1'

    It is a global function and declared outside controller's Ext.define body. Do you think this may be the reason?

    Since this should be the global function and should be accessible from Java Class, I tried to define it in app.js as well but still the same issue it means I was able to access the function from java class in development version but not in production version.

    I believe, the global scope is getting lost while the files are minified.
    Any ideas why is it not working in the production version but works only in the development version? Any ideas or pointers would help a lot.


    Thanks
    Last edited by gendaful; 15 Feb 2013 at 2:15 PM. Reason: Described more about the issue

  2. Hi.

    I have got solution to this issue and sharing the same here.

    I was facing an issue that global functions lose its context once the production build is done. So the android application which was loading sencha application thru webView.loadUrl were not able to find the instance of the function declared as a global function (out side Ext.define of controller) after the production build is developed but was working well in development version.

    Solution is >> I have declared the global functions inside controller body and declared them as controller functions and from my java class (out side application) , I called the function inside controller as below.

    webView.loadUrl("javascript:APPNAME.app.getControllerInstances(['APPNAME.controller.ControllerName'].functionName()");

    Hope it helps others too.

  3. #2
    Sencha User
    Join Date
    Dec 2012
    Posts
    30
    Answers
    6
    Vote Rating
    2
    gendaful is on a distinguished road

      0  

    Default Accessing the controller function from outside the application using webView.loadUrl

    Accessing the controller function from outside the application using webView.loadUrl


    Hi.

    I have got solution to this issue and sharing the same here.

    I was facing an issue that global functions lose its context once the production build is done. So the android application which was loading sencha application thru webView.loadUrl were not able to find the instance of the function declared as a global function (out side Ext.define of controller) after the production build is developed but was working well in development version.

    Solution is >> I have declared the global functions inside controller body and declared them as controller functions and from my java class (out side application) , I called the function inside controller as below.

    webView.loadUrl("javascript:APPNAME.app.getControllerInstances(['APPNAME.controller.ControllerName'].functionName()");

    Hope it helps others too.