]
Neil Griffin commented on RF-12273:
-----------------------------------
Proposed fix would be to change this:
{code}this.form.attr("action", originalAction + delimiter + UID +
\"=\" + this.loadableItem.uid);{code}
To this:
{code}this.form.attr("action",
this.form.children("input[name='javax.faces.encodedURL']").val() +
delimiter + UID + "=" + this.loadableItem.uid);{code}
rich:fileUpload does not work in portlets because it does not utilize
javax.faces.encodedURL for the XmlHttpRequest URL
-----------------------------------------------------------------------------------------------------------------------
Key: RF-12273
URL:
https://issues.jboss.org/browse/RF-12273
Project: RichFaces
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: component, portal
Affects Versions: 4.2.0.Final
Reporter: Neil Griffin
The fileupload.js JavaScript resource has a bug such that it uses the form's
"action" attribute as the XmlHttpRequest URL, rather than the
"javax.faces.encodedURL" hidden field value.
I think this is where the problem exists:
{code} __submit: function() {
var originalAction = this.form.attr("action");
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);
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);
richfaces.Event.fire(this.element, "onfilesubmit",
this.loadableItem.model);
} finally {
this.form.attr("action", originalAction);
this.form.attr("encoding", originalEncoding);
this.form.attr("enctype", originalEnctype);
this.loadableItem.input.removeAttr("name");
}
},{code}
Until this is fixed, the component will not function in a portlet environment.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: