BootstrapDatePicker extends WebMarkupContainer implements IGenericComponent<Date, TextField<Date>> { public DateTextField getDateTextField(){ DateTextField component = visitChildren(DateTextField.class, new IVisitor<DateTextField, DateTextField>() { @Override public void component(DateTextField arg0, IVisit<DateTextField> arg1) { arg1.stop(arg0); } }); if (component == null) throw new WicketRuntimeException("BootstrapDatepicker didn't have any DateTextField child!"); return component; } BootstrapDatePicker(String id); DateTextField getDateTextField(); Collection<SpecialDate> getSpecialDates(); @Override IModel<Date> getModel(); @Override TextField<Date> setModel(IModel<Date> model); @Override Date getModelObject(); @Override TextField<Date> setModelObject(Date object);  }
@Test public void testDatepickerLifecycle() { TestBootstrapDatePicker picker = new TestBootstrapDatePicker("picker"); startTest(picker); getTester().assertComponent(picker.getPageRelativePath(), TestBootstrapDatePicker.class); getTester().assertComponent(picker.getInnerField().getPageRelativePath(), DateTextField.class); assertEquals(picker.getInnerField(), picker.getDateTextField()); }