Issue Details (XML | Word | Printable)

Key: JAVASERVERFACES_SPEC_PUBLIC-783
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: werpu12
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
javaserverfaces-spec-public

Unclear specification description for jsf.util.chain

Created: 08/Apr/10 10:29 AM   Updated: 19/Dec/13 10:58 PM
Component/s: Ajax/JavaScript
Affects Version/s: 2.1
Fix Version/s: 2.3

Time Tracking:
Not Specified

Environment:

Operating System: All
Platform: Macintosh


Issuezilla Id: 783
Status Whiteboard:

size_medium importance_large

Tags:
Participants: Ed Burns, rogerk and werpu12


 Description  « Hide

The current specification is very unclear regarding the parameters in the
jsf.util.chain functionality:

Here is the original quote:
jsf.util.chain(source, event)

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.

Parameters:
source
The DOM element that triggered this Ajax request, or an id string of the
element to use as the triggering element.
event
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..."
is valid
while a call like chain(this, "alert..." clearly is invalid
however a call like chain(this, null, "alert ..." ...

Have in mind that undefined, not always is an optional parameter in javascript,
but a full blown object of type 'undefined'!

The third issue is the term arbitrary number of scripts, a script can be two
things in javascript, either a string which later is evaluated (which is what
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!



Ed Burns added a comment - 13/Apr/10 12:25 PM

2.1


Ed Burns added a comment - 08/Jun/10 01:04 PM

triage


Ed Burns added a comment - 22/Jun/10 09:04 PM

rogerk


rogerk added a comment - 29/Jun/10 10:29 AM

triage- get in for 2.1_gf31_m6


rogerk added a comment - 01/Jul/10 12:03 PM

re-target


rogerk added a comment - 27/Aug/10 06:12 AM

For now re-target for 2.2.
If time permits may revisit for 2.1.


rogerk added a comment - 16/Nov/10 12:54 PM

triage