• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

between the render response and apply request value phases

 
massimo tarantelli
Ranch Hand
Posts: 35
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again....today i'm try to clarify some doubts that I have...
I don't understand if, after the render responce, the apply request value phase start immediately or after the click on some button (like a commandButton).
I thought that the apply phase started afther a click to let jsf save all the values in the view tree in the same time.
Anyway i've noticed that setting to true the attribute immediate is possible to make some changes to the webpage (so to the view tree) without click any buttons.
I know that in this case is like the validation phase for that element starts during the apply request value phase...so it seems that the apply value phase starts without pressing any button....
thanks.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Web-based apps don't work like ordinary GUI apps. Among other things, they do things in batches, not in discrete events, and buttons and links are not directly wired to the server, so clicking on a button doesn't do anything with any server code (including the JSF lifecycle), it simply fires off a batch (form) request that gets sent to the server, which runs the request through the JSF lifecycle, generating a response that gets sent back as a batch to the client, after which everything becomes quiet until the next request is made.

I think that one reason so many people misuse listeners in JSF is because they think that listeners fire off immediately, and they don't. They simply monitor events that come in as part of a batch request. Even AJAX requests are still request/response batches, just batches whose scope has been limited to part of the form going down and parts of the page coming back.
 
massimo tarantelli
Ranch Hand
Posts: 35
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a little confused...in this case when i can say that the apply request value phase starts?
when I click commandButton in a form?
For the whole view of the listners behaviour i think that I have to read a guide.
thanks
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All the button does is tell the client to submit the form to the server.

When the form is submitted, the URL request is decoded by the server and routed to the FacesServlet. The FacesServlet then runs through all of the JSF lifecycle phases, or as many of them as apply, since things like invalid data and immediate requests bypass some of them. The final step is the one in which the request response is assembled (rendered) and sent back to the client.

At no time do any controls directly interact with any JSF lifecycle phases.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic