You found a bug! We've classified it as TOUCH-4300 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User flyacts's Avatar
    Join Date
    Nov 2011
    Location
    Jena, Germany
    Posts
    2
    Vote Rating
    0
    flyacts is on a distinguished road

      0  

    Default ST2.1.1 - 2.2RC Listener Bugs

    ST2.1.1 - 2.2RC Listener Bugs


    Ext version tested:
    • ST 2.1.1
    • ST 2.2b1
    • ST 2.2b2
    • ST 2.2rc
    Browser versions tested against:
    • Chrome Canary Latest
    • Chrome Dev Latest
    • Chrome Normal Latest
    Description:
    • Listeners set by setRef and setControl are not fired as expected.
    Steps to reproduce the problem:
    • start test case and look at console output
    CASE 1: View is an Container.

    The result that was expected:
    The result that occurs instead:CASE 2: View is an Sheet without additional view.show()

    The result that was expected:
    • main init Main.js:5
      app launch app.js:29
      show listener via Refs + Control
      show listener inside the view
      main launch Main.js:24
      painted listener via Refs + Control
      painted listener inside the view Main.js:17
    The result that occurs instead:CASE 3: View is an Sheet with additional view.show()

    The result that was expected:
    The result that occurs instead:Possible fix:
    • not provided
    Operating System:

    Windows 8 64

    Testcase:

    app.js
    Code:
    ,
    //<debug>
    Ext.Loader.setPath({
        'Ext': 'touch/src',
        'testcase': 'app'
    });
    Ext.Loader.setConfig({
        enabled: true,
        disableCaching: false,
    });
    //</debug>
    Ext.application({
        name: 'testcase',
        
        requires: [
           'Ext.Button',
           'Ext.MessageBox'
        ],
        
        controllers: [
            'Main'
          ],
        views: [
            'Main'
        ],
        launch: function() {
            console.log('app launch')
            Ext.fly('appLoadingIndicator').destroy();
            var view = Ext.createByAlias('main')
            Ext.Viewport.add(view);
            view.show()
        }
    });

    app/view/Main.js

    Code:
    Ext.define('testcase.view.Main', {    extend: 'Ext.Sheet',
        // extend: 'Ext.Container',
        xtype: 'main',
        alias: 'main',
        config: {
            width: '100%',
            height: '100%',
            listeners: {
                show: function() {
                    console.log('show listener inside the view');
                },
                add: function() {
                    console.log('add listener inside the view');
                },
                painted: function() {
                    console.log('painted listener inside the view');
                }
            },
                
            items: [
                {
                    xtype: 'button',
                    role: 'close'
                }
            ]
        }
    });
    app/controller/Main.js

    Code:
    Ext.define('testcase.controller.Main', {
        extend: 'Ext.app.Controller',
        
        init: function() { 
            console.log('main init')
            this.setRefs({
                main : 'main',
                mainClose : 'main button[role=close]'
            });
            this.setControl({
                main : {
                    show : 'onMainShow',
                    painted : 'onMainPainted',
                    add : 'onMainAdd'
                },
                mainClose : {
                    tap: 'onMainClose'    
                }
            });
    
    
        },  
        
        launch: function() {
            console.log('main launch')
        },
        
        onMainShow: function() {
            console.log('show listener via Refs + Conteol')
        },
        
        onMainPainted: function() {
            console.log('painted listener via Refs + Conteol')
        },
        
        onMainAdd: function() {
            console.log('add listener via Refs + Conteol')
        },
        
        onMainClose: function() {
            console.log('close listener via Refs + Conteol')
        },
    });

    Best Regards,
    Martin Heß
    flyacts GmbH

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,640
    Vote Rating
    898
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha User flyacts's Avatar
    Join Date
    Nov 2011
    Location
    Jena, Germany
    Posts
    2
    Vote Rating
    0
    flyacts is on a distinguished road

      0  

    Default


    Extra error:

    other information, see above

    Tested with:

    extend: Ext.Sheet

    and
    extend: Ext.Container

    The result that was expected:
    The result that occurs instead:Testcase:

    app.js

    Code:
    // DO NOT DELETE - this directive is required for Sencha Cmd packages to work.//@require @packageOverrides
    
    
    //<debug>
    Ext.Loader.setPath({
        'Ext': 'touch/src',
        'testcase': 'app'
    });
    Ext.Loader.setConfig({
        enabled: true,
        disableCaching: false,
    });
    //</debug>
    Ext.application({
        name: 'testcase',
        
        requires: [
           'Ext.Button',
           'Ext.MessageBox'
        ],
        
        controllers: [
            'Main'
          ],
        views: [
            'Main'
        ],
        launch: function() {
            console.log('app launch')
            Ext.fly('appLoadingIndicator').destroy();
            var view = Ext.createByAlias('main')
            Ext.Viewport.add(view);
            view.show()
        }
    
    });


    app/controller/Mains.js

    Code:
    Ext.define('testcase.controller.Main', {    extend: 'Ext.app.Controller',
        
        init: function() { 
            console.log('main init')
            this.setRefs({
                main : 'main',
                mainClose : 'main button[role=close]'
            });
            this.setControl({
                main : {
                    show : 'onMainShow',
                    painted : 'onMainPainted',
                    add : 'onMainAdd',
                    hide : 'onMainHide',
                    erased : 'onMainErased'
                },
                mainClose : {
                    tap: 'onMainClose'    
                }
            });
    
    
        },  
        
        launch: function() {
            console.log('main launch')
        },
        
        onMainShow: function() {
            console.log('show listener via Refs + Control')
        },
        
        onMainPainted: function() {
            console.log('painted listener via Refs + Control')
        },
        
        onMainAdd: function() {
            console.log('add listener via Refs + Control')
        },
        
        onMainHide: function() {
            console.log('hide listener via Refs + Control')
        },
        
        onMainErased: function() {
            console.log('erased listener via Refs + Control')
        },
        
        onMainClose: function() {
            console.log('close listener via Refs + Control')
            this.getMain().hide()
        },
    
    });


    app/view/Main.js

    Code:
    Ext.define('testcase.view.Main', {    extend: 'Ext.Sheet',
        // extend: 'Ext.Container',
        xtype: 'main',
        alias: 'main',
        config: {
            width: '100%',
            height: '100%',
            listeners: {
                show: function() {
                    console.log('show listener inside the view');
                },
                add: function() {
                    console.log('add listener inside the view');
                },
                painted: function() {
                    console.log('painted listener inside the view');
                },
                hide: function() {
                    console.log('hide listener inside the view');
                },
                erased: function() {
                    console.log('erased listener inside the view');
                }
            },
                
            items: [
                {
                    xtype: 'button',
                    role: 'close',
                    text: 'close'
                }
            ]
        }
    
    });

    Best regards
    Martin Heß
    flyacts


Thread Participants: 1