Dec 27, 2012, 12:52 PM
[CLOSED] filefield error after update sources from SVN 4702
hi!
After update sources from SVN 4702, I get this error when I try a upload file...
Runtime Error in Microsoft JScript: Can not get property value 'dom': the object is null or undefined
I made a sample!
After update sources from SVN 4702, I get this error when I try a upload file...
Runtime Error in Microsoft JScript: Can not get property value 'dom': the object is null or undefined
I made a sample!
<%@ Page Language="vb" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
Ext.onReady(function () {
var viewPort = Ext.create("Ext.net.Viewport", {
id: "ViewportConsole",
renderTo: Ext.getBody(),
layout: 'border',
padding: '50 50'
});
//paneMain
var paneMain = viewPort.add({
itemId: 'mainPanel',
layout: 'absolute',
title: 'fileUpload',
region: 'center',
border: true,
bodyPadding: 6
});
var formFileUpdate = paneMain.add({
fileUpload: true,
xtype: 'form',
x: 5,
y: 5,
width: 400,
height: 50,
//hidden: true,
layout: 'absolute',
border: false,
defaults: {
'labelAlign': 'top'
}
});
//txtFileUpload
formFileUpdate.add({
itemId: 'txtFileUpload',
xtype: 'filefield',
x: 5,
y: 5,
width: 390,
emptyText: 'Select a file',
fieldLabel: 'File name',
buttonText: 'Select a file'
// buttonConfig: {
// iconCls: 'upload_16'
// }
});
paneMain.add({
xtype: 'button',
text: 'send',
x: 10,
y: 80,
listeners: {
click: {
fn: function (item) {
paneMain.upLoadFile();
}
}
}
})
paneMain.upLoadFile = function (data) {
formFileUpdate.submit({
url: '/testfile2.aspx',
params: { ID: 0 }, //here, I set the code of image in database, if is edit image.
waitMsg: 'Uploading... Please wait...',
success: function (fp, o) {
Ext.Msg.alert('Success', o.result.msg);
},
failure: function (form, action) {
alert('failure');
switch (action.failureType) {
case Ext.form.Action.CLIENT_INVALID:
Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
break;
case Ext.form.Action.CONNECT_FAILURE:
Ext.Msg.alert('Failure', 'Ajax communication failed');
break;
case Ext.form.Action.SERVER_INVALID:
Ext.Msg.alert('Failure', action.result.msg);
break;
default:
Ext.Msg.alert('Failure', action.result.msg);
break;
}
}
});
}
});
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
</form>
</body>
</html>
Last edited by Daniil; Jan 29, 2013 at 3:01 PM.
Reason: [CLOSED]