HI,
I spent a lot of time on the following issue but couldn't figure it out.
Any clue is appreciated. Thanks!
I have a working NullableStringListEditor implementation:
public class NullableStringListEditor extends Composite implements
IsEditor<OptionalFieldEditor< List<String>, ListEditor<String,
StringEditor> >> {...}
Now, I am building a NullableStringSetEditor by wrapping it. With the
following implementation, values are displayed by the wrapped editor
successfully, however any modifications(the NullableStringListEditor
supports edit/add strings) are not reflected after flush(). I am using
SimpleBeanEditorDriver. I debugged into it and it looks like the underline
values(List) in the wrappedEditor(NullableStringListEditor) have been
changed, but they are not populated to NullableStringSetEditor. Am I still
missing something?
public class NullableStringSetEditor extends Composite implements
CompositeEditor<Set<String>, List<String>, ListEditor<String,
StringEditor>>, LeafValueEditor<Set<String>> {
private final NullableStringListEditor wrappedEditor = new
NullableStringListEditor();
@Override
public void
setEditorChain(com.google.gwt.editor.client.CompositeEditor.EditorChain<List<String>,
ListEditor<String, StringEditor>> chain) {
wrappedEditor.asEditor().setEditorChain(chain);
}
@Override
public Set<String> getValue() {
List<String> list = wrappedEditor.asEditor().getValue();
return (list != null) ? new TreeSet<String>(list) : null;
}
@Override
public void setValue(Set<String> values) {
List<String> list = new ArrayList<String>();
list.addAll(values);
wrappedEditor.asEditor().setValue(list);
}
//no-op implementation for other required @Override such as flush() and
setDelegate(EditorDelegate<Set<String>> delegate)
//...
}
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/4Zas7biq27EJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.