• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what happen when ajax="true" & ajax="false" from jsf lifecyle perspective

 
Mayuresh Rahate
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have newly started learning JSF along with primefaces.
In PrimeFaces for commandButton we have one attribute "ajax" but dont know the exact behavior of this attribute.
Please Explain me the behavior in terms of JSF lifecycle.
 
Louis Bros
Ranch Hand
Posts: 54
Java Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You can use JSF AJAX to process selected components on the server and render selected elements on the client.



With PrimeFaces:



Ta
 
Mayuresh Rahate
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Louis,
Thanks for your reply..but i don't want any alternative for ajax attribute..i just want what happen if i used ajax attribute for p:commandButton. i want behavior when ajax="true" & ajax="false" in terms of JSF lifeCycle
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AJAX requests initiate an HTTP request/response cycle from within a displayed webpage, in contrast to the more familiar full-page request/response cycle.

Basically, what it does in terms of JSF is it performs a form submit where the output comes back to logic instead of to the browser's page-rendering engine. The logic can then do whatever it wants with the returned data. Most often this includes modifying the current page display (partial page re-rendering).

In addition to the ability to render only parts of the displayed webpage, AJAX can also restrict what controls are included on the AJAX-driven form submit (partial forms submission). This can be useful when you don't (yet) want to update certain properties of the backing bean. A common reason for this involves cases where you want AJAX functionality when other controls in the form contain invalid values, since the AJAX submit is still going through the same basic JSF lifecycle and that means that ALL submitted values must be valid or the entire request is rejected.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic