This content has been marked as final.
Show 2 replies
-
1. Re: PAGE context and Ajax4JSF
gavin.king May 31, 2007 6:48 PM (in response to jazir1979)the serialized page state is not available when Ajax4JSF goes through the JSF lifecycle to process the validations
I'm sure that's not correct. Ajax4JSF does resubmit the serialized state back to the server.i wanted the data model to refresh on each request.
Then what you need to do is re-render the whole f:view. If you don't re-render the ViewRoot, then the PAGE scope attributes won't be updated on the client side.
If you use reRender="theViewRootId", everything should work fine. -
2. Re: PAGE context and Ajax4JSF
jazir1979 May 31, 2007 7:19 PM (in response to jazir1979)Hi Gavin,
Thanks for the reply."gavin.king@jboss.com" wrote:
the serialized page state is not available when Ajax4JSF goes through the JSF lifecycle to process the validations
I'm sure that's not correct. Ajax4JSF does resubmit the serialized state back to the server.
I'd have thought so too, but I read something on the forums which led me to believe this was the problem (can't find the link now). Perhaps the behaviour I'm seeing is actually to do with my @Factory/@DataModel usage.
Here's what's happening...@DataModel(scope = ScopeType.PAGE) private List<Batch> batchList; @Factory("batchList") public void search() { ... }
Now, every time focus leaves an input box that has Ajax4JSF validation on it, the search() method gets called on the server. I assumed this was because the Ajax4JSF request does not have the page scoped "batchList" available, so the @Factory gets called. What do you think?"gavin.king@jboss.com" wrote:
i wanted the data model to refresh on each request.
Then what you need to do is re-render the whole f:view. If you don't re-render the ViewRoot, then the PAGE scope attributes won't be updated on the client side.
If you use reRender="theViewRootId", everything should work fine.
Those requests aren't PPR/ajax.. but thanks for that tip because if I solve the above a4jsf validation problem, I will probably change this later on and I would have just reRender'ed the data table, not the whole view.
cheers,
Daniel.