【发布时间】:2011-11-28 14:24:41
【问题描述】:
我正在使用 Wicket 的 DateTimeField 组件,但我很难对其应用任何样式。 HTML sn-p 是这样的:
<span id="creationDate" wicket:id="creationDate" />
伴随的Java是:
add(new DateTimeField("creationDate", new PropertyModel<Date>(this, "creationDate")));
哪个有效,但产生了这个(我已经整理好了):
<span id="creationDate" wicket:id="creationDate">
<wicket:panel xmlns:wicket="http://wicket.apache.org">
<span style="white-space: nowrap;">
<input type="text" wicket:id="date" size="12" value="28/11/11" name="creationDate:date" id="date1f"/>
<span class="yui-skin-sam">
<span style="display:none;position:absolute;z-index: 99999;" id="date1fDp"></span>
<img style="cursor: pointer; border: none;" id="date1fIcon" src="wicket/resource/org.apache.wicket.extensions.yui.calendar.DatePicker/icon1-ver-1322148000242.gif" alt="" title=""/>
</span>
<input type="text" wicket:id="hours" size="2" value="14" name="creationDate:hours"/>
<span wicket:id="hoursSeparator"> :</span>
<input type="text" wicket:id="minutes" size="2" value="17" name="creationDate:minutes"/>
</span>
我希望做的是单独获取组件,然后向它们添加style 或class 属性。有什么办法可以做到吗?
【问题讨论】: