Have you tried to add "validate=user" on your form tag ?

-----Message d'origine-----
De : Adam X [mailto:vbgnm3c...@gmail.com] 
Envoyé : mardi 17 novembre 2015 15:23
À : Tapestry users
Objet : 5.4 JSR-303 on Entities

Seems like T 5.4-rc-1 is not validating fields entity fields annotated with
JSR-303, but it does when field is annotated with @Validate.

Abbreviated Example:

@Entity
public class User {
.....
@NotNull
private String foo;

@Validate("required")
private String bar;

// getters/setters
}

Page.java

@Property
private User user;

Page.tml

<form t:type="form">
<input t:type="textfield" t:id="foo" t:value="user.foo"/>
<input t:type="textfield" t:id="bar" t:value="user.bar"/>
</form>

So what happens both fields should produce error on empty input but only
bar does.

Adam

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to