How about put a try catch around the list.flush() for tracking down the offending null list.ListEditor.class {//...public void flush() {list.flush(); // <<<< try catch this for easier debugging}//...}Thoughts?
--To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/j72sBQj23r8J.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Thats a good point and as soon as I posted that I wondered that my self.The first thing I'd like to do is pause on it and see which of my list editors has a null list because the list editor wants an empty or greater list.
But pausing on every list is tiresome and would rather pause on an exception.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
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.
If Null is As Designed for the ListEditor, I suggest using an assertion to tell the user. I don't mind sending the List Editor an empty list, its when I forget to do code for that, that I try finding it. I appreciate the info about the other options. Thanks for looking at this too.I'll have to setup breakpoints on exceptions. Thanks for the tip.
--
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/-/AkMQHSRVgzEJ.