My question is not so hard, i think. But it does not change the fact that i dont know how to do it :) Anyway, how can i use yui calendar object in my wicket page? i have tried some codes in java codes, but i got some errors, so i need your precious help. Thanks.
Its is as simple as this:
...
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);
Basicaly, you construct a normal DateTextField and add the YUI Picker to it. thats about all.
enjoy
Edit: to answer the questions in the comments:
user500129: are you using maven as build tool? i strongly suggest it to you. if you do, you find the yoi components in the wicket-datetime artefact. The relevant maven dependency is:
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-extensions</artifactId>
<version>${wicket.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
If you are not using maven, you can download the jar from the maven repository, for wicket.14.14 this would be the correct link: http://mvnrepository.com/artifact/org.apache.wicket/wicket-datetime/1.4.14
hope that helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With