Refactored date picker from component to behavior

9 02 2007

Igor had a good idea, which was to implement the date picker as a behavior rather than a component. This makes it a lot nicer to use. Instead of instantiating it with the target field:

add(new DatePicker("datePicker", dateTextField);

and having to have it defined in your markup:

<div wicket:id="datePicker" />

you can now simply do:

dateTextField.add(new DatePicker());

Thanks for the idea Igor! You can find this behavior in the wicket-datetime project. Oh, and though the date picker doesn’t need the AbstractCalendar component anymore, I’ll keep it around in case people want to create components based on the YUI Calendar widget.


Actions

Information

5 responses

9 03 2007
saki

That’s great idea. Just one note – would be very nice if you vould create some wicket page with list of such changes / improvements in framework, so it can be easily found and followed.

9 03 2007
saki

Sorry – I’ve meant wiki page (somehow I see wicket everywhere …)

9 03 2007
Eelco Hillenius

I will, once we have a release for that project.

8 05 2008
Colin Rogers

Hi there, I’ve been attempting to use the new DatePicker component. While our designers have taken the default CSS styles, and then modified them to our look and feel, I’m finding it difficult to actually apply the CSS styles. Because the JS and CSS are loaded dynamically by the behaviour, they override any styles included on the page. Could you offer some advice on how to solve this issue?

8 05 2008
Eelco Hillenius

Hi Colin,

Such questions go best to the mailing list. Gerolf has been maintaining this project the last few months, and other people might have an opinion about this as well.

Leave a comment