I am trying to update the database once I have changed the RichTextBox
and have exited the RichTextBox
(i.e., I do not want to force the user to press an "Update button"). However, my code throws the exception The method addValueChangeHandler(new ValueChangeHandler<String>(){}) is undefined for the type RichTextArea
on the first line.
textBoxExistingDescription.addValueChangeHandler(new ValueChangeHandler<String>() {
public void onValueChange(ValueChangeEvent<String> event) {
//If a record for this Youth Member specific detail line exists then update it else add it.
if (ymAwardDetails.getYmsdId() != null) {
AsyncCallback<Void> callback = new YMSpecificHandler<Void>(ScoutAwardView.this);
rpc.updateYMSpecific(ymAwardDetails.getYmsdId(), ymAwardDetails.getYmsdDetail(), callback);
}else{
AsyncCallback<Void> callback = new YMSpecificHandler<Void>(ScoutAwardView.this);
rpc.addYMSpecific(youthMemberID, ymAwardDetails.getAdId(), ymAwardDetails.getYmsdDetail(), callback);
}
}
});
Is there an alternative way of doing this please?
Looking at your requirement, I think the same you can also achieve by implementing addBlurHandler()
instead of addValueChangeHandler()
.
Blur event gets fired when the component loses focus. For more info on blur event, please read this.
For info on GWT BlurEvent
, read this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With