如何设置Form<BgwElasticSearchFields>加载日志查看页面时的默认值?基本上在加载页面之前,我需要为 和 设置默认Bic值dtTo。dtFrom我试过了,setDefaultModel但我不太明白。有什么帮助吗?谢谢!@Overrideprotected 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;}
添加回答
举报
0/150
提交
取消