Skip to content
This repository has been archived by the owner on Nov 16, 2017. It is now read-only.

Commit

Permalink
RF-13719 rich.fileUpload breaks form action in portal
Browse files Browse the repository at this point in the history
 - Modify fileupload.js to retain the original form action, such that if a partial action is used to upload the file, the original non partial action can be set on the form on completion of the upload
  • Loading branch information
kenfinnigan committed Aug 19, 2014
1 parent ab77893 commit 5b41185
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -190,12 +190,13 @@

__submit: function() {
var encodedURLInputs = this.form.children("input[name='javax.faces.encodedURL']");
var originalAction = encodedURLInputs.length > 0 ? encodedURLInputs.val() : this.form.attr("action");
var originalAction = this.form.attr("action");
var uploadAction = encodedURLInputs.length > 0 ? encodedURLInputs.val() : originalAction;
var originalEncoding = this.form.attr("encoding");
var originalEnctype = this.form.attr("enctype");
try {
var delimiter = originalAction.indexOf("?") == -1 ? "?" : "&";
this.form.attr("action", originalAction + delimiter + UID + "=" + this.loadableItem.uid);
var delimiter = uploadAction.indexOf("?") == -1 ? "?" : "&";
this.form.attr("action", uploadAction + delimiter + UID + "=" + this.loadableItem.uid);
this.form.attr("encoding", "multipart/form-data");
this.form.attr("enctype", "multipart/form-data");
richfaces.submitForm(this.form, {"org.richfaces.ajax.component": this.id}, this.id);
Expand Down

0 comments on commit 5b41185

Please sign in to comment.