Re: Associating editor errors with source widgets
Every editor knows the primitive fields it's editing. If the editor implements HadEditorErrors.showErrors(), it can simply compare primitiveField.asEditor() with error.getEditor() and highlight the erroneous primitiveField. I've read through this at least half a dozen times, but I am not seeing how to pull this off in a good way. The approach of the ValueBoxEditorDecorator requires that the tags be wrapped (generally in the UiBinder xml itself rather than in java) for each and every element, and your proposal requires that the Editor instance which declares those private fields have either a collection of the editors it has in fields, or have a giant if/elseif/elseif to handle each one and check if it has the error, then do something to highlight, as you say. Is there any cleaner way to pull this off? What about (for example) looping through the editors in the showErrors() list, and checking if they extend Widget or implement IsWidget? How about other generic ways to refer to lots of Editor instances? Like in wiring up label/help icons, or something like that? I've thought about another binder/driver style marker interface, generic on the containing widget so the Generator could go through and build these if/elseif kinds of blocks, or deal with annotations on its own, but that means many of these interfaces and their GWT.create to kick them off - boilerplate that seems like it should be unnecessary. At best presently you can make a widget with a custom add method (and so custom tags) that would go through a custom dom setup process, but even those extra custom tags shouldn't be necessary, except we can't register new handlers for uibinder.. Anyone else thinking these kinds of thoughts with any more success than I? -Colin -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Associating editor errors with source widgets
Hello everyone, Is there a recommended way to find and highlight a widget that is a source of an editor errorhttp://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/editor/client/EditorError.html? It is possible to get the absolute pathhttp://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/editor/client/EditorError.html#getAbsolutePath() within the edited object, but what is the recommended way to find a corresponding widget? Thank you in advance! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Associating editor errors with source widgets
What about getting the editor out of the EditorError by calling EditorError.getEditor()? I know it doesn't get a widget per se, but there seems to be a good reason for that - not all editors are also widgets, so you may need to deal differently with each type of editor's error. My understanding was that it was up to the editor itself to say that it wants to hear about errors by implementing HasEditorErrorsT, and then processing its own (or its children's unconsumed) errors. Of course, you could do this at any level of the editor hierarchy, and then get the editor, and try to do something with that. Hope this helps push you in the right direction, Colin -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Associating editor errors with source widgets
Thanks Colin, HasEditorErrorsT makes sense. Just to recap this approach: Every editor knows the primitive fields it's editing. If the editor implements HadEditorErrors.showErrors(), it can simply compare primitiveField.asEditor() with error.getEditor() and highlight the erroneous primitiveField. As an alternative, a wrapper around a primitive field, like ValueBoxEditorDecoratorT, can deal with the highlighting. Thanks again! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.