Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Invalid
-
5.3
-
None
Description
When calling the function formEventManager tapestry is storing the new created Tapestry.FormEventManager in the storage space, for doing this we are using $T with the element id. Because the Tapestry.FormEventManager also needs to access the element, we can optimize the access to it.
This has some performance impact while using old browsers like internet explorer 7 and pages with a big number of forms.
Index: src/main/resources/org/apache/tapestry5/tapestry.js
===================================================================
— src/main/resources/org/apache/tapestry5/tapestry.js
+++ src/main/resources/org/apache/tapestry5/tapestry.js
@@ -1119,7 +1130,8 @@ T5.extendInitializers({
- @since 5.2.2
*/
formEventManager : function(spec) { - $T(spec.formId).formEventManager = new Tapestry.FormEventManager( + spec.form = $(spec.formId); + $T(spec.form).formEventManager = new Tapestry.FormEventManager( spec); },
@@ -1457,7 +1469,7 @@ Tapestry.ErrorPopup = Class.create({
Tapestry.FormEventManager = Class.create({
initialize : function(spec) {
- this.form = $(spec.formId);
+ this.form = spec.form;
this.validateOnBlur = spec.validate.blur;
this.validateOnSubmit = spec.validate.submit;