PDA

View Full Version : [FIXED-207][3.0+] IE form with fileupload: true and smt like action in hidden input



user_ss
28 Aug 2009, 11:26 AM
Ext version tested:

Ext 3.0+


Adapter used:

ext


Browser versions tested against:

IE8


Operating System:

WinXP Pro


Description:

fire error when Ext.isStrict == true, if not - works fine


Test Case:



<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="http://extjs.com/deploy/dev/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="http://extjs.com/deploy/dev/examples/form/file-upload.css" />

<script type="text/javascript" src="http://extjs.com/deploy/dev/adapter/ext/ext-base-debug.js"></script>
<script type="text/javascript" src="http://extjs.com/deploy/dev/ext-all-debug.js"></script>

<script type="text/javascript">
Ext.onReady(function(){
var fp = new Ext.FormPanel({
renderTo: 'fi-form'
,fileUpload: true

,items:[{
xtype: 'textfield'
,fieldLabel: 'just testing'
}]

,buttons: [{
text: 'test'
,handler: function(){
fp.getForm().submit({
url: 'whatever.php'
,params: {action: 'test-bug'}
});
}
}]
});
});
</script>
</head>

<body>
<div id="fi-form"></div>
</body>

</html>


Steps to reproduce the problem:

just submit pressing test


The result that was expected:

no error


The result that occurs instead:

Line: 40, Error: Object doesn't support this property or method (ext-base-debug.js)


Debugging already done:



ext-base-debug.js:
....
Ext.apply = function(o, c, defaults){
// no "this" reference for friendly out of scope calls
if(defaults){
Ext.apply(o, defaults);
}
if(o && c && typeof c == 'object'){
for(var p in c){
o[p] = c[p];
}
}
return o;
};
...


p=action
c[p]='' (type string)
o[p] is hidden input - not attribute
called from here:



ext-all-debug.js: (line about 8777)

Ext.select = Ext.Element.select;(function(){
...
// private
function doFormUpload(o, ps, url){
...
Ext.apply(form, buf);




Possible fix:

my solution im using now is:


ext-all-debug.js: (line about 8777)
replace
Ext.apply(form, buf);
by
for(var p in buf)
form.setAttribute(p, buf[p]);

evant
30 Aug 2009, 9:27 PM
A fix has been applied in SVN for Ext core, rev #59.