-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 5.8-SNAPSHOT
-
Fix Version/s: 5.8
-
Component/s: Seam / JSF UI
-
Tags:
-
Backlog priority:600
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:
- 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.
- 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.