If anyone is hurting with this, it's because all values need to be set
to non null before they can be part of the editor framework, unless
you're using a composite

If you're using a composite, the idea is to set a non null container
value like so:


                domainHandle = requests.create(DomainHandle.class);
                r = requests.domainRequest().persist(getSessionId(), 
domainHandle);
                driver = GWT.create(Driver.class);
                driver.initialize(requests, view);
                domainHandle = r.edit(domainHandle);
                domainHandle.setOffices(new HashSet<OfficeHandle>()); // This
creates the empty set
                
domainHandle.setSecuritySettings(requests.create(SecuritySettingsHandle.class));

Then your composite will get called via the setValue method, this is
the set or list you newed up in your handle if you setup is OK

        @Override
        public void setValue(final C value) {
                this.collection = value;
        }

Then, when you're ready to flush, flush gets called, you just insert
whatever value you need in your collection

@Override
        public void flush() {
                for (int i = 0, j = editors.size(); i < j; i++) {
                        E subEditor = editors.get(i);
                        T value = chain.getValue(subEditor);

                        if (backing.get(i) != value)
                                backing.set(i, value);
                        
                        collection.add(value);
                }
        }




On Sat, Oct 2, 2010 at 12:02 PM, Patrick Julien <pjul...@gmail.com> wrote:
> Even if I put in things manually, let's say
>
> EditorContainer<OfficeHandle, HashSet<OfficeHandle>, OfficeEditor> offices;
>
> which is a CompositeEditor
>
> public class EditorContainer<T, C extends Collection<T>, E extends
> Editor<T>> extends FlowPanel implements CompositeEditor<C, T, E>
>
> I can set new up and place the HashSet<> manually inside the parent of
> the office because it will get squashed the next time the editor is
> flushed since EditorContainer gets setValue called with null
>
>
>
> On Sat, Oct 2, 2010 at 11:00 AM, Patrick Julien <pjul...@gmail.com> wrote:
>> But I am getting null for my child objects, that is the question, must
>> I make sure all child entities are created before given them to the
>> root editor?  That doesn't make much sense to me
>>
>>
>> On Sat, Oct 2, 2010 at 10:38 AM, Thomas Broyer <t.bro...@gmail.com> wrote:
>>>
>>> On Oct 2, 4:15 pm, Patrick Julien <pjul...@gmail.com> wrote:
>>>> What does it take exactly?
>>>>
>>>> If I look at dynatblerf sample, there is an AddressEditor in a
>>>> PersonEditor and it just seems to work.
>>>>
>>>> I have the same thing, I have a SecuritySettingsEditor inside another
>>>> Editor and when I get the EntityProxy back, the security settings
>>>> field is always null.  What does it take for the editor to generate
>>>> the value?
>>>
>>> The DynatableRF sample's Person never has a 'null' Address; it might
>>> be an "empty" Address instance, but never the null value. It might be
>>> the reason.
>>>
>>> --
>>> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>>
>

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

Reply via email to