@@ -0,0 +1,1522 @@
+package com.itmill.toolkit.tests.tickets;%0A%0Aimport com.itmill.toolkit.Application;%0Aimport com.itmill.toolkit.data.Property;%0Aimport com.itmill.toolkit.data.Validator;%0Aimport com.itmill.toolkit.data.Property.ValueChangeEvent;%0Aimport com.itmill.toolkit.ui.TextField;%0Aimport com.itmill.toolkit.ui.Window;%0A%0Apublic class Ticket2179 extends Application %7B%0A%0A    TextField f = new TextField(%22Test fiel ( must contain 1 & 2 )%22);%0A    Window main = new Window(%22Dual validator test%22);%0A%0A    @Override%0A    public void init() %7B%0A%0A        f.setImmediate(true);%0A        f.setRequired(true);%0A        f.addValidator(new ContainsValidator(%221%22));%0A        f.addValidator(new ContainsValidator(%222%22));%0A%0A        setMainWindow(main);%0A        main.addComponent(f);%0A%0A        f.addListener(new Property.ValueChangeListener() %7B%0A%0A            public void valueChange(ValueChangeEvent event) %7B%0A                main.showNotification(%22Test field is %22%0A                        + (f.isValid() ? %22valid%22 : %22invalid%22));%0A            %7D%0A        %7D);%0A%0A    %7D%0A%0A    class ContainsValidator implements Validator %7B%0A        private final String c;%0A%0A        public ContainsValidator(String c) %7B%0A            this.c = c;%0A        %7D%0A%0A        public boolean isValid(Object value) %7B%0A            return value != null && value.toString().contains(c);%0A        %7D%0A%0A        public void validate(Object value) throws InvalidValueException %7B%0A            if (!isValid(value)) %7B%0A                throw new InvalidValueException(%22Value does not contain %22 + c);%0A            %7D%0A%0A        %7D%0A%0A    %7D%0A%0A%7D%0A

Test for 2179