-
30 Mar 2013 12:24 PM #1
navigationView.reset(), .pop(), .fireEvent('back') all throw error
navigationView.reset(), .pop(), .fireEvent('back') all throw error
REQUIRED INFORMATION
Ext version tested:- ST 2.2(beta)
- Chrome
- navigationView generates error with methods reset(), pop(), fireEvent('back') all generate the error Uncaught TypeError: Cannot call method 'getPageBox' of null. The "back" buttons do work, tho after the error, the labels are thrown off when using title as label.
- Not sure exactly, but appears to be related to pushing two lists into the same navigationView or using a segmented button to push onto a navigationView.
- no error and methods to perform as expected (pop, reset, back).
- Uncaught TypeError: Cannot call method 'getPageBox' of null.
See this URL for live test case: http://tally.mobyus.com/STShare/Test22b/- see test case at above link. not compiled.
- not provided
- only default ext-all.css
- MacOS 10.8
-
31 Mar 2013 6:10 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
Have you tried with the RC? Do you have a small test case to post here?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
31 Mar 2013 7:19 AM #3
Hey Mitchell - I'll try the RC. I put a link to a small working app that demonstrates the error. Does that work for you?
http://tally.mobyus.com/STShare/Test22b/
-
31 Mar 2013 7:20 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
I know you linked but I need to have it local so I can debug.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
31 Mar 2013 7:28 AM #5
I'll post the code here in case helpful - it consists of six views:
Main.js
TestList.js:Code:Ext.define("Test22b.view.Main", { extend: 'Ext.tab.Panel', xtype: 'mainview', requires: [ //'Ext.TitleBar', 'Test22b.view.TestNav' ], config: { tabBarPosition: 'bottom', items: [ { title: 'TestNav', iconCls: 'team', id: 'tabbar_teams', xtype: 'container', layout: 'fit', items: [ { xtype: 'testnav' } ] } ] } });
TestList2.js:Code:Ext.define('Test22b.view.TestList', { extend: 'Ext.List', xtype: 'testlist', requires: [ 'Ext.plugin.PullRefresh' ], config: { variableHeights: false, itemHeight: 94, plugins: [ { xclass: 'Ext.plugin.PullRefresh', pullRefreshText: 'Pull down to refresh...', releaseRefreshText: 'Here go we...', latestfeteched: function(eOpts) { alert('Very refreshing!') } } ], itemTpl: '{title}', data: [ { title: 'Pick view1', option: 1 }, { title: 'Pick nothing', option: 2 } ], listeners :{ itemtap: function( list, index, target, record, e, eOpts ) { if (index == 0) { if (!this.view1) { this.view1 = Ext.create('Test22b.view.TestView'); } list.getParent().push(this.view1); } } } } });
Code:Ext.define('Test22b.view.TestList2', { extend: 'Ext.List', xtype: 'testlist2', requires: [ 'Ext.plugin.PullRefresh' ], config: { title: 'List2', variableHeights: false, itemHeight: 94, plugins: [ { xclass: 'Ext.plugin.PullRefresh', pullRefreshText: 'Pull down to refresh...', releaseRefreshText: 'Here go we...', latestfeteched: function(eOpts) { alert('Very refreshing!') } } ], itemTpl: '{title}', data: [ { title: 'Pick view2', option: 1 }, { title: 'Pick nothing', option: 2 } ], listeners :{ itemtap: function( list, index, target, record, e, eOpts ) { if (index == 0) { if (!this.view2) { this.view2 = Ext.create('Test22b.view.TestView2'); } list.getParent().push(this.view2); } } } } });
TestNav.js:
TestView.js:Code:Ext.define('Test22b.view.TestNav', { extend: 'Ext.navigation.View', xtype: 'testnav', requires: [ 'Test22b.view.TestList', 'Ext.data.Store' ], config: { autoDestroy: false, useTitleForBackButtonText: true, navigationBar: { docked: 'top', }, items: [ { title: 'List1', xtype: 'testlist' } ] }, initialize : function(nav, eOpts) { this.callParent(arguments); } });
TestView2.js:Code:Ext.define('Test22b.view.TestView', { extend : 'Ext.Container', xtype : 'testview', requires: [ 'Ext.Button', 'Ext.Label', 'Ext.Img', 'Ext.Container', 'Ext.SegmentedButton', 'Ext.ActionSheet' ], config : { layout: 'vbox', height: '100%', showAnimation: 'slideIn', hideAnimation: 'slideOut', title: 'View1', items: [ { xtype: 'container', layout: 'hbox', items: [ { xtype: 'label', style: 'float: left;', margin: 10 } ] }, { xtype: 'container', id: 'viewmain', margin: 15, tpl: '<div style="margin-bottom:10px;"><span style="font-weight:bold;">{view1msg}</span></div>' }, { xtype: 'segmentedbutton', allowMultiple: false, allowDepress: false, docked: 'bottom', height: '2em', margin: '1em', items: [ { text: 'List 2', id: 'getList2', ui: 'confirm', width: '50%', listeners: { tap: function(button) { button.getParent().setPressedButtons( false ); if (!this.list2) { this.list2 = Ext.create('Test22b.view.TestList2'); } Ext.ComponentQuery.query('testnav')[0].push(this.list2); } } }, { iconCls: 'action', id: 'calAction', iconMask: true, ui: 'confirm', width: '50%' } ] }] } });
Code:Ext.define('Test22b.view.TestView2', { extend : 'Ext.Container', xtype : 'testview2', requires: [ 'Ext.Button', 'Ext.Label', 'Ext.Img', 'Ext.Container', 'Ext.SegmentedButton', 'Ext.ActionSheet' ], config : { layout: 'vbox', height: '100%', showAnimation: 'slideIn', hideAnimation: 'slideOut', title: 'View2', items: [ { html: 'Here\' the body of test view 2' }, { xtype: 'button', text: 'Reset Nav', docked: 'bottom', margin: 20, ui: 'action', listeners: { tap: function(button) { Ext.ComponentQuery.query('testnav')[0].reset(); } } }] } });
-
31 Mar 2013 9:07 AM #6
Trying with RC. Have downloaded 2.2RC1, updated CMD, recreated my app using this new version. Now I get an error in compass related to a missing pictos-web.woff file. Tried following the instructions from a January posting related the same error in the 22alpha, but still getting the error. Once I spend some more time figuring out how to get this new version to work, I can check to see whether this reset() error is fixed in the RC. Sorry - a bit frustrating.
-
31 Mar 2013 9:36 AM #7
Hey Mitchell - I loaded the new RC, but now when I run my app, I get an error almost immediately of:
Uncaught TypeError: Object [object Object] has no method 'getDefaultDateFormat'WebStorage.js:426
... so rather than continue to figure out why my app won't run under the new RC, I'll hold off for now. Thanks for your help. Let me know if I can provide anything else to assist with the navview error.
-
1 Apr 2013 11:36 AM #8
Condensed test case to one file (Main.js)
Condensed test case to one file (Main.js)
Maybe this is easier? I created a single js file (Main.js view) that generates the error. Let me know what I need to provide or if you have any suggestions for workarounds. Thanks.
Code:Ext.define("Test22b.view.Main", { extend: 'Ext.tab.Panel', xtype: 'mainview', requires: [ 'Ext.navigation.View', 'Ext.dataview.List', 'Ext.plugin.PullRefresh', 'Ext.data.Store', 'Ext.Label', 'Ext.SegmentedButton' ], config: { tabBarPosition: 'bottom', items: [ { iconCls: 'team', id: 'tabbar_teams', xtype: 'container', layout: 'fit', items: [ ] } ], listeners: { initialize: function(view) { console.log(view); var testnav = Ext.create('Ext.navigation.View', { autoDestroy: false, id: 'testnav', useTitleForBackButtonText: true, navigationBar: { docked: 'top', } }); if (!this.testlist) { this.testlist = Ext.create('Ext.List', { title: 'List1', variableHeights: false, itemHeight: 94, plugins: [ { xclass: 'Ext.plugin.PullRefresh', pullRefreshText: 'Pull down to refresh...', releaseRefreshText: 'Here go we...', latestfeteched: function(eOpts) { alert('Very refreshing!') } } ], itemTpl: '{title}', data: [ { title: 'Pick view1', option: 1 }, { title: 'Pick nothing', option: 2 } ], listeners :{ itemtap: function( list, index, target, record, e, eOpts ) { if (index == 0) { if (!this.view1) { this.view1 = Ext.create('Ext.Container', { layout: 'vbox', height: '100%', showAnimation: 'slideIn', hideAnimation: 'slideOut', title: 'View1', items: [ { xtype: 'container', layout: 'hbox', items: [ { xtype: 'label', style: 'float: left;', margin: 10 } ] }, { xtype: 'container', id: 'viewmain', margin: 15, tpl: '<div style="margin-bottom:10px;"><span style="font-weight:bold;">{view1msg}</span></div>' }, { xtype: 'segmentedbutton', allowMultiple: false, allowDepress: false, docked: 'bottom', height: '2em', margin: '1em', items: [ { text: 'List 2', id: 'getList2', ui: 'confirm', width: '50%', listeners: { tap: function(button) { button.getParent().setPressedButtons( false ); if (!this.list2) { this.list2 = Ext.create('Ext.List', { title: 'List2', variableHeights: false, itemHeight: 94, plugins: [ { xclass: 'Ext.plugin.PullRefresh', pullRefreshText: 'Pull down to refresh...', releaseRefreshText: 'Here go we...', latestfeteched: function(eOpts) { alert('Very refreshing!') } } ], itemTpl: '{title}', data: [ { title: 'Pick view2', option: 1 }, { title: 'Pick nothing', option: 2 } ], listeners :{ itemtap: function( list, index, target, record, e, eOpts ) { if (index == 0) { if (!this.view2) { this.view2 = Ext.create('Ext.Container', { layout: 'vbox', height: '100%', showAnimation: 'slideIn', hideAnimation: 'slideOut', title: 'View2', items: [ { html: 'Here\' the body of test view 2' }, { xtype: 'button', text: 'Reset Nav', docked: 'bottom', margin: 20, ui: 'action', listeners: { tap: function(button) { Ext.ComponentQuery.query('#testnav')[0].reset(); } } }] }); } Ext.ComponentQuery.query('#testnav')[0].push(this.view2); } } } }); } Ext.ComponentQuery.query('#testnav')[0].push(this.list2); } } }, { iconCls: 'action', id: 'calAction', iconMask: true, ui: 'confirm', width: '50%' } ] }] }); } Ext.ComponentQuery.query('#testnav')[0].push(this.view1); } } } }); } testnav.add(this.testlist); Ext.ComponentQuery.query('#tabbar_teams')[0].add(testnav); //view.add(testnav); }}} });
-
2 Apr 2013 6:34 AM #9
Not fixed in 2.2.0 RC
Not fixed in 2.2.0 RC
Mitchell, as you suggested earlier, I've tried running my app under 2.2.0 RC (after I got load() and sync() working.)
Sorry to report that the error still appears.
-
2 Apr 2013 8:27 PM #10
More info on apparent cause of error.
More info on apparent cause of error.
Appears to involve any method that traverses more than 2 "back" in the navigationView.
In other words, pop(2) is working. pop(3) is not.
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.


Reply With Quote