Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: Events not detected in production build

  1. #11

    Default stack trace

    Following is stack trace of listener call for painted event on a Panel. However in test build the listener never gets invoked....

    Ext.define.paintedListener (app/view/LeftContainer.js:46)
    (anonymous function) (sencha-touch-all.js:3128)
    Ext.define.doFire (sencha-touch-all.js:17322)
    Ext.define.fire (sencha-touch-all.js:17249)
    Ext.define.doDispatchEvent (sencha-touch-all.js:22349)
    Ext.define.dispatchQueue (sencha-touch-all.js:22776)
    Ext.define.onComponentHiddenChange (sencha-touch-all.js:22754)
    Ext.define.doFire (sencha-touch-all.js:17322)
    Ext.define.fire (sencha-touch-all.js:17249)
    Ext.define.doDispatchEvent (sencha-touch-all.js:22349)
    Ext.define.dispatchEvent (sencha-touch-all.js:22330)
    Ext.define.doFireEvent (sencha-touch-all.js:26577)
    Ext.define.fireAction (sencha-touch-all.js:26566)
    (anonymous function) (sencha-touch-all.js:27246)
    Ext.define.show (sencha-touch-all.js:54889)
    Ext.define.doActiveItemChange (sencha-touch-all.js:37006)
    Ext.define.doFire (sencha-touch-all.js:17322)
    Ext.define.fire (sencha-touch-all.js:17249)
    Ext.define.doDispatchEvent (sencha-touch-all.js:22349)
    Ext.define.dispatchEvent (sencha-touch-all.js:22330)
    Ext.define.doFireEvent (sencha-touch-all.js:26577)
    Ext.define.relayEvent (sencha-touch-all.js:27102)
    Ext.define.onContainerActiveItemChange (sencha-touch-all.js:36994)
    Ext.define.doFire (sencha-touch-all.js:17322)
    Ext.define.fire (sencha-touch-all.js:17249)
    Ext.define.doDispatchEvent (sencha-touch-all.js:22349)
    Ext.define.dispatchEvent (sencha-touch-all.js:22330)
    Ext.define.doFireEvent (sencha-touch-all.js:26577)
    Ext.define.fireAction (sencha-touch-all.js:26566)
    (anonymous function) (sencha-touch-all.js:27246)
    Ext.define.add (sencha-touch-all.js:64142)
    Ext.define.onItemFullscreenChange (sencha-touch-all.js:77342)
    Ext.define.doFire (sencha-touch-all.js:17322)
    Ext.define.fire (sencha-touch-all.js:17249)
    Ext.define.doDispatchEvent (sencha-touch-all.js:22349)
    Ext.define.dispatchEvent (sencha-touch-all.js:22330)
    Ext.define.doFireEvent (sencha-touch-all.js:26577)
    Ext.define.fireEvent (sencha-touch-all.js:26536)
    Ext.define.constructor (sencha-touch-all.js:54125)
    Base.implement.callParent (sencha-touch-all.js:4516)
    Ext.define.constructor (sencha-touch-all.js:63823)
    Ext.apply.create.Class (sencha-touch-all.js:4911)
    (anonymous function) (:2)
    Ext.ClassManager.instantiate (sencha-touch-all.js:6383)
    (anonymous function) (sencha-touch-all.js:3195)
    Ext.application.launch (app.js:82)
    Ext.define.onDependenciesLoaded (sencha-touch-all.js:29061)
    Ext.apply.require (sencha-touch-all.js:7785)
    (anonymous function) (sencha-touch-all.js:3195)
    Ext.define.loadControllerDependencies (sencha-touch-all.js:29034)
    Ext.apply.refreshQueue (sencha-touch-all.js:7534)
    Ext.apply.onFileLoaded (sencha-touch-all.js:7858)
    (anonymous function) (sencha-touch-all.js:3181)
    Ext.apply.injectScriptElement.onLoadFn (sencha-touch-all.js:7553)

  2. #12

    Default class / script file

    Ext.define('apam.view.LeftContainer', {
    extend: 'Ext.Panel',
    xtype: 'leftcontainer',
    id: 'leftcontainer',
    config: {
    layout: 'fit',
    flex: 1,
    items: []
    },
    constructor: function(config) {
    this.log('constructor');
    config = config || {};
    Ext.apply(this, config);
    Ext.apply(this.initialConfig, config);

    apam.view.LeftContainer.superclass.constructor.call(this, arguments);

    this.on('painted', Ext.Function.bind(this.paintedListener, this));
    },
    paintedListener: function() {
    console.log('painted...');
    },
    initComponent: function(config) {
    apam.view.LeftContainer.superclass.initComponent.call(this, arguments);
    },
    log: function(msg) {
    console.log('apam.view.LeftContainer: '+msg);
    }


    });

  3. #13

    Default Siimplified application still not working..

    Adding content of the files, if someone can provide any clues it will help...

    Main.js (primary view)
    app.js
    concat_app.js
    index.html

    If app.js contains the content of Main.js as in concat_app.js, the listener for click/tap on button does not get invoked, however if the Main.js is included as separate file in index.html, the listener gets invoked...

    I tried production, testing, builds and they also fail to work

  4. #14

    Default Main.js

    Ext.define('apam.view.Main', {


    extend : 'Ext.Container',


    xtype : 'mainpanel',


    config : {
    fullscreen : true,
    layout : 'hbox',
    padding : 40,
    items : [ Ext.create('Ext.Button', {
    flex : 1,
    text : 'Button',
    listeners : {
    tap : function() {
    alert('ehl');
    }
    }
    }) ]
    }
    });

  5. #15

    Default app.js

    Ext.application({
    name : 'apam',


    requires : [],


    models : [],


    views : [ 'Main' ],


    controllers : [],


    icon : {
    '57' : 'resources/icons/Icon.png',
    '72' : 'resources/icons/Icon~ipad.png',
    '114' : 'resources/icons/[email protected]',
    '144' : 'resources/icons/[email protected]'
    },


    isIconPrecomposed : true,


    startupImage : {
    '320x460' : 'resources/startup/320x460.jpg',
    '640x920' : 'resources/startup/640x920.png',
    '768x1004' : 'resources/startup/768x1004.png',
    '748x1024' : 'resources/startup/748x1024.png',
    '1536x2008' : 'resources/startup/1536x2008.png',
    '1496x2048' : 'resources/startup/1496x2048.png'
    },


    launch : function() {
    Ext.fly('appLoadingIndicator').destroy();
    Ext.Viewport.add(Ext.create('apam.view.Main'));
    },


    onUpdated : function() {
    Ext.Msg.confirm(
    "Application Update",
    "This application has just successfully been updated to the latest version. Reload now?",
    function(buttonId) {
    if (buttonId === 'yes') {
    window.location.reload();
    }
    });
    }
    });

  6. #16

    Default concat_app.js

    Ext.define('apam.view.Main', {


    extend : 'Ext.Container',


    xtype : 'mainpanel',


    config : {
    fullscreen : true,
    layout : 'hbox',
    padding : 40,
    items : [ Ext.create('Ext.Button', {
    flex : 1,
    text : 'Button',
    listeners : {
    tap : function() {
    alert('ehl');
    }
    }
    }) ]
    }
    });


    Ext.application({
    name : 'apam',


    requires : [],


    models : [],


    views : [ 'Main' ],


    controllers : [],


    icon : {
    '57' : 'resources/icons/Icon.png',
    '72' : 'resources/icons/Icon~ipad.png',
    '114' : 'resources/icons/[email protected]',
    '144' : 'resources/icons/[email protected]'
    },


    isIconPrecomposed : true,


    startupImage : {
    '320x460' : 'resources/startup/320x460.jpg',
    '640x920' : 'resources/startup/640x920.png',
    '768x1004' : 'resources/startup/768x1004.png',
    '748x1024' : 'resources/startup/748x1024.png',
    '1536x2008' : 'resources/startup/1536x2008.png',
    '1496x2048' : 'resources/startup/1496x2048.png'
    },


    launch : function() {
    Ext.fly('appLoadingIndicator').destroy();
    Ext.Viewport.add(Ext.create('apam.view.Main'));
    },


    onUpdated : function() {
    Ext.Msg.confirm(
    "Application Update",
    "This application has just successfully been updated to the latest version. Reload now?",
    function(buttonId) {
    if (buttonId === 'yes') {
    window.location.reload();
    }
    });
    }
    });

  7. #17

    Default index.html

    <!DOCTYPE HTML>
    <html manifest="" lang="en-US">
    <head>
    <meta charset="UTF-8">
    <title>apam</title>
    <style type="text/css">
    /**
    * Example of an initial loading indicator.
    * It is recommended to keep this as minimal as possible to provide instant feedback
    * while other resources are still being loaded for the first time
    */
    html, body {
    height: 100%;
    background-color: #1985D0
    }


    #appLoadingIndicator {
    position: absolute;
    top: 50%;
    margin-top: -15px;
    text-align: center;
    width: 100%;
    height: 30px;
    -webkit-animation-name: appLoadingIndicator;
    -webkit-animation-duration: 0.5s;
    -webkit-animation-iteration-count: infinite;
    -webkit-animation-direction: linear;
    }


    #appLoadingIndicator > * {
    background-color: #FFFFFF;
    display: inline-block;
    height: 30px;
    -webkit-border-radius: 15px;
    margin: 0 5px;
    width: 30px;
    opacity: 0.8;
    }


    @-webkit-keyframes appLoadingIndicator{
    0% {
    opacity: 0.8
    }
    50% {
    opacity: 0
    }
    100% {
    opacity: 0.8
    }
    }
    </style>
    <!-- The line below must be kept intact for Sencha Command to build your application -->
    <link rel="stylesheet" type="text/css" href="resources/css/app.css">
    <script src="sdk/sencha-touch-all.js"></script>

    <script src="app.js"></script>
    </head>
    <body>
    <div id="appLoadingIndicator">
    <div></div>
    <div></div>
    <div></div>
    </div>
    </body>
    </html>

  8. #18

    Default SOLVED: See Main.js below

    Ext.define('apam.view.Main', {


    extend : 'Ext.Panel',


    xtype : 'mainpanel',


    config : {
    fullscreen : false,
    layout : 'hbox',
    padding : 40,
    items : [ ]
    },

    log: function (msg) {
    console.log('apam.view.Main '+msg);
    },

    constructor: function (config) {
    this.log('constructor');
    config = config || {};

    Ext.apply(this.initialConfig, config);
    Ext.apply(this, config);

    this.button = Ext.create('Ext.Button', {
    flex : 1,
    text : 'Button',
    listeners : {
    tap : function() {
    alert('ehl');
    }
    }
    });

    apam.view.Main.superclass.constructor.apply(this, arguments);

    this.add(this.button);
    }
    });

  9. #19
    Sencha Premium User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    628
    Answers
    67

    Default

    When you override a method you should use this.callParent( arguments ) unless you really want to loose previous functionality.

    /**
    * Call the "parent" method of the current method. That is the method previously
    * overridden by derivation or by an override (see {@link Ext#define}).
    *
    * Ext.define('My.Base', {
    * constructor: function (x) {
    * this.x = x;
    * },
    *
    * statics: {
    * method: function (x) {
    * return x;
    * }
    * }
    * });
    *
    * Ext.define('My.Derived', {
    * extend: 'My.Base',
    *
    * constructor: function () {
    * this.callParent([21]);
    * }
    * });
    *
    * var obj = new My.Derived();
    *
    * alert(obj.x); // alerts 21
    *
    * This can be used with an override as follows:
    *
    * Ext.define('My.DerivedOverride', {
    * override: 'My.Derived',
    *
    * constructor: function (x) {
    * this.callParent([x*2]); // calls original My.Derived constructor
    * }
    * });
    *
    * var obj = new My.Derived();
    *
    * alert(obj.x); // now alerts 42
    *
    * This also works with static methods.
    *
    * Ext.define('My.Derived2', {
    * extend: 'My.Base',
    *
    * statics: {
    * method: function (x) {
    * return this.callParent([x*2]); // calls My.Base.method
    * }
    * }
    * });
    *
    * alert(My.Base.method(10); // alerts 10
    * alert(My.Derived2.method(10); // alerts 20
    *
    * Lastly, it also works with overridden static methods.
    *
    * Ext.define('My.Derived2Override', {
    * override: 'My.Derived2',
    *
    * statics: {
    * method: function (x) {
    * return this.callParent([x*2]); // calls My.Derived2.method
    * }
    * }
    * });
    *
    * alert(My.Derived2.method(10); // now alerts 40
    *
    * @protected
    * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
    * from the current method, for example: `this.callParent(arguments)`
    * @return {Object} Returns the result of calling the parent method
    */

  10. #20

    Default using this.callParent did not solve the problem

    using this.callParent did not solve the problem

Page 2 of 3 FirstFirst 123 LastLast

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
  •