In the FormInput example, we build a subclass of
wicket.markup.html.form.Form to contain the date inputbox and
DatePicker.  For this input, the HTML inside the form is:

<label wicket:id="dateLabel" for="dateProperty">Date</label>
<input wicket:id="dateProperty" id="dateProperty" type="text"
size="40"/>
<span wicket:id="datePicker"></span>

On the java side, adding the DatePicker to the Form subclass is:

WebMarkupContainer dateLabel = new WebMarkupContainer("dateLabel");
add(dateLabel);
TextField datePropertyTextField = new TextField("dateProperty",
Date.class);
add(datePropertyTextField);
add(new DatePicker("datePicker", dateLabel, datePropertyTextField));

Questions:
(1) What is the significance of the <label>'s "for='dateProperty'"
attribute, and the passing of the dateLabel to the DatePicker's
constructor?  Is this to prevent the pop-up from covering the label?

(2) Why to we make dateLabel a WebMarkupContainer, rather than an
ordinary wicket.markup.html.basic.Label ?


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to