I debugged it further (no success yet)
In SimpleViolation.java, following code is able to find 3 matching delegates for 1 property:
public static void pushViolations(Iterable<SimpleViolation> violations,
EditorDriver<?> driver, KeyMethod keyMethod) {
if (violations == null) {
return;
}
DelegateMap delegateMap = DelegateMap.of(driver, keyMethod);
// For each violation
for (SimpleViolation error : violations) {
Object key = error.getKey();
List<AbstractEditorDelegate<?, ?>> delegateList = delegateMap.get(key);
delegateList above has 2 or 3 editors depending on my configuration. Probable reason is because subType has access to all superType properties so subType editor driver can be considered a delegate for that property. SuperType's editor is a delegate in itself. Since everyone implements Editor<? extends T> everyone is responsible for setting violations. For every editor involved, it pushes violation to same textbox which shows violation multiple times.
Is this expected? If yes, how to correctly use Editor framework for polymorphic types and display ConstraintViolation only once?
Thanks,
Arpit
On Sunday, November 2, 2014 8:11:29 AM UTC-8, Arpit wrote:
Thanks Drew. I updated SO question with comments.Unfortunately the solution you linked to didn't solve the problem of publishing "multiple constraint violations". It works fine as a composite editor example (my version used to do that as well).
On Friday, October 31, 2014 7:42:57 AM UTC-7, Drew Spencer wrote:I added a comment with a link to another SO question. One of my own in fact. Hope it helps.
Drew
On Thursday, 30 October 2014 16:00:21 UTC, Arpit wrote:Details in this SO post: http://stackoverflow.com/questions/26656370/gwt- editor-framework-for- polymorphic-types Main issue with the approach mentioned in above question is that driver is not passing same ConstraintViolations given to it. When violations reach individual widgets (textbox, etc) their number is already doubled or tripled depending on number of @Path("") annotations present in the view.Appreciate any help.Thanks.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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 http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment