Child interface validation not working

25 views
Skip to first unread message

kenoyer130

unread,
Nov 8, 2012, 4:07:27 PM11/8/12
to gwt-val...@googlegroups.com
I have a model like so ->

interface A {
     B getB();
}

interface B(){
  @NotEmpty
   String getName();
}

All the validation works fine on Interface A but if getName is null or blank the showErrors collection is blank for the control mapped to getName(). All mapping seems to be working fine. Do I need to do anything special for the validation to traverse sub objects? I have also added interface B to my ClientValidatorFactory but it did not throw an error before I did this. I am wondering if the NotEmpty attribute class is getting generated at all.

kenoyer130

unread,
Nov 9, 2012, 9:00:59 AM11/9/12
to gwt-val...@googlegroups.com
I figured out the issue. I need to use the @Valid attribute on interface A. This does not seem to propagate the error through HasEditorErrors interface though. The violation appears in the returned constraint violation collection but EditorError is empty in the showErrors implementation for the control.


interface A{
  @Valid
  B getB();

Jon Kenoyer

unread,
Nov 11, 2012, 12:17:34 PM11/11/12
to gwt-val...@googlegroups.com
Some more digging and I am one step closer. The issue is the path for the field is b.name in the delegate but in simpleViolation.pushViolations the absolute path resolves to b.b.name for some reason. Since the absolute path is wrong the delegate is not found.

Jon Kenoyer

unread,
Nov 11, 2012, 2:37:41 PM11/11/12
to gwt-val...@googlegroups.com
This seems to be a 2.4 bug. In 2.5 the issue went away...


On Thursday, November 8, 2012 4:07:28 PM UTC-5, kenoyer130 wrote:
Reply all
Reply to author
Forward
0 new messages