Reputation: 5488
When I create a new proxy on the client, with a list of new child proxies, and persist the graph to the server, I only get back the root node. I have verified that the server is correctly saving the graph and returning the graph, but GWT fails to load these as proxies on the client.
I have the models:
class TripProxy {
List<PatronProxy> getPatrons();
void setPatrons(List<PatronProxy> patrons);
// some other fields
}
class PatronProxy {
void setName(String name);
String getName();
}
My editor creates a new trip where one or more patrons can be added to the trip. The save method looks something like:
Trip save(Trip trip);
Which simply saves what was given and returns it back. Why does the returned trip not include the Patrons that were attached? I am specifying a proper with(...) statement with my call to save. I know this because when I later edit the trip (after refreshing the browser) I am able to see the patrons.
Upvotes: 1
Views: 152
Reputation: 64541
You say you're "specifying a proper with(...) statement" but can you show it?
Because the with()
is only related to what's being returned from the server, your "I know this because ..." makes no sense: it only validates the fact that your objects have been saved, and the with() of your retrieval method is OK, not the with() of the save() method.
Your call to save()
should look like:
ctx.save(tripProxy).with("patrons").to(new Receiver<TripProxy>() { ... });
(feel free to replace to()
with fire()
if you want to fire the context right there instead of later one)
Upvotes: 1