Reputation: 1253
I am using DatePicker in java wicket like this,
DateTextField txtInvoiceDate=new DateTextField("txtInvoiceDate",new PropertyModel<Date>(objmodel, "txtInvoiceDate"),new PatternDateConverter("dd/MM/yyyy", true));
txtInvoiceDate.add(new DatePicker());
add(txtInvoiceDate);
It's shows only month increment option but I want year increment option also.
so please give me any kind of advise or guideline.
Upvotes: 1
Views: 2652
Reputation: 1676
I've yet to discover a built in functionality for incrementing the year, but there is a pretty easy way to enable setting the year more easily. Just override enableMonthYearSelection.
DateTextField txtInvoiceDate=new DateTextField("txtInvoiceDate",new PropertyModel<Date>(objmodel, "txtInvoiceDate"),new PatternDateConverter("dd/MM/yyyy", true));
DatePicker picker = new DatePicker(){
@Override
protected boolean enableMonthYearSelection() {
return true;
}
};
txtInvoiceDate.add(new DatePicker());
add(txtInvoiceDate);
Upvotes: 1