Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-alpha
    • Fix Version/s: 2.0.0-alpha
    • Component/s: JSR-314
    • Labels:
      None
    • Environment:
      browser independent javascript

      Description

      Here's the proposal for MyFaces 2.0 extensions to the JSR 314 AJAX API:

      proposed API (all additional attribute are optional, so spec conformant requests are still supportet):
      jsf.ajax.request(this, event, {execute: (componentIds), render: (componentIds), myfaces:

      {pps: (true/false), queuesize: (int), errorlevel: (warning/error/fatal)}

      )

      And here is what the additional attributes are meant to do:
      pps:
      If set to true, the PPS (partial page submit) feature becomes active. Only the elements numbered in attribute execute will become submitted.

      queuesize:
      The desired size of the request queue. For most applications it makes sense to set this to 1. Default is unlimited.

      errorlevel:
      Will bring up an alert box displaying Javascript errors. This is very helpful for debugging purposes. Possible level values are: warning, error, fatal, none. default is 'none'.

        Activity

        Ganesh Jung created issue -
        Hide
        Ganesh Jung added a comment -

        Reduced the extensions to "submit", "queuesize" and "errorlevel". Removed "disable", "loadingbar", "execbefore" and "execafter", because they are covered by the event listeners.

        Show
        Ganesh Jung added a comment - Reduced the extensions to "submit", "queuesize" and "errorlevel". Removed "disable", "loadingbar", "execbefore" and "execafter", because they are covered by the event listeners.
        Ganesh Jung made changes -
        Field Original Value New Value
        Original Estimate 120h [ 432000 ] 48h [ 172800 ]
        Remaining Estimate 120h [ 432000 ] 48h [ 172800 ]
        Description JSF AJAX as defined in the spec is lacking several features that are needed to make up for a good AJAX experience. They would be easy to implement, because the underlying J4Fry AJAX already supports them, so we'd only need to pass the parameters from the JSR 314 AJAX API to the implementation. Though these are extensions to the specs I recommend implementing them along with the MyFaces 2.0 AJAX core because they are hardly separable from the standard xhr request and callback. Please comment on these extensions.

        Here's the proposal for MyFaces 2.0 extensions to the JSR 314 AJAX API:

        current API:
        j4fry.faces.Ajax.ajaxRequest(this, event, {execute: (componentIds), render: (componentIds)}

        proposed API (all additional attribute are optional, so spec conformant requests are still supportet):
        j4fry.faces.Ajax.ajaxRequest(this, event, {execute: (componentIds), render: (componentIds), disable: (keywords/componentIds), submit: (componentsIds), queuesize: (int), loadingbar: (image url), errorlevel: (warning/error/fatal), execbefore: (JS function), execafter: (JS function)})

        And here is what the additional attributes are meant to do:

        disable:
        If the JSF developer wants to stop the user from givin additional input on certain or all components before the response is complete he can set this attribute. The designated components are disabled before the xhr request is made and only become reenabled when the xhr callback completes. It's impossible to implement this based on the specs API because there is no means to know at which point the callback completes.
        Possible values are:
        Either a keyword from this list

            * ALL (all elements)
            * BUTTON (all input-elements with type 'button')
            * SUBMIT (all input-elements with type 'submit')
            * RESET (all input-elements with type 'reset')
            * TEXT (all input-elements with type 'text')
            * RADIO (all input-elements with type 'radio')
            * CHECKBOX (all input-elements with type 'checkbox')
            * SELECT (all select-elements)
            * TEXTAREA (all textarea-elements)
            * A (all hyperlinks - a-elements)

        or the component id's of the elements to disable.
        Defaults to 'SUBMIT, RESET, BUTTON, A'.

        submit:
        If set, the PPS (partial page submit) feature becomes active. Only the elements numbered in this attribute will become submitted and only the corresponding components will be called for apply request values and update model.

        queuesize:
        The desired size of the request queue. For most applications it makes sense to set this to 1. Default is unlimited.

        loadingbar:
        During AJAX requests applications usually want to make visible some animated gif like a turning snake or similar. In this attribute the developer can pass the id of an img element. The img should be set to visibility: hidden when the page builds up and will be set to visibility: visible during the request. Again, it's impossible to implement this based on the specs API because there is no means to know at which point the callback completes.

        errorlevel:
        Will bring up an alert box displaying Javascript errors. This is very helpful for debugging purposes. Possible level values are: warning, error, fatal, none. default is 'none'.

        execbefore:
        Javascript code that will be executed before the xhr request. Setting this attribute is actually very similar to writing the script code right in front of the actual AJAX call, but there is a slight difference: Exceptions or return false in front of the AJAX call will hinder the request. Execbefore will catch exceptions and only display them when errorlevel <= warning and return false will have no effect.

        execafter:
        Javascript code that will be executed after the xhr callback has returned. In many cases scripts are only to be called after the callback has returned and the manipulations of the DOM tree are finished. This attribute is a hook for these scripts. Execafter will catch exceptions and only display them when errorlevel <= warning.
        Here's the proposal for MyFaces 2.0 extensions to the JSR 314 AJAX API:

        proposed API (all additional attribute are optional, so spec conformant requests are still supportet):
        jsf.ajax.request(this, event, {execute: (componentIds), render: (componentIds), myfaces: {submit: (componentsIds), queuesize: (int), errorlevel: (warning/error/fatal)})

        And here is what the additional attributes are meant to do:
        submit:
        If set, the PPS (partial page submit) feature becomes active. Only the elements numbered in this attribute will become submitted and only the corresponding components will be called for apply request values and update model.

        queuesize:
        The desired size of the request queue. For most applications it makes sense to set this to 1. Default is unlimited.

        errorlevel:
        Will bring up an alert box displaying Javascript errors. This is very helpful for debugging purposes. Possible level values are: warning, error, fatal, none. default is 'none'.
        Fix Version/s 2.0.0-alpha [ 12313389 ]
        Hide
        Ganesh Jung added a comment -

        Extension attribute submit changed to pps:

        Extension attribute submit was meant to contain the componentIds that must be submitted and processed on the server in phase 2-4.

        It became clear now, that the componentIds submitted with execute are the ones that must be processed on the server side in phase 2-4. Still, all form input must be submitted according to the spec. Extension attribute pps setting to true means to submit only the components named in the execute attribute thus making the AJAX call a lot faster.

        Show
        Ganesh Jung added a comment - Extension attribute submit changed to pps: Extension attribute submit was meant to contain the componentIds that must be submitted and processed on the server in phase 2-4. It became clear now, that the componentIds submitted with execute are the ones that must be processed on the server side in phase 2-4. Still, all form input must be submitted according to the spec. Extension attribute pps setting to true means to submit only the components named in the execute attribute thus making the AJAX call a lot faster.
        Ganesh Jung made changes -
        Description Here's the proposal for MyFaces 2.0 extensions to the JSR 314 AJAX API:

        proposed API (all additional attribute are optional, so spec conformant requests are still supportet):
        jsf.ajax.request(this, event, {execute: (componentIds), render: (componentIds), myfaces: {submit: (componentsIds), queuesize: (int), errorlevel: (warning/error/fatal)})

        And here is what the additional attributes are meant to do:
        submit:
        If set, the PPS (partial page submit) feature becomes active. Only the elements numbered in this attribute will become submitted and only the corresponding components will be called for apply request values and update model.

        queuesize:
        The desired size of the request queue. For most applications it makes sense to set this to 1. Default is unlimited.

        errorlevel:
        Will bring up an alert box displaying Javascript errors. This is very helpful for debugging purposes. Possible level values are: warning, error, fatal, none. default is 'none'.
        Here's the proposal for MyFaces 2.0 extensions to the JSR 314 AJAX API:

        proposed API (all additional attribute are optional, so spec conformant requests are still supportet):
        jsf.ajax.request(this, event, {execute: (componentIds), render: (componentIds), myfaces: {pps: (true/false), queuesize: (int), errorlevel: (warning/error/fatal)})

        And here is what the additional attributes are meant to do:
        pps:
        If set to true, the PPS (partial page submit) feature becomes active. Only the elements numbered in attribute execute will become submitted.

        queuesize:
        The desired size of the request queue. For most applications it makes sense to set this to 1. Default is unlimited.

        errorlevel:
        Will bring up an alert box displaying Javascript errors. This is very helpful for debugging purposes. Possible level values are: warning, error, fatal, none. default is 'none'.
        Ganesh Jung made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Ganesh Jung added a comment -

        myfaces:queuesize, myfaces:errorlovel and myfaces:pps now functional

        Show
        Ganesh Jung added a comment - myfaces:queuesize, myfaces:errorlovel and myfaces:pps now functional
        Ganesh Jung made changes -
        Attachment patch-2174.patch [ 12405862 ]
        Ganesh Jung made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ganesh Jung made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Ganesh Jung [ ganesh.jung ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        17d 18h 50m 1 Ganesh Jung 19/Apr/09 07:07
        Patch Available Patch Available Resolved Resolved
        62d 12h 42m 1 Ganesh Jung 20/Jun/09 19:49
        Resolved Resolved Closed Closed
        4m 30s 1 Ganesh Jung 20/Jun/09 19:53

          People

          • Assignee:
            Ganesh Jung
            Reporter:
            Ganesh Jung
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 48h
              48h
              Remaining:
              Remaining Estimate - 48h
              48h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development