4 Replies Latest reply on May 22, 2014 5:23 AM by Michael Jank

    Errai bean validation - @Valid

    Michael Jank Newbie

      Hi!

       

      I try validating an object which contains a list of other objects, both should be validated via bean validation. The objects in the list are being validated, but it seems they do not contain data, nevertheless I see the correct data when debugging.

       

      @Bindable

      @Portable

      public class ComponentData {

          @Size(min = 5, max = 10)

          private String title = "";

       

          @NotNull @Valid

          private List<Data> dataList = new ArrayList<Data>();

      }

       

      @Bindable

      @Portable

      public class Data {

          @Size(min = 1)

          private String name = "";

      }

       

      So when creating a new Data object and setting the name to "xy" and store it in the list, the validation of the ComponentData gives a constraint violation that the name of the Data object is an empty string, but when debugging I see "xy". I tried with and without the @NotNull annotation for the list.

       

      Are there any known issues, or did I miss something?

       

      Thank you!

      Michael