I have an action connected to a commandButton and was wondering where in the lifecycle actions occur. It appears as if they run right before render response, though I could be mistaken. Is there a way to have it trigger, say, after UpdateModelValues() phase. When I make the post, the only item that changes is the value of a hidden field, everything else remains the same. For some reason, it seems like the lifecycle is not running its course. What differentiates postback requests from get requests and what factors into the distinction. Basically, I would like for it to go through the complete lifecycle when the post occurs. Any ideas on what I could be doing wrong?
Originally posted by Anthony Taylor: [QB]I have an action connected to a commandButton and was wondering where in the lifecycle actions occur.
Just as you suspected, right after update model as part of "invoke application" phase.
What differentiates postback requests from get requests and what factors into the distinction. Basically, I would like for it to go through the complete lifecycle when the post occurs.
JSF has 6 phases that forms the lifecycle. GET requests go from restore view (phase 1) and jumps to render response (phase 6) where as a faces requests (POST) will go through all phases. Now you just have to be aware that interruption can happen in the life cycle, so some phases will be skipped. For example, if validation fails (which happens in phase 3), then phase 4,and 5 will be skipped.
I suggest you create a simple phase listener (go google it), so you get a clear idea how JSF internal works.
Joined: May 04, 2006
Joined: Feb 14, 2002
Does the logs give you any clues?
Like I said, implement a full Phase Listener, and see the logs where you are going wrong.