如何設(shè)置Form<BgwElasticSearchFields>加載日志查看頁面時(shí)的默認(rèn)值?基本上在加載頁面之前,我需要為 和 設(shè)置默認(rèn)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;}
添加回答
舉報(bào)
0/150
提交
取消