[richfaces-issues] [JBoss JIRA] (RF-12273) rich:fileUpload does not work in portlets because it does not utilize javax.faces.encodedURL for the XmlHttpRequest URL
Neil Griffin (JIRA)
jira-events at lists.jboss.org
Tue May 22 19:21:17 EDT 2012
[ https://issues.jboss.org/browse/RF-12273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12694910#comment-12694910 ]
Neil Griffin commented on RF-12273:
-----------------------------------
My pleasure Brian -- BTW the fix seems to be working for me.
> 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
> Fix For: 4.3-Tracking
>
>
> 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: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the richfaces-issues
mailing list