Namespace jsf.ajax
jsf.ajax
Defined in: jsf.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
jsf.ajax.addOnError(errorListener)
Adds an error handler to our global error queue.
|
<static> |
jsf.ajax.addOnEvent(eventListener)
Adds a global event listener to the ajax event queue.
|
<static> |
jsf.ajax.request(element:, event:, options)
this function has to send the ajax requests
following request conditions must be met:
|
<static> |
jsf.ajax.response(request, context)
processes the ajax response if the ajax request completes successfully
|
Method Detail
<static>
jsf.ajax.addOnError(errorListener)
Adds an error handler to our global error queue.
the error handler must be of the format function errorListener(<errorData>)
with errorData being of following format:
- errorData.type : "error"
- errorData.status : the error status message
- errorData.errorName : the server error name in case of a server error
- errorData.errorMessage : the server error message in case of a server error
- errorData.source : the issuing source element which triggered the request
- eventData.responseCode: the response code (aka http request response code, 401 etc...)
- eventData.responseText: the request response text
- eventData.responseXML: the request response xml
- Parameters:
- {function} errorListener
- error handler must be of the format function errorListener(<errorData>)
<static>
jsf.ajax.addOnEvent(eventListener)
Adds a global event listener to the ajax event queue. The event listener must be a function
of following format: function eventListener(<eventData>)
- Parameters:
- {function} eventListener
- event must be of the format function eventListener(<eventData>)
<static>
jsf.ajax.request(element:, event:, options)
this function has to send the ajax requests
following request conditions must be met:
- the request must be sent asynchronously!
- the request must be a POST!!! request
- the request url must be the form action attribute
- all requests must be queued with a client side request queue to ensure the request ordering!
- Parameters:
- {String|Node} element:
- any dom element no matter being it html or jsf, from which the event is emitted
- {EVENT} event:
- any javascript event supported by that object
- {Map} options
- : map of options being pushed into the ajax cycle
<static>
jsf.ajax.response(request, context)
processes the ajax response if the ajax request completes successfully
- Parameters:
- request
- the ajax request!
- context
- the ajax context!