[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

Ken Finnigan (JIRA) jira-events at lists.jboss.org
Thu Jul 11 10:12:20 EDT 2013


    [ https://issues.jboss.org/browse/RF-12273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789128#comment-12789128 ] 

Ken Finnigan commented on RF-12273:
-----------------------------------

Thiers,

It's worth ensuring that all the JS files are correctly loaded in the browser.

I've personally tested this with a portlet with Portlet Bridge and GateIn, and it works fine.
                
> 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
>            Assignee: Ken Finnigan
>             Fix For: 4.2.3.CR1, 4.3.0.M2
>
>
> 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
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the richfaces-issues mailing list