如何在 Java Wicket 中使用 YUI 日历?

发布于 2024-10-08 01:42:44 字数 110 浏览 0 评论 0原文

我想我的问题并不难。但这并没有改变我不知道该怎么做的事实:)无论如何,我如何在我的检票页面中使用 yui 日历对象?我已经尝试了java代码中的一些代码,但是我遇到了一些错误,所以我需要你的宝贵帮助。谢谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

对不⑦ 2024-10-15 01:42:44

它就像这样简单:

...
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);

基本上,您构建一个普通的 DateTextField 并向其中添加 YUI Picker。这就是全部。

享受

编辑:回答评论中的问题:

user500129:您是否使用 maven 作为构建工具?我强烈推荐给你。如果这样做,您会在 wicket-datetime 工件中找到 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存储库下载jar,对于wicket.14.14,这将是正确的链接:http://mvnrepository.com/artifact/org.apache.wicket/wicket-datetime/1.4.14

希望有所帮助

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文