[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
Fri May 18 16:19:17 EDT 2012


Neil Griffin created RF-12273:
---------------------------------

             Summary: 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: 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