Hi,

We're experimenting with editors (actually, way more than that, with more 
than 80 reusable editors and 60 views that are editors themselves and make 
use of an editor driver) and we have an issue with OptionalFieldEditor: the 
"wrapped" editor isn't populated.

I can't for the life me find a significant difference between our use of 
OptionalFieldEditor and the DynaTableRf sample. The one big difference is 
that we use it in a "decorator" class (similar to ValueEditorDecorator, the 
"child editor" is then automatically wrapped in an OptionalFieldEditor 
within the @UiChild method) that happens to be parameterized:
  public class OptionalEntityEditor<T extends AbstractEntity, E extends 
AbstractEntityEditor<T>> extends Composite
    implements IsEditor<OptionalFieldEditor<T, E>> {

   ...

   private OptionalFieldEditor<T, E> optionalEditor;

   public OptionalFieldEditor<T, E> asEditor() { return optionalEditor; }

    @UiChild(limit=1, tagname="editor")
    public void setEditor(E editor) {
       // add the editor to a container, then:
       this.optionalEditor = OptionalFieldEditor.of(editor);
    }
  }

It is then used in an editor as:
  @UiField
  OptionalEntityEditor<MyEntity, MyEntityEditor> foo;

What's weird: I saw that OptionalFieldEditor implements LeafValueEditor so I 
though it might be the reason. We copied the class and removed that 
inheritance, and now it works.

Can you shed some light on this?

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to