Spry integration

Spry is an amazing Ajax framework that offers unique capabilities.

Spry's "dynamic regions" regenerated themselves at run-time, making somewhat harder to integrate them with other libraries, since the XHTML gets rewritten (potentially many times), after the page loads. As a matter of facts, version 1.x of TMT Validator suffered from the same problem. Version 2.x instead plays just fine with Spry.

There can be two different cases:

  1. The dynamic region is inside the <form> tag. You don't have to do anything special
  2. The dynamic region is outside the <form> tag. In such a scenario <form tmt:validate="true"> doesn't work, since the form gets regenerated by Spry's templating engine. In this case we must trigger form validation at run-time, using the tmt.validator.validateForm() like:

    <form action="index.htm" onsubmit="return tmt.validator.validateForm(this)">

Spry region inside <form> tag
Pick a lady: (only one, sorry)
The radio buttons are generated by Spry

Spry region outside <form> tag
Pick a lady: (only one, sorry)
The radio buttons are generated by Spry