> > > > On Thursday, May 17, 2012 8:47:22 PM UTC+2, Brandon Donnelson wrote: >> >> True that would fix the flush. But I'm wondering if this isn't a symptom >> of an earlier problem. I'm thinking if the list is null on instantiation >> the list backing doesn't get setup properly. So the question I would have >> is if I add an item, will the list no longer be null and it seems to me >> that it will still be null. So I think to fix the problem might be to >> instantiate the list differently as well. > > > You won't be able to add an item, as ListEditor#getList() will return > 'null' if 'null' was passed to setValue(). > > Originally, when asked about 'null', BobV said you should use an > OptionalFieldEditor in between the parent editor and the ListEditor (and > then months later he added the 'null' handling in ListEditor#setValue). In > this case, I think the OptionalFieldEditor is the way to go: if you want to > "add a value to a 'null' list", then first make it "non-null" by calling > the OptionalFieldEditor's setValue with an empty list, then add an element > to ListEditor#getList() (which will then be non-null). I suppose, as an > "optimization", you could also directly set a non-empty/populated list to > the OptionalFieldEditor. >
-- 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/-/l2o-zTa8FykJ. 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.
