[richfaces-svn-commits] JBoss Rich Faces SVN: r6239 - trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu Feb 21 08:23:06 EST 2008


Author: dsvyatobatsko
Date: 2008-02-21 08:23:06 -0500 (Thu, 21 Feb 2008)
New Revision: 6239

Modified:
   trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
Log:
added client side handlers (onupload, onuploadcomplete, onuploadcanceled, onerror)

Modified: trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js	2008-02-21 13:21:10 UTC (rev 6238)
+++ trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js	2008-02-21 13:23:06 UTC (rev 6239)
@@ -353,9 +353,11 @@
 
 	classes: null,
 
+	events: null,
+
 	maxFileBatchSize: null,
 
-	initialize: function(id, stopScript, getFileSizeScript, progressBarId, classes, label, maxFiles, options) {
+	initialize: function(id, stopScript, getFileSizeScript, progressBarId, classes, label, maxFiles, events, options) {
 		this.id = id;
 		this.element = $(this.id);
 		this._progressBar = $(progressBarId);
@@ -371,13 +373,24 @@
 		this.iframe = $(this.id + "_iframe");
 		this.items = $(this.id + ":fileItems");
 		this.classes = classes;
+		this.events = events;
+
 		this.maxFileBatchSize = maxFiles;
 		this.currentInput = $(this.id + ":file");
 
 		this.options = options || {};
+		this.initEvents();
 		this.setupAutoUpload();
 	},
-	
+
+	initEvents : function() {
+		for (var e in this.events) {
+			if (e) {
+				this.element.observe("rich:" + e, this.events[e]);
+			}
+		}
+	},
+
 	getFileSize: function (data) {
 	if (data) {
 		var progressData = new ProgressData(data);




More information about the richfaces-svn-commits mailing list