-
1. Re: rich:fileUpload - Transfer error occurred
gjhofmann Jan 11, 2009 3:33 AM (in response to strannik)Hi,
when I use richfaces upload component in my spring webflow application I also get the error message "Transfer error occured" although the file is uploaded successfully.
The reason for this error messages seems to be that in FileUpload.js code is looking for an input element named "'javax.faces.ViewState":findViewState: function(d) { var s = 'javax.faces.ViewState'; var input = d.getElementsByTagName("input"); for (var i in input) { if (input.name == s) { return input; } } return d.getElementById(s); },
This input element should be located in an hidden iframe, but in an SWF application this input element doesn't exist so the above error message is shown.
Does anybody have an idea what's going wrong?
Regards -
2. Re: rich:fileUpload - Transfer error occurred
strannik Jan 12, 2009 4:06 AM (in response to strannik)gjhofmann, do you use Facelets?
It looks like Facelet doesn't have 'javax.faces.ViewState' hidden field and probably save view state on the server. Is it possible to force it saving on the client side? -
3. Re: rich:fileUpload - Transfer error occurred
strannik Jan 12, 2009 5:20 AM (in response to strannik)I made some debugging around and it seems that SWF is unable to save state on the client side. SWF implementation of StateManager is FlowViewStateManager. Here is how it overrides isSavingStateInClient method
public boolean isSavingStateInClient(FacesContext context) { if (!JsfUtils.isFlowRequest()) { return delegate.isSavingStateInClient(context); } else { return false; } }
So the question is now if fileUpload can work without client-located viewState ? -
4. Re: rich:fileUpload - Transfer error occurred
andrei_exadel Jan 12, 2009 8:14 AM (in response to strannik)Hi,
Please define your environment. Which frameworks do you use in your application? -
5. Re: rich:fileUpload - Transfer error occurred
strannik Jan 12, 2009 8:26 AM (in response to strannik)I use Facelets, Spring beans, Spring Web Flow and JSF. If you want, I can post WAR file(actually it is swf-booking-richfaces with fileUpload sample page).
-
6. Re: rich:fileUpload - Transfer error occurred
mdiskin Jan 12, 2009 8:44 AM (in response to strannik)There is an open problem on the Spring Faces which is related to this.
http://jira.springframework.org/browse/FACES-6 -
7. Re: rich:fileUpload - Transfer error occurred
strannik Jan 12, 2009 10:33 AM (in response to strannik)Thanks.
So do you suggest reverting back to SWF 2.0 and wait for RichFaces update? -
8. Re: rich:fileUpload - Transfer error occurred
strannik Jan 12, 2009 10:34 AM (in response to strannik)I mean "or wait for RichFaces update".
-
9. Re: rich:fileUpload - Transfer error occurred
andrei_exadel Jan 13, 2009 4:34 AM (in response to strannik)Strannik,
Yes, please post your WAR file. You can attach it to JIRA or send me directly on amarkavtsov @ exadel . com.
Tnanks. -
10. Re: rich:fileUpload - Transfer error occurred
gjhofmann Jan 14, 2009 4:19 AM (in response to strannik)Hi,
just for testing, I "optimized" the SWF FlowViewStateManager a little bit:public void writeState(FacesContext context, javax.faces.application.StateManager.SerializedView state) throws IOException { delegate.writeState(context, state); } public boolean isSavingStateInClient(FacesContext context) { return delegate.isSavingStateInClient(context); }
and everything works fine :-)