Skip navigation

DatePicker

A datepicker for @twitter bootstrap forked from Stefan Petre's (of eyecon.ro), improvements by @eternicode

Example

DOC.

//HTML
<form><input wicket:id="default"></form>
//JAVA
add(new DateTextField("default"));

Example

DOC.

//HTML
<form><input wicket:id="birthday"></form>
//JAVA
add(new DateTextField("birthday",
		 new DateTextFieldConfig()
			.autoClose(true)
			.withView(DateTextFieldConfig.View.Decade)
			.showTodayButton(true)
			.withStartDate(new DateTime().withYear(1900));

Example

DOC.

//HTML
<form><input wicket:id="language"></form>
//JAVA
add(new DateTextField("language",
		 new DateTextFieldConfig()
			.autoClose(true)
			.withLanguage("es")
			.showTodayButton(true);

Example

DOC.

Open Modal Dialog

Example

DOC.

Selected date: --NO SELECTED DATE--

//HTML
<form><input wicket:id="ajax-default"></form>
 <p>
   Selected date: <span wicket:id="selectedDate"></span>
 </p>
//JAVA
add(new DateTextField("ajax-default").addAjaxEvent(DateTextField.Event.changeDate, new DateTextField.IAjaxEventHandler() {
            @Override
            public void onAjaxEvent(AjaxRequestTarget target, Date date, DateTextField.Event event) {
                DatePickerPage.this.date = date;
                target.add(selectedDate);
            }
        }));