我试图更新数据库,一旦我改变了RichTextBox
并退出了RichTextBox
(即,我不想强制用户按下“更新”按钮“)。但是,我的代码在第一行会抛出异常The method addValueChangeHandler(new ValueChangeHandler<String>(){}) is undefined for the type RichTextArea
。不允许GWT addValueChangeHandler到RichTextBox
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);
}
}
});
有没有其他方法可以做到这一点?
我已经实施了@RAS(谢谢RAS)的解决方案,经过大量测试,这对我没有计时器的作品。无论如何感谢波马。 – Glyn