Author: andrei_exadel
Date: 2008-04-10 09:11:49 -0400 (Thu, 10 Apr 2008)
New Revision: 7735
Modified:
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-3020
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-04-10
13:03:14 UTC (rev 7734)
+++
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-04-10
13:11:49 UTC (rev 7735)
@@ -378,7 +378,7 @@
uploadedCount: 0,
- initialize: function(id, formId, stopScript, getFileSizeScript, progressBarId, classes,
label, maxFiles, events, disabled, acceptedTypes, options, labels, parameters) {
+ initialize: function(id, formId, actionUrl, stopScript, getFileSizeScript,
progressBarId, classes, label, maxFiles, events, disabled, acceptedTypes, options, labels,
parameters) {
this.id = id;
this.element = $(this.id);
if (formId != '') {
@@ -410,6 +410,7 @@
this.maxFileBatchSize = maxFiles;
this.currentInput = $(this.id + ":file");
+ this.actionUrl = actionUrl;
this.options = options || {};
this.initEvents();
this.setupAutoUpload();
@@ -933,7 +934,7 @@
parentForm.encoding = "multipart/form-data";
parentForm.enctype = "multipart/form-data";
parentForm.target = this.id + "_iframe";//this.id;
- parentForm.action = oldAction + (/\?/.test(oldAction) ?
'&_richfaces_upload_uid' : '?_richfaces_upload_uid') + '=' +
encodeURI(entry.uid) + "&id=" + this.id +
"&_richfaces_upload_file_indicator=true";
+ parentForm.action = this.actionUrl + (/\?/.test(this.actionUrl) ?
'&_richfaces_upload_uid' : '?_richfaces_upload_uid') + '=' +
encodeURI(entry.uid) + "&id=" + this.id +
"&_richfaces_upload_file_indicator=true";
try {
var inputs = parentForm.elements;
Modified: trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-04-10
13:03:14 UTC (rev 7734)
+++ trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-04-10
13:11:49 UTC (rev 7735)
@@ -45,6 +45,7 @@
variables.setVariable("uploadLabel",labels.get("upload"));
variables.setVariable("clearAllLabel",labels.get("clear_all"));
+ variables.setVariable("actionUrl",org.ajax4jsf.context.AjaxContextImpl.getCurrentInstance().getAjaxActionURL(context));
variables.setVariable("formId",getFormId(context, component));
variables.setVariable("containerId",getContainerId(context, component));
@@ -182,7 +183,7 @@
onclear : #{this:getAsEventHandler(context, component, "onclear")}
};
- new FileUpload('#{clientId}','#{formId}',#{this:getStopScript(context,
component)}, #{this:getFileSizeScript(context, component)}
,'#{this:getProgressBarId(context, component)}', FileUpload.CLASSES,
#{this:getLabelMarkup(context, component)}, #{maxCount}, events,
#{component.attributes["disabled"]}, #{this:getAcceptedTypes(context,
component)},
{'autoclear':#{component.attributes["autoclear"]},'autoUpload':#{component.attributes["immediateUpload"]}},#{this:_getLabels(labels)},#{this:getChildrenParams(context,
component)});
+ new
FileUpload('#{clientId}','#{formId}','#{actionUrl}',#{this:getStopScript(context,
component)}, #{this:getFileSizeScript(context, component)}
,'#{this:getProgressBarId(context, component)}', FileUpload.CLASSES,
#{this:getLabelMarkup(context, component)}, #{maxCount}, events,
#{component.attributes["disabled"]}, #{this:getAcceptedTypes(context,
component)},
{'autoclear':#{component.attributes["autoclear"]},'autoUpload':#{component.attributes["immediateUpload"]}},#{this:_getLabels(labels)},#{this:getChildrenParams(context,
component)});
</script>
</span>
<f:call name="utils.encodeEndFormIfNessesary" />