先决条件:
设置:
@Property
private Calendar cal;
public Calendar getCal() {
return ORMapper.getProperty(this, "cal");
}
功能设置:
p:commandButton,在其操作期间执行代码(导致错误),然后打开一个包含以下内容的对话框
<p:calendar id="cal" value="#{bean.model.cal}" />
执行:
在调用命令按钮(操作)的应用程序期间,我们使用
component.visitTree(
VisitContext.createVisitContext(
FacesContext.getCurrentInstance(),
null,
Collections.singleton(VisitHint.SKIP_UNRENDERED)),
(context, component) -> {
...
return VisitResult.ACCEPT;
}
);
在执行树之前
model.cal =值
model.getCal()=值
错误行为:
树执行后
model.cal = null
model.getCal()=值
然后在验证模型时会导致错误,例如属性上的@NotNull(不是getter)
注意: