-
4 Sep 2009 6:39 PM #1
[FIXED-129][2.x/3.x] Opera 10 upload form
[FIXED-129][2.x/3.x] Opera 10 upload form
Hello.
I have a problem appeared in Opera 10 only. I have a form with uploadFile:true I'm submitting and waiting for the answer:
Code:new Ext.FormPanel({ border:false, title:false, id:'formpan5', cls:'normalcolor', fileUpload:true, autoHeight:true, reader:new Ext.data.JsonReader({ root: "rows" },Code),I have the problem on the Ext.getCmp('code').setValue(action.result.code); line as in Opera I don't have action.result at all. Please take a look at attached screenshot. The problem appears in Opera 10 only.Code:Ext.getCmp('formpan5').getForm().submit({ url:'/account/mygetcode.html', params: { id:selectedRow, paytype:Ext.getCmp('paytype1').getGroupValue(), dyntype:Ext.getCmp('dyntype1').getGroupValue(), logotype:Ext.getCmp('logotype1').getGroupValue(), design:radio_val(document.getElementById('design1').form.xdesign), link:radio_val(document.getElementById('link1').form.xlink), paycost:Ext.getCmp('paycost1').getGroupValue(), roundcost:Ext.getCmp('roundcost1').getGroupValue(), cost:Ext.getCmp('cost').getValue(), linktext:Ext.getCmp('linktext').getValue() }, waitMsg:'Получение HTML-кода', waitTitle:'Обращение к серверу', success:function(form, action){ codeTab=9; for(var x=1;x<=9;x++){Ext.getCmp('codepan'+x).setVisible(0)} Ext.getCmp('code').setValue(action.result.code); Ext.getCmp('codepan9').setVisible(1); Ext.getCmp('nextBtn5').setText('Закрыть'); }, failure:function(form, action){ Ext.Msg.alert("Ошибка",action.result.status); } })
-
4 Sep 2009 10:45 PM #2
Result is decoded from response. What's response? Go back through the call stack to the load handler of the iframe that receives the response document, and have a look round there.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
5 Sep 2009 6:02 PM #3
Ok, I'll try. The only thing I know is that the response is absolutely OK. I checked that with sniffer and at least that works in any other browser.
-
10 Sep 2009 9:36 AM #4
I checked everyting and should say iframe is loaded without any problem. Iframe contents is ok. The same contents works in any other browser. So I should say it seems to be a bug.
-
10 Sep 2009 9:56 AM #5
Find this function in ext-all-debug.js:
Set a break in it and step through it and watch how it creates the synthetic XHR.Code:function cb(){ var me = this, // bogus response object r = {responseText : '', responseXML : null, argument : o.argument}, doc, firstChild; try{ doc = frame.contentWindow.document || frame.contentDocument || WINDOW.frames[id].document; if(doc){ if(doc.body){ if(/textarea/i.test((firstChild = doc.body.firstChild || {}).tagName)){ // json response wrapped in textarea r.responseText = firstChild.value; }else{ r.responseText = doc.body.innerHTML; } } //in IE the document may still have a body even if returns XML. r.responseXML = doc.XMLDocument || doc; } } catch(e) {} Ext.EventManager.removeListener(frame, LOAD, cb, me); me.fireEvent(REQUESTCOMPLETE, me, r, o); function runCallback(fn, scope, args){ if(Ext.isFunction(fn)){ fn.apply(scope, args); } } runCallback(o.success, o.scope, [r, o]); runCallback(o.callback, o.scope, [o, true, r]); if(!me.debugUploads){ setTimeout(function(){Ext.removeNode(frame);}, 100); } }Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
10 Sep 2009 5:13 PM #6
It seems quite strange. If I pause script execution anywhere in this code, everything seems ok - responseText and result looks good and script works.
If I just execute the script without using Opera debugger, there is no responseText.
-
10 Sep 2009 11:16 PM #7
OK, so sounds like a timing issue?
What if you executed that callback on a delay?
Look at the line immediately after than function definition which adds it as a load listener:
Change it toCode:Ext.EventManager.on(frame, LOAD, cb, this);
Which will delay execution of the cb function for 100ms after the frame fires its ready event.Code:Ext.EventManager.on(frame, LOAD, cb, this, {delay: 100});Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
10 Sep 2009 11:57 PM #8
You are right! I put 4000 delay and it works. Thanj you!
Anyway I'm still sure this is a bug which should be fixed.
-
11 Sep 2009 3:57 AM #9
i worked around this by rerequesting the response in onSucess. form uploads response appears to be unrelyable in general.
-
11 Sep 2009 4:19 AM #10Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 43
Apparently in Opera the 'load' event fires before the DOM is ready (and an extra DOMContentLoaded event handler is probably needed).
You found a bug! We've classified it as
a bug in our system.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote