GWT エディターと javax 検証を使用しています。
私はそのような子ビーンを持つモデルビーンを持っています - >
public interface BeanA {
@Valid
BeanB getBeanB();
void setBeanB(BeanB b);
}
public interface BeanB {
@NotEmpty
public String getValue();
public void setValue(String value);
}
LeafValueEditor、HasEditorErrors インターフェースを実装する Widget があります。
値は問題なくバインドされているようです。
public class MyWidget extends Composite implements
LeafValueEditor<String>, HasEditorErrors<String>{
...
@Override
public void showErrors(List<EditorError> errors) {
// Even though the error is flagged
// the errors collection does not contain it.
}
}
検証を呼び出し、ウィジェットの getValue が null を返すと、ConstraintViolation コレクションにエラーが含まれますが、showErrors が呼び出されると、リストは空になります。
違反が見つかったのに、ウィジェットの showErrors に到達しない理由はありますか?