OK, this also works for me, where it breaks down is more collections

So I go back to practice, offices and phones

class Practice { private List<Office> offices; }
class Office { private List<Phone> phones; }

practive is unique and has a list of offices

What I get back has all the practice seeded.  All the offices are
seeded and it has all its values but phones is null.

If I add "offices.phones", it works, I get a non null list of phone
handles but the values on the handles are not set.

Now I manually add, in addition to "offices.phones",
"offices.phones.number" the value of number is still null

I believe this respect the syntax you outlined here.  I can confirm on
the server in json request processor on the server that the phone
entities are there and have values when processed but the
subProperties map in RequestProperty is null so it returns false when
it tests if it should include these values or not



On Mon, Oct 4, 2010 at 5:46 PM, Ray Cromwell <cromwell...@gmail.com> wrote:
>
> The following test case passes:
> public void testCollectionSubProperties() {
>     delayTestFinish(DELAY_TEST_FINISH);
>     simpleFooRequest().getSimpleFooWithSubPropertyCollection().with(
>         "selfOneToManyField.fooField").fire(new Receiver<SimpleFooProxy>() {
>      �...@override
>       public void onSuccess(SimpleFooProxy response) {
>         assertEquals("I'm Here",
>
>  response.getSelfOneToManyField().get(0).getFooField().getUserName());
>       }
>     });
>   }
> on the server:
>  public static SimpleFoo getSimpleFooWithSubPropertyCollection() {
>     SimpleFoo foo = new SimpleFoo();
>     SimpleFoo subFoo = new SimpleFoo();
>     SimpleFoo subSubFoo = new SimpleFoo();
>     subFoo.setFooField(subSubFoo);
>     subSubFoo.setUserName("I'm here");
>     subSubFoo.persist();
>     subFoo.persist();
>     foo.persist();
>     foo.setSelfOneToManyField(Arrays.asList(subFoo));
>     return foo;
>   }
> If you have a class that looks like this:
> public class Company {
>    List<Office> offices;
> }
> public class Office {
>   Employee siteManager;
> }
> Then the correct way to query for siteManager is:
> with("offices.siteManager")
> With is a nothing more than a filter on names, it doesn't care if something
> is a collection, or an entity, just whether or not the name matches.
> -Ray
> On Mon, Oct 4, 2010 at 2:32 PM, BobV <b...@google.com> wrote:
>>
>> Your feedback has been very helpful in finding out where the weak
>> points in our APIs and implementations are.
>>
>> > driver.getPath() isn't able to completely scan an editor tree when it
>> > contains CompositeEditor's that, they themselves, have more editors in
>> > their hierarchy
>>
>> I'm thinking about how to solve this one, since an uninitialized
>> CompositeEditor won't have any sub-editors to query.
>>
>> > It's not possible to request sub-properties when using collections
>> > manually.  It just doesn't work.  The example I gave were trying to
>> > get the name of an office inside a collection, putting
>>
>> RayC is looking at this.
>>
>> --
>> Bob Vawter
>> Google Web Toolkit Team
>>
>> --
>> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors

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

Reply via email to