0

I have a GWT application with Requestfactory. On the serverside I have a service returning a triple nested object. A contains a List<B> #B. Each B contains a C. When I fire my request to findAll(A).with("B","C").fire(receiver) it only returns B values. C is null. In debugging I see that up to the DAO the A object is properly set with all values. (Clientside all extend EntityProxy)

Right now I need to fire seperate requests to get C for every B selected in the list of A. Which means more back and forth...

Thanks

1 Answer 1

1

If A contains B, you need .with("B"). If A contains C, you would add "C" to that call, but since B contains C, you instead add "B.C":

findAll(A).with("B","B.C").fire(receiver)

Real world example: Person (A) has Address (C), and Person has Employer (B), and Employer also has Address (C). You were asking RequestFactory to send Person, their Employer and the Person's address, but not the Employer's Address.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the reply.
It's that situation that I have. So a company (A) has an employee (B) that lives in country (C) (C has several getters (get Name() I need)). When I already created my company I want to add an employee. Fill in it's information and use a preloaded combobox for the country (ListStore<C>()). When I save the company, I add .with("employee", "employee.country").(receiver), the returnValue contains everything of company and employee, but employee.getCountry().getName() throw nullpointer on "getCountry().getName()". When I debug the proxy is populated in the fire().
If you correctly are requesting B and B.C, but a.getB().getC() is null (so a.getB().getC().getName() has an error), then something else is wrong, probably in your Locators (or static methods that fulfill that purpose). Your question specifically asked about with("B", "C") which is wrong - if with("B", "B.C") also doesn't work, you should update your question, and include code this time.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.