aspose file tools*
The moose likes JSF and the fly likes DataTable and UploadFile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "DataTable and UploadFile" Watch "DataTable and UploadFile" New topic
Author

DataTable and UploadFile

Michele Mazzilli
Greenhorn

Joined: May 09, 2011
Posts: 3
Hello everyone,

Goal: In a jsf page, I defined a dataTable and a uploadFile. For Each file uploaded, the datatable will must update. I use a primefaces lib.

The code that i wrote:


Well, the problem is:
For each successfull upload file, dataTable show always last entry inserted because attachments in EditArticle managedBean is always empty.

Any idea??? Heeeelp
Thanks for all...


Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

What's the scope of your managed bean?
Michele Mazzilli
Greenhorn

Joined: May 09, 2011
Posts: 3
Guy deLyonesse wrote:What's the scope of your managed bean?


hello Guy deLyonesse,

first, thank you for replay.
The scope is request, because i load from Db the Article with attachments if param.id is valorized.
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

I was just looking at a portlet I built that does exactly the same thing (except the files are uploaded as opposed to coming from a DB) but I'm using JSF 1.2 so I'm not sure how useful the code would be to you if you're in JSF 2.0.

In my backing bean:



The upload method:



And the relevant part of the view.xhtml


I'm using ICEfaces but the idea is the same for straight JSF.

Michele Mazzilli
Greenhorn

Joined: May 09, 2011
Posts: 3
Nada ... the attachment list is always empty.
maybe why the call is not Ajax?

tnx
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: DataTable and UploadFile