setItemDataSource fires required and sets the textfield-error style


i have a form, on which i use my implementation of DefaultFieldFactory. in this implementation, i have the following for a required field :

TextField tf = (TextField) f;
tf.setRequiredError(“Code is required.”);
tf.setCaption(“Code :”);

When i want to initialize this form in order to create a new record (say i click a ‘New’ button in order to initialize my form) , i do the following :

myForm.setItemDataSource(new BeanItem(new StatusT())); // where StatusT is a Hibernate pojo

But this causes the required validation to go off, which means that, when i have my form on my screen, this field has immediatly the v-textfield-error style, although i haven’t committed yet.

What i want is this required validation to go off on the moment that i commit.