如何设置Form<BgwElasticSearchFields>加载日志查看页面时的默认值?基本上在加载页面之前,我需要为 和 设置默认Bic值dtTo。dtFrom我试过了,setDefaultModel但我不太明白。有什么帮助吗?谢谢!
@Override
protected Form<ElasticSearchFields> getSearchForm() {
Form<ElasticSearchFields> logSearchForm = new Form<ElasticSearchFields>("searchFields",
new CompoundPropertyModel<>(searchFields)) {
logSearchForm.add(new DateTextField("dtTo", new PropertyModel<>(searchFields, "dtTo"), "yyyy-MM-dd").setRequired(true));
logSearchForm.add(new DateTextField("dtFrom", new PropertyModel<>(searchFields, "dtFrom"), "yyyy-MM-dd").setRequired(true));
List<String> bics = Arrays.stream(Bic.values())
.map(Bic::name)
.collect(Collectors.toList());
logSearchForm.add(new DropDownChoice<>(
"bic",
new PropertyModel<>(searchFields, "bic"),
bics).setNullValid(true).setRequired(false));
return logSearchForm;
}
小怪兽爱吃肉
慕雪6442864
相关分类