The current specification is very unclear regarding the parameters in the
Here is the original quote:
A varargs function that invokes an arbitrary number of scripts.
<static> jsf.util.chain(source, event)
A varargs function that invokes an arbitrary number of scripts. If any script in
the chain returns false, the chain is short-circuited and subsequent scripts are
not invoked. Any number of scripts may specified after the event argument.
The DOM element that triggered this Ajax request, or an id string of the
element to use as the triggering element.
The DOM event that triggered this Ajax request. The event argument is optional.
There are several issues (some of them have been raised in the open list)
First of all it defines no return value so attaching functionality cannot
determine whether the chain has been processed fully or terminated only.
After asking in the eg it was more or less a consensous that the return value is
either true for having it processed fully or false otherwise, so that behaviors
can react properly.
Secondly, the entire parameter list aspect is rather unclear, first we have a
varargs function her, but it defines the event object as fixed object being
passed down, on the other hand it says it is optional.
So the description is clearly contradictory!
What was probably meant was that the event object must be passed down but its
values either can be an Event object or null or undefined!
therefore a call like chain(this, event, "alert..."
while a call like chain(this, "alert..." clearly is invalid
however a call like chain(this, null, "alert ..." ...
but a full blown object of type 'undefined'!
The third issue is the term arbitrary number of scripts, a script can be two
happens if you attach f:ajax, or it can be a function object which is passed
down which then later is executed.
I coded both cases into our myfaces chain, just to make sure the term arbitrary
is met, but this needs further clarification on the doc side as well!