javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-737

Please define an expected behavior for an error in the AJAX callback

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Ajax/JavaScript
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

    • Issuezilla Id:
      737
    • Status Whiteboard:
      Hide

      cat1 frame size_medium importance_large draft

      Show
      cat1 frame size_medium importance_large draft

      Description

      I am working on the Apache MyFaces Trinidad AJAX code and trying to get it to
      "play nicely" with JSF 2's AJAX. I am trying to resolve how Trinidad's client
      validation code can fit in with the JSF 2 AJAX. Example use case:
      <f:ajax>
      <tr:inputText />
      </f:ajax>
      vs.
      <tr:inputText autoSubmit="true"/>

      In the latter case, Trinidad will perform client side validation before the AJAX
      request is made, in the former, it will not because the request will bypass
      Trinidad's JS and only use jsf.ajax.request to submit the form, which IMO, is
      not desired.

      As one possible idea, I am thinking to add a listener to JSF via
      jsf.ajax.addOnEvent and potentially perform the client validation in the "begin"
      event. In doing so, I would need a means to abort the request should validation
      fail. Neither the specification nor the JS docs state the expected behavior of
      the framework if a listener throws an error. In the JS code provided with the
      Mojarra source I snee that throwing an Error would abort the request as it would
      not be caught. I am not sure if this is an oversight or it is intentional.

      For this bug I would like to see:
      1) the specification or jsdoc updated to state how errors are handled within the
      callback functions
      2) a method recommended for JSF users that would allow client validation to hook
      into the JSF ajax API in a way that allows the code to abort the request if
      desired (via Error, return value from the callback, or something else) for a
      future spec?

      Thank you

        Activity

        Hide
        rogerk added a comment -

        triage

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

        GlassFish 3.1 M6 at the latest.

        Show
        Ed Burns added a comment - GlassFish 3.1 M6 at the latest.
        Hide
        Ed Burns added a comment -

        Move these to 2.2

        Show
        Ed Burns added a comment - Move these to 2.2
        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 -

        Setting priority to Minor

        Show
        Manfred Riem added a comment - Setting priority to Minor

          People

          • Assignee:
            Unassigned
            Reporter:
            Ryan Lubke
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: