-
1. Re: Is it possible to upload a file using <a4j:commandButton>
danielc.roth Jun 2, 2008 10:27 PM (in response to madhusudan)I think you should look atb the rich:fileUpload component. Seam certainly can't ajax-upload a file, without putting quite some effort into it.
-
2. Re: Is it possible to upload a file using <a4j:commandButton>
madhusudan Jun 2, 2008 11:08 PM (in response to madhusudan)Thanks for your reply Roth,
I have checked the example of rich:fileUpload at:
http://livedemo.exadel.com/richfaces-demo/richfaces/fileUpload.jsf
I didn't find any way there to upload file without refreshing the page . Can you plz tell what type of other things i have to do for
uploading a file.As currently i m using s:fileupload with a:commandButton. And i m not able to upload file.
Thanks
-
3. Re: Is it possible to upload a file using <a4j:commandButton>
amitev Jun 2, 2008 11:09 PM (in response to madhusudan)For the record, it's not allowed to upload files using AJAX due to security reasons.
-
4. Re: Is it possible to upload a file using <a4j:commandButton>
madhusudan Jun 3, 2008 1:19 PM (in response to madhusudan)I don't know weather it is possible in seam or not, but i m very sure that it is possible in some of other scripting languages.
Thanks for your response
-
5. Re: Is it possible to upload a file using <a4j:commandButton>
infinity2heaven Jun 3, 2008 4:02 PM (in response to madhusudan)If I understood your question right, you want the file to be uploaded and an ajax event be fired for processing it and based on the outcome, a redirection should happen (without refreshing the page) when the upload is done.
Here is the code for that:-
<a4j:commandButton id="next" action="#{fileUpload.navigate}" value="Proceed" id="next" styleClass="buttonRight"/> <rich:fileUpload fileUploadListener="#{fileUploadBean.uploadListener}" uploadData="#{fileUploadBean.processUploadData}"> <a4j:support event="onuploadcomplete" reRender="next" />
your fileUploadBean SFSB can have,
public void uploadListener(UploadEvent event) throws IOException { // process your file here } public String processUploadData(){ /* if contains errors return "view id that contains errors"; }else{ return "success view id"; }} */
-
6. Re: Is it possible to upload a file using <a4j:commandButton>
madhusudan Jun 4, 2008 3:50 PM (in response to madhusudan)Thanks a lot for your response Priya.
I will check out this code.
-
7. Re: Is it possible to upload a file using <a4j:commandButton>
50341 May 16, 2010 11:27 AM (in response to madhusudan)That is <s:fileUpload> not rich