Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-12827

Double click shield breaks jsf pages which are outside the theme

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.8-SNAPSHOT
    • Fix Version/s: 5.8
    • Component/s: Seam / JSF UI

      Description

      JSF pages having h:form but not using the theme (typically some error pages) causes javascript error in browser.

      This is because the jquery.nuxeo.doubleclickshield.js is not provided while the h:form renderer (NxFormRenderer) appends the doubleClickShield activation at the beginning of the rendered form:

      <form id="xxx" ...>
        jQuery("#xxxxx").preventDoubleSubmission();
        
        ...
        
      </form>
      

      and of course preventDoubleSubmission will be unknown.

      A solution would be:

      1. instead of appending the activation at the beginning of each form, the NxFormRenderer should just mark the form as requiring the shield. This could be done with a css class "doubleClickShielded". In case, jquery.nuxeo.doubleclickshield.js is not provided, this won't cause any errors.
      2. do a global activation in the jquery.nuxeo.doubleclickshield.js file adding
        jQuery(document).ready(function() {
          jQuery('form.doubleClickShielded').each(function() {
            jQuery(this).preventDoubleSubmission();
          });
        });
        

        This is much nicer and efficient because, instead of calling many times the activation (once per form), we will do it globally on document ready.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: