This content has been marked as final.
Show 1 reply
-
1. Re: How to run a page action only once? or How to maintain t
delphi'sghost Jun 26, 2007 2:11 AM (in response to grettke_spdr)If I'm understanding the problem right, you could put the initialization code into a @Create annotated method which would be called when when the backing bean is created as long as the backing bean is used only with this page. I think you would have to make the bean conversational scope, and run the page within the conversational scope. I must admit I don't fully understand the page scope. I think in page scope it creates and destroys the bean each time. (I still don't get the differences between page and even scopes).
Another option might be simply to outject a flag into the conversational scope using something like :@In @Out(Scope=CONVERSATION) private Boolean isPrepared;
Set this flag in your initialization scope and it will be passed in and out of the bean on each action. I think this could work, but I'm not sure.
Of course then you can access the #{isPrepared} value from your page navigation logic if you still need it.