We have two web apps, both on Tapestry 5.3.6. One (app A) came through
prior Tapestry versions from ~5.0.x maven archetype. The other (app B)
started with 5.3.6.

The problem is number validation doesn't work in App A. It appears to be
because the numerifformat definition in the validation.js file is different
in the two apps.

In AppA, we see:
/** Supplies a client-side numeric translator for the field. */
   numericformat : function(field, message, isInteger) {
    $(field).tapestryFieldEventManager({translator : function(input) {
     if (!(!isNaN( parseFloat(input) ) && isFinite( input )))
      $(field).tapestryFieldEventManager("showValidationMessage",message);
     else return parseFloat(input);
     /*
      * maybe the formatLocalizedNumber method should be implemented here,
to really fit tapestry's way
      * but we assume that parsing to float is ok atm
      */
    }
    });

In AppB, we see:
/** Supplies a client-side numeric translator for the field. */
    numericformat: function (field, message, isInteger) {
        $(field).getFieldEventManager().translator = function (input) {
            try {
                return Tapestry.formatLocalizedNumber(input, isInteger);
            } catch (e) {
                $(field).showValidationMessage(message);
            }
        };
    },

I can't figure out why AppA wouldn't have the latest Tapestry javascript
library for validation.
One difference between the apps is that AppA includes tapestry-jquery and
tapestry-bootstrap. Could that cause the difference, or there some other
likely suspects to investigate?

Szemere

Reply via email to