3

I'm very confused about the new editor mecanism with GWT 2.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.

antony.trupe
  • 10,640
  • 10
  • 57
  • 84
Jerome Cance
  • 8,103
  • 12
  • 53
  • 106

1 Answers1

1

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.

BobV
  • 4,143
  • 1
  • 18
  • 27