Win a copy of Fixing your Scrum this week in the Agile 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Executing MangedBean method ...

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have a typicla JSF page that has a datatable. That page is managed with a Session Managed Bean. If I edit a row and I change any data, I return to the datatable page and the data is not refreshed.

I have two solutions for this:
1) Repeat the query, loading all data, after changing a row.

2) Calling a "initialize()" method in the Managed Bean every time I load the datatable page... but that�s a session bean!!, (in order to execute the paginator)

Well, point 1 is easy but I find it dirty...
And I don�t know if there is a way to do point 2...

Can you help me? It�s possible to implement point 2?

Thanks in advance, (forgive terrible English...)

David.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you saying the paginator will not reset after response rendered?
 
David Carrascal
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Sath, and thanks.

Not exactly, it works Ok. The problem is that I have to use a Session Managed Bean, so if I modify any register, I have to recall the query to refresh data each time...

I�m looking for a way to execute a determined method every time I reach the datatable page, so I only had to do the recall in this moment...

But that�s a session bean, so I cannot find a way to do this in a clean manner..

Thanks in advance.
 
Sath Side
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If there are multiple pages in your application that can potentially update the data I would definitely recommend querying for the data after every update. However you could always add a boolean member variable in your Managed Bean and set to true or false depending on the "Update Row" action being called. If true, re-execute the query if false, use session value for datatable.
 
David Carrascal
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well!... That�s a good idea.

Thanks for reply!!
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic