Jeff
unread,Sep 4, 2012, 3:08:16 AM9/4/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com, Jiahu Deng
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)
//...
}