• Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Works as designed
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Component/s: Ajax/JavaScript
    • Labels:
    • Environment:

      Operating System: All
      Platform: Macintosh

    • Issuezilla Id:
    • Status Whiteboard:

      size_medium importance_large

      size_medium importance_large


      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.

      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..."
      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!


        No work has yet been logged on this issue.


          • Assignee:
            Manfred Riem
          • Votes:
            1 Vote for this issue
            2 Start watching this issue


            • Created: