I’m encountering an issue that is causing client side changes to be not sent when same entity proxy is sent for the second time to the server. My workflow is looking like: - load customer
- edit customer in editor
- preview customer changes
- save customer
The problem is that the request sent to the server when save operation is invoked doesn’t send any customer changes that where made in the editor. Loading our existing customercustomerRequest().findCustomerById(customerId).toReceiver(new Receiver() { public void onSuccess(CustomerProxy customerProxy) { CustomerRequest customerRequest = rf.customerRequest(); customerRequest.previewCustomer(customerProxy).toReceiver(new Receiver() { public void onSuccess(String customerPreview) {
display.renderCustomerPreview(customerPreview);
}
}); editor.edit(customerRequest, customerProxy);} }}).fire();Preview customer changes (response is a HTML generated content that is displayed in a HTML widget)@UiHandler(“previewCustomer”)public void onPreviewCustomer(ClickEvent event) { RequestContext previewCustomer = editor.flush(); previewCustomer.fire();}Save customer changes (here is the issue, the customer no longer contains changes that where set in the editor and the request that was sent to the server doesn’t contains any changed elements)@UiHandler(“saveCustomer”)public void onSaveCustomer(ClickEvent event) {CustomerRequest customerRequest = rf.customerRequest();
customerRequest.edit(customer);
customerRequest.persistCustomer(customer).toReceiver(new Receiver() {
public void onSuccess(Void void) {
}
}).fire();
}In debug I can see the changes that are in the CustomerProxy before fire() of the requestContext is invoked, but the generated JSON that is sent to the server doesn’t contains any of these changes. If I make a copy of the entity, the changes are sent, but the problem is that my CustomerProxy contains many inner object and I have to make a huge proxy copying, which is bad, cause when I add a new property to the proxy, I have to add a logic that copies it. Any idea how this issue could be resolved ?btw, The version of GWT which I’m using is GWT 2.4.0.RC1