my dog learned polymorphism
The moose likes JSF and the fly likes ajax + jsf + viewstate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "ajax + jsf + viewstate" Watch "ajax + jsf + viewstate" New topic

ajax + jsf + viewstate

Anthony Taylor

Joined: May 04, 2006
Posts: 26
I am trying to understand how to maintain viewstate between the client and the server when the viewstate is stored on the client. Since the page is initially loaded once, I think I would have to somehow pass the viewstate to the server on each request using javascript. Then, I would have to somehow receive the viewstate from the server and reset the viewstate on the client. Am I thinking correctly on this? Can anyone provide me with examples of how this should be done?
Sergey Smirnov
Ranch Hand

Joined: May 29, 2003
Posts: 167
yes, you are right. The state should travel to the server with each ajax request and each ajax response should contain the new state that should be send next time.
Just look at the source code of Ajax4jsf for details.
[ January 01, 2007: Message edited by: Sergey Smirnov ]
Don't get me started about those stupid light bulbs.
subject: ajax + jsf + viewstate
It's not a secret anymore!