[FIXED] [#659] MultiUpload unhandled exception when hover over "Browse..." button (SVN 6281)

Page 2 of 2 FirstFirst 12
  1. #11
    It was removed in the revision 6392.

    So, up to 6391 should be OK to you.
  2. #12

    Example

    Hi Danill,

    Sorry for not simplifying the code... Didn't have much time to prepare it. When I run the code below (aspx + js) when you start hoovering (sometimes you must hoover few times over the button) "is" method is failing.

    Interesting thing is the patch works here :) ... Maybe because ; I can't remember the reason I have got this page in IFrame (I think I wanted to separate the upload code ... and wanted to change it at some point... well now it is the time :)

    Anyway ... hopefully this should help you to trace the initial problem.


    UploadPage.aspx

    <%@ Page Language="C#" AutoEventWireup="false" CodeBehind="UploadPage.aspx.cs" Inherits="Problem.UploadPage" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    	<title>Upload Page</title>
    	<script src="UploadPage.js"></script>
    </head>
    <body>
    
    	<form runat="server">
    		<ext:ResourceManager runat="server" />
    
    		<ext:Viewport
    			runat="server"
    			Layout="FitLayout">
    			<Items>
    				<ext:GridPanel
    					ID="UploadGrid"
    					runat="server"
    					Border="false"
    					Frame="false">
    					<Store>
    						<ext:Store runat="server">
    							<Model>
    								<ext:Model runat="server" IDProperty="id">
    									<Fields>
    										<ext:ModelField Name="id" />
    										<ext:ModelField Name="name" />
    										<ext:ModelField Name="size" />
    										<ext:ModelField Name="status" />
    										<ext:ModelField Name="progress" />
    									</Fields>
    								</ext:Model>
    							</Model>
    						</ext:Store>
    					</Store>
    					<ColumnModel>
    						<Columns>
    							<ext:Column
    								runat="server"
    								Text="File Name"
    								DataIndex="name"
    								Width="200"
    								MenuDisabled="true"
    								Flex="1" />
    
    							<ext:Column
    								runat="server"
    								Text="Size"
    								DataIndex="size"
    								Width="200"
    								MenuDisabled="true">
    								<Renderer Format="FileSize" />
    							</ext:Column>
    							<ext:Column
    								runat="server"
    								Text="Status"
    								DataIndex="status"
    								Width="200"
    								MenuDisabled="true" />
    
    							<ext:ProgressBarColumn
    								runat="server"
    								Text="Progress"
    								DataIndex="progress"
    								MenuDisabled="true"
    								Flex="1" />
    						</Columns>
    					</ColumnModel>
    					<TopBar>
    						<ext:Toolbar Frame="false" runat="server">
    							<Items>
    								<ext:MultiUpload
    									ID="grdUploads"
    									runat="server"
    									FileDropAnywhere="true"
    									FileSizeLimit="2048 MB"
    									FileTypes="*.*"
    									FileTypesDescription="All Files"
    									FileUploadLimit="100"
    									FileQueueLimit="12">
    									<Listeners>
    										<SwfUploadLoadFailed
    											Fn="Problem.loadFailed" />
    
    										<FileSelected
    											Fn="Problem.fileSelected" />
    
    										<UploadStart
    											Handler="Problem.updateRecord(file.id, 'status', 'Sending');" />
    
    										<UploadProgress
    											Handler="Problem.updateRecord(file.id, 'progress', bytesComplete / bytesTotal);" />
    
    										<UploadComplete
    											Handler="
    												Problem.updateRecord(file.id, 'progress', 1 ); 
    												Problem.updateRecord(file.id, 'status', 'Uploaded' ); 
    												parent.Problem.enableDone();" />
    
    										<UploadAborted
    											Handler="Problem.updateRecord(file.id, 'status', 'Aborted');" />
    
    										<UploadRemoved
    											Handler="
    												var store = this.up('grid').store; 
    													store.remove(store.getById(file.id));" />
    										<UploadError
    											Fn="Problem.uploadError"
    											Scope="Problem" />
    
    										<FileSelectionError
    											Fn="Problem.fileSelectionError" />
    
    									</Listeners>
    								</ext:MultiUpload>
    
    								<ext:ToolbarSeparator />
    
    								<ext:Button
    									runat="server"
    									Text="Start Upload"
    									Handler="#{grdUploads}.startUpload();" />
    
    							</Items>
    						</ext:Toolbar>
    					</TopBar>
    				</ext:GridPanel>
    			</Items>
    		</ext:Viewport>
    	</form>
    </body>
    </html>


    UploadPage.js

    
    Problem = {
    
    	/**
    	 * 
    	 */
    	loadFailed: function () {
    
    		alert("File upload is not supported in this web browser.");
    	},
    
    	/**
    	 * 
    	 */
    	updateRecord: function (id, field, value) {
    		var rec = App.UploadGrid.store.getById(id);
    
    		rec.set(field, value);
    		rec.commit();
    	},
    
    	/**
    	 * 
    	 */
    	abortUpload: function (btn) {
    		var selModel = btn.up('grid').getSelectionModel(),
    			records;
    
    		if (!selModel.hasSelection()) {
    			Ext.Msg.alert('Error', 'Please select an upload to cancel');
    			return true;
    		}
    
    		records = selModel.getSelection();
    		App.grdUploads.abortUpload(records[0].getId());
    	},
    
    	/**
    	 * 
    	 */
    	removeUpload: function (btn) {
    		var selModel = btn.up('grid').getSelectionModel(),
    			records;
    
    		if (!selModel.hasSelection()) {
    			Ext.Msg.alert('Error', 'Please select an upload to remove');
    			return true;
    		}
    
    		records = selModel.getSelection();
    		App.grdUploads.removeUpload(records[0].getId());
    	},
    
    	/**
    	 * 
    	 */
    	fileSelected: function (item, file) {
    		// Example of cancelling a file
    		if (file.name == 'image.jpg') {
    			Ext.Msg.alert('Error', 'You cannot upload the file named "image.jpg"');
    			return false;
    		}
    
    		this.up('grid').store.add({
    			id: file.id,
    			name: file.name,
    			size: file.size,
    			status: 'Pending',
    			progress: 0
    		});
    	},
    
    	/**
    	 * 
    	 */
    	uploadError: function (item, file, errorCode, message) {
    		theGridCtrl.updateRecord(file.id, 'progress', 0);
    		theGridCtrl.updateRecord(file.id, 'status', 'Error');
    
    		switch (errorCode) {
    			case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
    				alert("Error Code: HTTP Error, File name: " + file.name + ", Message: " + message);
    				break;
    			case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
    				alert("Error Code: Upload Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
    				break;
    			case SWFUpload.UPLOAD_ERROR.IO_ERROR:
    				alert("Error Code: IO Error, File name: " + file.name + ", Message: " + message);
    				break;
    			case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
    				alert("Error Code: Security Error, File name: " + file.name + ", Message: " + message);
    				break;
    			case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
    				alert("Error Code: Upload Limit Exceeded, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
    				break;
    			case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
    				alert("Error Code: File Validation Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
    				break;
    			case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
    				theGridCtrl.updateRecord(file.id, 'status', 'Cancelled');
    				break;
    			case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
    				theGridCtrl.updateRecord(file.id, 'status', 'Stopped');
    				break;
    			default:
    				theGridCtrl.updateRecord(file.id, 'status', "Unhandled Error: " + errorCode);
    				alert("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
    				break;
    		}
    	},
    
    
    	/**
    	 * 
    	 */
    	fileSelectionError: function (item, file, errorCode, message) {
    
    		if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
    			alert("You have attempted to queue too many files.\n"
    				+ (message === 0
    					? "You have reached the upload limit."
    					: "You may select "
    				+ (message > 1
    					? "up to " + message + " files."
    					: "one file.")));
    			return;
    		}
    
    		switch (errorCode) {
    			case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
    				alert("Error Code: File too big, File name: "
    					+ file.name
    					+ ", File size: "
    					+ file.size
    					+ ", Message: "
    					+ message);
    				break;
    			case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
    				alert("Error Code: Zero byte file, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
    				break;
    			case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
    				alert("Error Code: Invalid File Type, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
    				break;
    			default:
    				alert("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
    				break;
    		}
    	}
    };
  3. #13
    Thank you!

    The corrected Ext.dom.Element.is() override has been committed in the revision 6394. Please retest.
  4. #14
    Back on track... works correctly again !

    Thank you
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 8
    Last Post: Jan 31, 2015, 6:08 AM
  2. Replies: 0
    Last Post: Jan 24, 2014, 4:57 PM
  3. Replies: 3
    Last Post: May 14, 2013, 12:34 AM
  4. Replies: 7
    Last Post: Dec 19, 2012, 3:02 PM
  5. Replies: 2
    Last Post: May 03, 2012, 3:12 PM

Tags for this Thread

Posting Permissions