Is it possible to disable dates in Wicket Date Picker ?
Hi All, Is it possible to programatically disable dates that have passed in wicket's date picker. for exampleI want to disable all the dates before today's day. Can someone please give an example? Thanks, ~ R -- View this message in context: http://www.nabble.com/Is-it-possible-to-disable-dates-in-Wicket-Date-Picker---tp16807706p16807706.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is it possible to disable dates in Wicket Date Picker ?
public class MyDatePicker extends DatePicker { private static final long serialVersionUID = 1L; private static final SimpleDateFormat format = new SimpleDateFormat(MM/dd/); @SuppressWarnings(unchecked) @Override protected void configure(Map widgetProperties) { super.configure(widgetProperties); // set minimal date Date minDate = getMinDate(); widgetProperties.put(mindate, format.format(minDate)); // set maximal date Date maxDate = getMaxDate(); widgetProperties.put(maxdate, format.format(maxDate)); } } Gerolf On Mon, Apr 21, 2008 at 3:02 PM, nanotech [EMAIL PROTECTED] wrote: Hi All, Is it possible to programatically disable dates that have passed in wicket's date picker. for exampleI want to disable all the dates before today's day. Can someone please give an example? Thanks, ~ R -- View this message in context: http://www.nabble.com/Is-it-possible-to-disable-dates-in-Wicket-Date-Picker---tp16807706p16807706.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is it possible to disable dates in Wicket Date Picker ?
On Mon, Apr 21, 2008 at 6:07 AM, Gerolf Seitz [EMAIL PROTECTED] wrote: public class MyDatePicker extends DatePicker { ... private static final SimpleDateFormat format = new SimpleDateFormat(MM/dd/); Maybe this was just quick example code but DateFormat's aren't thread safe. From the javadoc: Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally. Just a heads-up, Enrique - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]