GWT 2.1 and the editor mechanism, how to?
I'm very confused about the new editor mecanism with GWT 开发者_StackOverflow2.1.
I can't understand how to provide errors with a simple TextBox.
For example I want a TextBox where text size is greater than 6 (for a password).
How can I simply provide a delegate to this textbox to handle this verification and use this textbox in the editor mecanism ?
Moreover, I don't understand differences between editor adapters and editor subtypes. How should I use these two features to create my own editor widget ?
official documentation is here: http://code.google.com/intl/fr-FR/webtoolkit/doc/latest/DevGuideUiEditors.html But it's not very clear.
There's a sample widget in DynaTableRf that implements a ZIP+4 input box as a subclass of ValueBox. A custom Parser
is used to provide the input validation. The ValueBoxEditor adapter is used to transform the ValueBoxBase.getValueOrThrow()
into an EditorError
.
An "adapter" contains a reusable behavior that isn't tied to editing a specific kind of data. For example, the OptionalFieldEditor and the ListEditor don't really care about the T
parameterization. An Editor subtype is primarily concerned with displaying an instance of the T
type and may or may not embed a complex behavior.
精彩评论