-
25 Jul 2011 11:37 AM #1
Undefined fields'ownerCt inside deferred calls
Undefined fields'ownerCt inside deferred calls
REQUIRED INFORMATION
Ext version tested:- Ext 4.02
Browser versions tested against:- Chrome 12.0.742.122 for Windows
Description:- When executing Ext.form.Basic.submit(), its field's ownerCts appear undefined, wich lead to js errors.
Steps to reproduce the problem:- Take the MVC demo described in ExtJs 4.0.2 docs;
- Redefine the updateUser handler so that it calls submit() directly (see the code below);
- Open the edit form and press the "Save" button
The result that was expected:- A valid HTTP request to the required URL
The result that occurs instead:- Uncaught TypeError: Cannot read property 'id' of undefined at HashMap.js:134
Test Case:
HELPFUL INFORMATIONCode:updateUser: function(button) { var win = button.up('window'); win.down('form').getForm().submit ({ url: '/', success: function(form, action) {}, failure: function(form, action) {} }); win.close(); },
Debugging already done:- when iterating over getFields() in batchLayouts, the fields seem OK but their ownerCt are undefined — which lead to the actual error;
- every getFields() iteration sees undefined ownerCt when called inside Ext.defer(). Without deferring, ownerCt are defined.
- replacing "Ext.defer(action.run, 100, action)" with just "action.run()" in Ext.form.Basic.doAction() seem to fix the problem.
Possible fix:- maybe it worth to avoid Ext.defer in Ext.form.Basic.doAction?
Additional CSS used:- only default ext-all.css
Operating System:- WinXP Pro (5.1.2600)
-
2 Aug 2011 4:30 AM #2
In window declaration write
and all will be good!closeAction: 'close'
Sorry for my English.
-
16 Aug 2011 1:55 AM #3
Thank you, this worked out, but had a stack overflow as side effect.
closeAction: 'hide' seems to be the right solution.
-
15 Sep 2011 1:01 AM #4
any fix to this issue, I get the error on both actions: "destroy" and "hide"
-
15 Sep 2011 1:22 AM #5
was using closeAction: 'hide' to form.Panel instead off window, now is for window and works. But I don't want to hide it, why "destroy" throws :
- Uncaught TypeError: Cannot read property 'id' of undefined
-
26 Mar 2012 3:06 AM #6
it's good error)))
you can not close window until submit() not done!
use code like this
in controller
Code:doFilter: function() { var wnd = this.getWindowFilter(); var formFilter = wnd.down('form'); if (formFilter.getForm().isValid()) { wnd.getEl().mask(); formFilter.submit({ scope: this, method: 'POST', url: './store/filter/setFilter.php', success: function(form, action) { var wnd = this.getWindowFilter(); wnd.getEl().unmask(); this.getGridTiming().getStore().load(); //Ext.Msg.alert('Debug', 'Success'); wnd.close(); }, failure: function(form, action) {} }); } }
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote