OK . It seems I figure it out ...

    add(yangDayChoice = new DropDownChoice<>(
      "day",
      new PropertyModel<Integer>(localDate, "dayOfMonth") {
        @Override
        public void setObject(Integer value) {
          LocalDate ld = getModelObject();
          LocalDate ld2 = LocalDate.of(ld.getYear() , ld.getMonthValue() ,
value);
          DatePanel.this.setModelObject(ld2);
        }
      },
      IntStream.range(1, 32).boxed().collect(Collectors.toList()))
    );



2015-06-08 15:38 GMT+08:00 smallufo <[email protected]>:

>
> 2015-06-08 14:36 GMT+08:00 Martin Grigorov <[email protected]>:
>
>>
>> MyFormComponentPanel.this.setModelObject(getModelObject().withDayOfMonth(DayOfMonth));
>>
>
> Excuse me
> Where should I put this code to ?
>
> DatePanel's constructor ?
> or override DropDownChoice's some method ?
> or DatePanel's convertInput() ?
> or somewhere ?
>
>
> Thanks.
>
>

Reply via email to