Class AjaxDisableComponentListener

    • Method Detail

      • getBeforeHandler

        public CharSequence getBeforeHandler​(Component component)
        Description copied from interface: IAjaxCallListener
        The JavaScript that will be executed before the Ajax call, as early as possible. Even before the preconditions. The script will be executed in a function that receives the following parameters:
        1. attrs - the AjaxRequestAttributes as JSON
        Specified by:
        getBeforeHandler in interface IAjaxCallListener
        Overrides:
        getBeforeHandler in class AjaxCallListener
        Parameters:
        component - the Component with the Ajax behavior
        Returns:
        the JavaScript that will be executed before the Ajax call.
      • getCompleteHandler

        public CharSequence getCompleteHandler​(Component component)
        Description copied from interface: IAjaxCallListener
        The JavaScript that will be executed after both successful and unsuccessful return of the Ajax call. The script will be executed in a function that receives the following parameters:
        1. attrs - the AjaxRequestAttributes as JSON
        2. jqXHR - the jQuery XMLHttpRequest object
        3. textStatus - the status as text
        Specified by:
        getCompleteHandler in interface IAjaxCallListener
        Overrides:
        getCompleteHandler in class AjaxCallListener
        Parameters:
        component - the Component with the Ajax behavior
        Returns:
        the JavaScript that will be executed after both successful and unsuccessful return of the Ajax call.
      • getFailureHandler

        public CharSequence getFailureHandler​(Component component)
        Description copied from interface: IAjaxCallListener
        The JavaScript that will be executed after unsuccessful return of the Ajax call. The script will be executed in a function that receives the following parameters:
        1. attrs - the AjaxRequestAttributes as JSON
        2. jqXHR - the jQuery XMLHttpRequest object
        3. errorMessage - in case of HTTP error the textual portion of the HTTP status
        4. textStatus - type of failure: null, "timeout", "error", "abort" or "parsererror"
        Specified by:
        getFailureHandler in interface IAjaxCallListener
        Overrides:
        getFailureHandler in class AjaxCallListener
        Parameters:
        component - the Component with the Ajax behavior
        Returns:
        the JavaScript that will be executed after a unsuccessful return of the Ajax call.
      • generateHandlerJavaScript

        protected String generateHandlerJavaScript​(Component component,
                                                   boolean disabled)
        Generate the proper enable/disable JavaScript code for the given component. By default component is enabled/disabled using DOM attribute 'disabled'.