[richfaces-issues] [JBoss JIRA] (RF-13323) FileUploadEvent listener reset the list value with Viewscope
Jiří Štefek (JIRA)
jira-events at lists.jboss.org
Wed Nov 13 03:14:05 EST 2013
[ https://issues.jboss.org/browse/RF-13323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12923021#comment-12923021 ]
Jiří Štefek edited comment on RF-13323 at 11/13/13 3:13 AM:
------------------------------------------------------------
I've attached here a simple project with 2 samples, one is using @SessionScoped and the second @ViewScoped bean. Both samples work correctly. Tried it on GlassFish 3.1.2.2, AS 7.1 with Chrome 30 and Firefox 25. So unless [~wish79] could give us a sample project, i cannot reproduce it.
----
But one thing I've noticed, when you place _fileUpload_ in the ajax rendered _outputPanel_ just like this:
{code}
<a4j:outputPanel ajaxRendered="true">
<rich:fileUpload listener="#{listener}"/>
</a4j:outputPanel>
{code}
and you will upload a file, then the components list of uploaded files disappears after each upload (doesn't matter which backing bean is used). [~bleathem] is this an intention? Or should we file an issue?
was (Author: jstefek):
I've attached here a simple project with 2 samples, one is using @SessionScoped and the second @ViewScoped bean. Both backing beans work correctly. Tried it on GlassFish 3.1.2.2, AS 7.1 with Chrome 30 and Firefox 25. So unless [~wish79] could give us a sample project, i cannot reproduce it.
----
But one thing I've noticed, when you place _fileUpload_ in the ajax rendered _outputPanel_ just like this:
{code}
<a4j:outputPanel ajaxRendered="true">
<rich:fileUpload listener="#{listener}"/>
</a4j:outputPanel>
{code}
and you will upload a file, then the components list of uploaded files disappears after each upload (doesn't matter which backing bean is used). [~bleathem] is this an intention? Or should we file an issue?
> FileUploadEvent listener reset the list value with Viewscope
> ------------------------------------------------------------
>
> Key: RF-13323
> URL: https://issues.jboss.org/browse/RF-13323
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component-input
> Affects Versions: 4.3.4
> Environment: Jboss 7.1
> Richfaces 4.3.4
> JSF 2.1.9
>
> Reporter: Mohammad Weshah
> Assignee: Jiří Štefek
> Labels: rich:fileUpload
> Attachments: RF-13323-SessionScoped.png, RF-13323-ViewScoped.png, RF-13323.zip
>
>
> Hello All,
> i make an example of upload file from richfaces showcase it is working successfully , but i notice if i changed the backing bean to viewscope the files list inside the FileUploadEvent listener will be rest every time that i upload new file , the code as follow :
>
> {code}
> protected List<UploadedImage> files = new ArrayList<UploadedImage>();
>
> public void FileUploadlistener(FileUploadEvent event) throws Exception {
> UploadedFile item = event.getUploadedFile();
> UploadedImage file = new UploadedImage();
> file.setLength(item.getData().length);
> file.setName(item.getName());
> file.setData(item.getData());
>
> files.add(file);
> }
> {code}
>
> but when i changed the scope to session the files still contain the old files, is it mandatory to the backing be session or there is something wrong ?
>
> Regards
> Wish79
--
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