【发布时间】:2014-12-10 12:22:16
【问题描述】:
我遇到了与 RequestFactory 和 Editors 一起使用的 GWT 客户端验证问题。
编辑代码为:
LocalityRequest localityContext = //create Request
Locality locality = //Locality Entity Proxy loaded from the server
driver.edit(locality, localityContext); //Edit the proxy
request = localityContext.updateLocality(locality);
保存代码是:
this.localityContext = (LocalityRequest) driver.flush(); //Flush the request
Set<ConstraintViolation<LocalityProxy>> violations = validator.validate(this.locality); //Local validate the object
if (!violations.isEmpty()) {
Set<ConstraintViolation<?>> sets = new HashSet<ConstraintViolation<?>>(violations);
driver.setConstraintViolations(sets);
editLocalityView.setErrors(sets); //give errors to the editors
return;
}
localityContext.fire(); //else send the request
我的问题是本地验证总是在加载的版本上验证,而不是用户编辑的版本。 我们如何才能获得请求中保存的刷新对象?
谢谢
【问题讨论】:
标签: java gwt requestfactory gwt-editors gwt-validation