Hello,
We're having a problem using the request factory in GWT 2.5 RC1. When calling rejectBankCheck() on the activity, it happens that there are bean validation errors. The service method corresponding to this request call is not invoked. By correcting the errors on the UI and clicking on a button, rejectBankCheck() is called again. This time, the receiver gets onSuccess(). Everything looks fine, but I can see that both, onSuccess() and the service method corresponding to rejectBankCheck(), are invoked twice!
public void rejectBankCheck(String remarks) {
request.rejectBankCheck(entity, remarks)
.fire(new Receiver<ProtocolProxy>() {
@Override
public void onSuccess(ProtocolProxy response) {
display.onRejectSuccess();
}
@Override
public void onConstraintViolation(Set<ConstraintViolation<?>> violations) {
display.setConstraintViolations(violations);
}
});
}
My first intention was to split this in two steps:
- initialize the receiver when the activity starts
- when the user clicks on the button, just call fire() on the request context
This isn't possible, because the parameter remarks of the method is a user input and can change between the two invocations. So I have to call request.rejectBankCheck(entity, remarks) every time the user clicks.
Here are my questions:
- Is this a bug or a feature of the request factory? At the moment, I cannot see when this behaviour would be necessary or of any help.
Not a bug.