Class myfaces._impl.core.Impl
Defined in: Impl.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Implementation singleton which implements all interface method
defined by our jsf.js API
|
Method Attributes | Method Name and Description |
---|---|
chain(source, event)
implementation of the external chain function
moved into the impl
|
|
getViewState(form)
collect and encode data for a given form element (must be of type form)
find the javax.faces.ViewState element and encode its value as well!
return a concatenated string of the encoded values!
|
|
request(elem, event, options)
this function has to send the ajax requests
following request conditions must be met:
|
|
response(request, context)
Spec.
|
|
sendError(request, context, name, serverErrorName, serverErrorMessage, caller, callFunc)
implementation triggering the error chain
|
|
sendEvent(request, context, name)
sends an event
|
|
stdErrorHandler(request, context, exception)
error handler behavior called internally
and only into the impl it takes care of the
internal message transformation to a myfaces internal error
and then uses the standard send error mechanisms
also a double error logging prevention is done as well
|
Class Detail
myfaces._impl.core.Impl()
Implementation singleton which implements all interface method
defined by our jsf.js API
Method Detail
chain(source, event)
implementation of the external chain function
moved into the impl
- Parameters:
- {Object} source
- the source which also becomes the scope for the calling function (unspecified side behavior) the spec states here that the source can be any arbitrary code block. Which means it either is a javascript function directly passed or a code block which has to be evaluated separately. After revisiting the code additional testing against components showed that the this parameter is only targeted at the component triggering the eval (event) if a string code block is passed. This is behavior we have to resemble in our function here as well, I guess.
- {Event} event
- the event object being passed down into the the chain as event origin the spec is contradicting here, it on one hand defines event, and on the other it says it is optional, after asking, it meant that event must be passed down but can be undefined
getProjectStage()
- Returns:
- the project stage also emitted by the server: it cannot be cached and must be delivered over the server The value for it comes from the request parameter of the jsf.js script called "stage".
getViewState(form)
collect and encode data for a given form element (must be of type form)
find the javax.faces.ViewState element and encode its value as well!
return a concatenated string of the encoded values!
- Parameters:
- form
- Throws:
- Error in case of the given element not being of type form! https://issues.apache.org/jira/browse/MYFACES-2110
request(elem, 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} elem
- 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
- {|Object|} options
- map of options being pushed into the ajax cycle a) transformArguments out of the function b) passThrough handling with a map copy with a filter map block map
response(request, context)
Spec. 13.3.3
Examining the response markup and updating the DOM tree
- Parameters:
- {XMLHttpRequest} request
- - the ajax request
- {Object} context
- - the ajax context
sendError(request, context, name, serverErrorName, serverErrorMessage, caller, callFunc)
implementation triggering the error chain
- Parameters:
- {Object} request
- the request object which comes from the xhr cycle
- {Object} context
- (Map) the context object being pushed over the xhr cycle keeping additional metadata
- {String} name
- the error name
- {String} serverErrorName
- the server error name in case of a server error
- {String} serverErrorMessage
- the server error message in case of a server error
- {String} caller
- optional caller reference for extended error messages
- {String} callFunc
- optional caller Function reference for extended error messages handles the errors, in case of an onError exists within the context the onError is called as local error handler the registered error handlers in the queue receiv an error message to be dealt with and if the projectStage is at development an alert box is displayed note: we have additional functionality here, via the global config myfaces.config.defaultErrorOutput a function can be provided which changes the default output behavior from alert to something else
sendEvent(request, context, name)
sends an event
- Parameters:
- request
- context
- name
stdErrorHandler(request, context, exception)
error handler behavior called internally
and only into the impl it takes care of the
internal message transformation to a myfaces internal error
and then uses the standard send error mechanisms
also a double error logging prevention is done as well
- Parameters:
- request
- the request currently being processed
- context
- the context affected by this error
- exception
- the exception being thrown