Hi all!
I've just started using the RequestFactory and Editor duo, and it's really
great, but I have a little problem/question:
I've the following ProgramProxy:
@ProxyFor(Program.class)
public interface ProgramProxy extends EntityProxy {
Long getId();
String getName();
void setName(String name);
String getDescription();
void setDescription(String description);
DateIntervalProxy getOrderInterval();
EntityProxyId<ProgramProxy> stableId();
}
The orderInterval property is a transient property in my Program entity, so
I don't want to change it, but I would like to use it for displaying the
stuff.
So this is how I get my proxy instance:
requestFactory.programRequest().findProgram(place.getProgramId()).with("orderInterval").fire(new
Receiver<ProgramProxy>() {
@Override
public void onSuccess(ProgramProxy response) {
ProgramRequest req = requestFactory.programRequest();
req.persist().using(response);
driver.edit(program, req);
// user is interacting with the UI, and when a button is clicked
(using @UiHandler) the following chunk of code is invoked:
driver.flush().fire(new Receiver<Void>() {
@Override
public void onSuccess(Void response) {
}
});
}
});
It's almost working, but it seems that driver thinks that orderInterval
property is modified, because this is in my request payload:
{"I":[{"O":"hu.sch.kfc.client.request.ProgramRequest::persist","P":[{"S":"IjEi","T":"hu.sch.kfc.client.model.ProgramProxy"}]}],"O":[{"O":"UPDATE","S":"IjEi","T":"hu.sch.kfc.client.model.ProgramProxy","V":"Mw==","P":{"name":"Yuppi!"}},{"O":"
*PERSIST*","R":"1","C":1,"T":"hu.sch.kfc.client.model.DateIntervalProxy","P":{"isEnded":true,"interval":"2011.
01. 15. 23:01-23:40"}}]}
As you can see my orderInterval property is marked for persist, but it's not
modified (I didn't make a property for orderInterval in my
Editor<ProgramProxy> implementation, because I don't want to be edited, so
it's unlikely that it got modified -- the values in the payload are the same
which were retrieved from the server). If I remove .with("orderInterval")it
works like a charm, but my ProgramProxy instance is used in a display view
aswell, where orderInterval information is needed, but not for the editor
view. And if I don't have to I don't want to make an other request to get an
other ProgramProxy instance without the orderInterval property.
Is there a solution for my problem? I guess it's kinda usual thing having a
proxy instance with a lot of properties but wanting to edit only a
subselection of them. Thanks for any advice!
P.S.: If you need any other information to get this solved I can provide it.
--
Regards,
Bálint Kriván
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.