JSF – Ajax handle

Recep January 8, 2014
0 people like this post

Eger projenizde, <f:ajax/> eventlerini kullandı iseniz, zaman zaman bu request ve response’ları handle etmek isteyebilirsiniz.

<h:head>
   <h:outputScript library="javax.faces" name="jsf.js"/>
</h:head>
 
function handleAjax(data) {
   var status = data.status;
 
   switch (status) {
      case "begin":
         // This is the start of the AJAX request.
         break;
 
      case "complete":
         // This is invoked right after ajax response is returned.
         break;
 
      case "success":
         // This is invoked right after successful processing of ajax response and update of HTML DOM.
         break;
   }
}
 
// Setup the statusUpdate function to hear all events on the page
jsf.ajax.addOnEvent(handleAjax);

( 22303 )

Category: JSF
  • 0
  • 1795

Leave your comment