Wednesday, May 4, 2016

GWT Editor Framework ValueboxEditorDecorator return multiple/duplicate EditorErrors Message

I have multiple sub-editor of the same data-model.
I will use Person as example

class Person {
    @NotNull
    @Size(min = 2, message = "Persons aren't just characters")
    private String name;

    // May be null if the person is newly-created
    private String id;

    public String getName();
    public String getId();
}

EditorA implements Editor<Person> {

@Path("")
EditorB getEditorB(); -- of Editor<Person>, has ValueBoxEditorDecorator + TextBox of @Path("id")

@Path("")
EditorC getEditorC(); -- of Editor<Person>, has ValueBoxEditorDecorator + TextBox of @Path("name")

}

For testing, we will driver.flush(); where name is null.
Then driver.setConstraintValidator(Set<ConstraintValidator<?>> _person_bean_validator);

This will result the ValueBoxEditorDecorator  having 3 lines of EditorError message.
"""
Persons aren't just characters
Persons aren't just characters
Persons aren't just characters
"""

EditorA implements Editor<Person> {
@Path(".")
EditorB getEditorB();

@Path(".")
EditorC getEditorC();

}

This will result the ValueBoxEditorDecorator having 2 lines of of EditorError message.
"""
Persons aren't just characters
Persons aren't just characters
"""

EditorA implements Editor<Person> {
@Path(".")
EditorB getEditorB();

@Path("..")
EditorC getEditorC();

}

This will result the ValueBoxEditorDecorator having 1 line of of EditorError message.
"""
Persons aren't just characters
"""

Is this a correct behavior? 
It just doesn't seems right to me.

Am I understanding something wrong?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment