Author: andrei_exadel
Date: 2008-03-18 07:12:54 -0400 (Tue, 18 Mar 2008)
New Revision: 6893
Modified:
trunk/ui/fileUpload/src/main/config/component/fileUpload.xml
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
Log:
RF-2572
Modified: trunk/ui/fileUpload/src/main/config/component/fileUpload.xml
===================================================================
--- trunk/ui/fileUpload/src/main/config/component/fileUpload.xml 2008-03-18 11:11:36 UTC
(rev 6892)
+++ trunk/ui/fileUpload/src/main/config/component/fileUpload.xml 2008-03-18 11:12:54 UTC
(rev 6893)
@@ -199,6 +199,14 @@
<defaultvalue>false</defaultvalue>
</property>
<property>
+ <name>immediateUpload</name>
+ <classname>boolean</classname>
+ <description>
+ If this attribute is true files will be immediatelly uploaded after they have been
added in list
+ </description>
+ <defaultvalue>false</defaultvalue>
+ </property>
+ <property>
<name>acceptedTypes</name>
<classname>java.lang.String</classname>
<description>
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
---
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-03-18
11:11:36 UTC (rev 6892)
+++
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-03-18
11:12:54 UTC (rev 6893)
@@ -639,7 +639,7 @@
},
uploadAllDisabled: function () {
- if (this.runUpload) {
+ if (this.runUpload && !this.options.autoUpload) {
return false;
} else {
var c = this.getFileEntriesSumByState(FileUploadEntry.READY,
FileUploadEntry.INITIALIZED, FileUploadEntry.UPLOAD_CANCELED);
@@ -922,6 +922,7 @@
}.bind(this));
parentForm.submit();
+ //this.uploading = true;
}
for (var i = 0; i < l; i++) {
Modified: trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-03-18
11:11:36 UTC (rev 6892)
+++ trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-03-18
11:12:54 UTC (rev 6893)
@@ -175,7 +175,7 @@
onerror : #{this:getAsEventHandler(context, component, "onerror")}
};
- new FileUpload('#{clientId}','#{formId}',#{this:getStopScript(context,
component)}, #{this:getFileSizeScript(context, component)}
,'#{this:getProgressBarId(context, component)}', FileUpload.CLASSES,
#{this:getLabelMarkup(context, component)},
'#{component.attributes["maxFilesQuantity"]}', events,
#{component.attributes["disabled"]}, #{this:getAcceptedTypes(context,
component)},
{'autoclear':#{component.attributes["autoclear"]}},#{this:_getLabels(labels)});
+ new FileUpload('#{clientId}','#{formId}',#{this:getStopScript(context,
component)}, #{this:getFileSizeScript(context, component)}
,'#{this:getProgressBarId(context, component)}', FileUpload.CLASSES,
#{this:getLabelMarkup(context, component)},
'#{component.attributes["maxFilesQuantity"]}', events,
#{component.attributes["disabled"]}, #{this:getAcceptedTypes(context,
component)},
{'autoclear':#{component.attributes["autoclear"]},'autoUpload':#{component.attributes["immediateUpload"]}},#{this:_getLabels(labels)});
</script>
</span>
<f:call name="utils.encodeEndFormIfNessesary" />