我有gwt編輯器框架的問題。 做editorDriver.setConstraintViolations(錯誤)時,錯誤不被髮布到其使用嵌套的實體GWT編輯器框架 - 未發佈嵌套實體的約束違規
首先我有一個用戶實體領域:
public class User extends BaseEntity {
@OneToOne
@JoinColumn(nullable = false)
private Contact contact;
@NotNull(message = "username must not be null")
@Column(nullable = false)
private String username;
....
現在在我的編輯,我有領域,如
@UiField
ValidationWidgetDecorator<String> username;
@Path("contact.title")
@UiField
ValidationWidgetDecorator<String> title;
ValidatoinWidgetDecorator類與ValueBoxEditorDecorator幾乎相同
現在如果我在做
RequestContext context = editorDriver.flush();
context.fire(new Receiver<Void>() {
@Override
public void onConstraintViolation(Set<ConstraintViolation<?>> errors) {
editorDriver.setConstraintViolations(errors);
}
...
爲的userProxy約束的錯誤(例如違反了用戶名)顯示,一切運作良好,但如果違反了接觸(例如,在contact.title場)發生時,該錯誤不得到發表在錯誤容器中的showErrors(列表錯誤)是空的)
現在我真的找不到這個問題的其他人,所以我想問題是在我身邊,也許導致我的編輯器實現編輯器< UserProxy>和聯繫是一個ContactProxy?
一切似乎工作的權利
希望它足夠的代碼,否則我也會發布更多一些。
THX
錯誤列表是否包含contact.title錯誤?如果是這樣,您可以在ValidationWidgetDecorator中放置斷點來查看錯誤是如何處理的? – koma