Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As Vlad said, i also think in tapestry there is no integrated regexp check in the markup, see in this <a href="http://tapestry.apache.org/tapestry4/UsersGuide/validation.html" rel="nofollow">link</a> at the end the supported validators(But maybe there is in the version you are ussing, not really sure about that).</p> <p>Maybe you could try somehow to use the onValidate lifeCycle event handler, to validate that field against a wrong input.</p> <pre><code>@Component private Form yourForm; @Property private String inputFromField; public void onValidate() { Pattern p = Pattern.compile("^[a-zA-Z0-9]+$");//Alpha numeric regexp Matcher m = p.matcher(inputFromField); if(m.find()) { yourForm.recordError(inputFromField,messages.get("This field can only contain letters and numbers")); } } </code></pre> <p>Anyway, Im sure there is more than one way of how to do this, but this is just an example. I didnt compile and try it, but im pretty sure this is the one of the ways that can be done. If you need more help, have a look at this page: <a href="http://www.packtpub.com/article/user-input-validation-in-tapestry-5" rel="nofollow">http://www.packtpub.com/article/user-input-validation-in-tapestry-5</a></p> <p>Remember to add the tag to your form.</p> <p><strong>Update</strong></p> <p>I was wrong when i said that it is not possible to use the regexp directly in the markup. After having a look at Heanning's link, i saw that there is the possibility of using the regexp directly as you planned. Example:</p> <pre><code>&lt;t:textfield value="otherfield" validate="regexp=^a-z+$" /&gt; </code></pre> <p>I would recommend you to have a look at the link he said, it is well explained there(For Tapestry 5): <a href="http://tapestry.apache.org/forms-and-validation.html" rel="nofollow">http://tapestry.apache.org/forms-and-validation.html</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload