This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Executing MangedBean method ...  RSS feed

 
David Carrascal
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • 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.
 
Sath Side
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Well!... That�s a good idea.

Thanks for reply!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!