EntityProxy's that contain collections are not being filled in. So
you can send up an object graph in one shot in order to save it.
Which is great.
Unfortunately, on return, the object graph only contains the root.
This is because in JsoRequestProcessor.requestedProperty, it does:
if (EntityProxy.class.isAssignableFrom(leafType)) {
return propertyContext.hasProperty(p.getName());
}
to check if child entities should be included but that's an empty set
so it always returns false
If it wasn't, we have TODO here TODO: use the properties
* that should be coming with the request.
that says this thing should eventually be able to do this but wouldn't
the safest behavior for now to include all the contents of the Entity
that are featured in EntityProxyId? I'm stuck at this point.
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
So I have a practice that has offices and each office has phones.
So if I ask for offices. It fills in the offices but the phones
inside it are not. This could get laborious if I need to do this
manually for each editing activity
Use RequestFactoryEditorDriver.getPaths();
interface MyOfficeDriver extends
RequesFactoryEditorDriver<OfficeProxy, OfficeEditor> {}
MyOfficeDriver driver = GWT.create(MyOfficeDriver.class);
driver.initialize(requestFactory, editor);
requestFactory.officeService().fetchOffice(1234).with(driver.getPaths()).to(receiver).fire();
--
Bob Vawter
Google Web Toolkit Team
Since offices is using my own composite editor, I'm going to assume
that's where the problem is
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
So my offices also have on address and it's not in the getPath() array
either. Even if it was, what's the syntax for sub path elements?
so having "offices" give me back all my offices.
but putting "offices.address", or "offices.office.address" or
"office.address" still gives me null
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
Splitting AbstractRequestContext.processReturnRecord so that it first
creates all the proxies before mutating any of them seemed to fix the
problem.
-Sam
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
public static void traverseEditor(com.*.client.ui.EditorContainer
editor, String prefix, java.util.List<String> paths) {
}
is completely empty
but in this case, EditorContainer contains OfficeEditor because it's a
composite. OfficeEditor has one AddressEditor and a
HasDataEditor<Phone>
so getPath() is currently buggy unless there's a way I can fill in my
own traverseEditor somehow
any suggestions for a work around for the moment?
So I an editor, and it has a list in it but the list doesn't contain
other EntityProxy's
The two issues still remain:
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
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
offices
office
offices.name
office.name
offices.office.name
just doesn't work.
On Mon, Oct 4, 2010 at 9:41 AM, Patrick Julien <pju...@gmail.com> wrote:
> 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.
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
You're using code generation for the other parts. What I mean by that
is that you generate the method
public static void traverseEditor(com.*.client.ui.EditorContainer
editor, String prefix, java.util.List<String> paths) {
}
and that has content that was made at compile time, not run time.
Here, the editor you're looking for is right there in CompositeEditor
CompositeEditor<T, C, E extends Editor<C>>
So whatever E is the children. Is that not suitable here also?
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
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
Bob is in transit today. We're working on a fix.
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors