How to use YUI calendar in Java Wicket?

My question is not so difficult, I think. But this does not change the fact that I don’t know how to do it :) Anyway, how can I use the yui calendar object on my wicket page? I tried some codes in java codes, but I got some errors, so I need your precious help. Thank.

+5
source share
1 answer

It is so simple:

...
import org.apache.wicket.extensions.markup.html.form.DateTextField;
import org.apache.wicket.extensions.yui.calendar.DatePicker;
...
DateTextField df = new DateTextField('wicketID', dateModel, "yy.DD.mm");
df.add(new DatePicker());
form.add(df);

Basically, you create a normal DateTextField and add a YUI Picker to it. that's all.

to use

Edit: answer questions in the comments:

user500129: maven ? . , yoi -. maven:

<dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket-extensions</artifactId>
        <version>${wicket.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

maven, maven, wicket.14.14 : http://mvnrepository.com/artifact/org.apache.wicket/wicket-datetime/1.4.14

,

+8

All Articles