Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Issues with scope: JSF-Primefaces

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was trying to implement sort functionality on primefaces dataTable.Sorting is working. But when I delete, update the dataTable items ,no effect (nothing changes) in dataTable. But in the database delete,update are occurring with out any issue.When I logged out and re-login, new list(dataTable) is fine.

employeeView.jsf:


EmployeeList.java:



I have tried with @RequestScope,@ViewScope etc.But no effect.Where I went wrong?

Primefaces-3.0.M3 with JSF2 and Google Cloud SQL
 
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where is the delete function in the page and the MB?
 
nidheesh ep
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Delete function is in other class. EmployeeView.jsf
 
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
nidheesh

I have the same as Herbert does. Cannot see anything you have posted which is attempting to delete a row from the data table.
 
nidheesh ep
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Delete method:

 
Bartender
Posts: 2659
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

s.id=: userId



Check the blanks.
 
nidheesh ep
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jan Cumps,

Thanks for that, but It was a mistake got while editing here. Actually delete functionality is working properly in the back end/database. But some cache is the problem.That is why the dataTable is not updating or refreshing. When I logged out and re-login again, the dataTable is fine updated.I don't know where is the cache problem..
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do your ManagedBean delete method looks like:

And in your page button call an action not an actionListener (if you are using p:commandButton do it with ajax=false).
reply
    Bookmark Topic Watch Topic
  • New Topic