Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DataTable and UploadFile

 
Michele Mazzilli
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 200
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the scope of your managed bean?
 
Michele Mazzilli
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 200
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nada ... the attachment list is always empty.
maybe why the call is not Ajax?

tnx
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic