Details

    • 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:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

    • Issuezilla Id:
      783
    • Status Whiteboard:
      Hide

      size_medium importance_large

      Show
      size_medium importance_large

      Description

      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!

        Activity

        Hide
        rogerk added a comment -

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

        Show
        rogerk added a comment - For now re-target for 2.2. If time permits may revisit for 2.1.
        Hide
        rogerk added a comment -

        triage

        Show
        rogerk added a comment - triage
        Hide
        Ed Burns added a comment -

        Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

        Show
        Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.
        Hide
        Manfred Riem added a comment -

        Set priority to Critical

        Show
        Manfred Riem added a comment - Set priority to Critical
        Hide
        Manfred Riem added a comment -

        To me it is clear what the function does when reading the description. Closing as "Works as Designed"

        Show
        Manfred Riem added a comment - To me it is clear what the function does when reading the description. Closing as "Works as Designed"

          People

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

            Dates

            • Created:
              Updated:
              Resolved: