hi,
I am trying to save a data record with dynamicForm.saveData(new SaveCallbackHandler()),
which the custom class SaveCallbackHandler implementing the DSCallback class.
At the beginning everything works fine, new data record was saved and
SaveCallbackHandler.execute() function was being called successfully.
But after I invoked dsResponse.setStatus() to FAILURE, the callback function is
not called and only show the default error dialog popped up by the RPCManager.
I have read post about setting the willHandleError to true in RPCRequest object to solve the problem.
But how i should apply that method in dynamicForm in my case? Thank you for answering!
SmartGWT version: 2.5
Firefox version: 3.6.15
I am trying to save a data record with dynamicForm.saveData(new SaveCallbackHandler()),
which the custom class SaveCallbackHandler implementing the DSCallback class.
At the beginning everything works fine, new data record was saved and
SaveCallbackHandler.execute() function was being called successfully.
But after I invoked dsResponse.setStatus() to FAILURE, the callback function is
not called and only show the default error dialog popped up by the RPCManager.
I have read post about setting the willHandleError to true in RPCRequest object to solve the problem.
But how i should apply that method in dynamicForm in my case? Thank you for answering!
Code:
DataSource dataSource = DataSource.get("Membership");
comboBoxMembershipType.setOptionDataSource(dataSource);
saveButton.addClickHandler(new ClickHandler(){
public void onClick(final ClickEvent event) {
dynamicForm.saveData(new SaveCallbackHandler());
}
});
dynamicForm.setFields(comboBoxMembershipType, saveButton);
private class SaveCallbackHandler implements DSCallback {
@Override
public void execute(final DSResponse response, final Object obj,
final DSRequest request) {
if ( response.getStatus() == STATUS.SUCCESS) {
SC.say("Save successfully");
} else {
SC.say("Failed to save");
}
}
}
SmartGWT version: 2.5
Firefox version: 3.6.15
Comment