Sorry for the misguidance there. Something like this works:

                        final DateFormat fmt = new 
SimpleDateFormat("yyyy-MM-dd");
                        final DateConverter dateConverter = new DateConverter()
                        {
                                public DateFormat getDateFormat(Locale locale)
                                {
                                        return fmt;
                                }
                        };
                        TextField datePropertyTextField = new 
TextField("dateProperty", Date.class);
                        add(datePropertyTextField);
                        DatePicker datePicker = new DatePicker("datePicker", 
dateLabel,
datePropertyTextField);
                        datePicker.setDateConverter(dateConverter);
                        add(datePicker);


though in the above example, the text field itself needs to use the
proper date format as well.

I was wrong about DatePickerSettings#setIfFormat. You don't need that.

Instead of following the above example code I gave, you'd probably be
best off to set a global date converter (explained here
http://cwiki.apache.org/WICKET/using-custom-converters.html).


Eelco

All of this is friggin' ugly anyway. You may have noticed that we are
about to remove the datepicker component from the extensions project.

On 11/10/06, Carfield Yim <[EMAIL PROTECTED]> wrote:
> > That would be:
> >
> >         /**
> >          * The format string that will be used to enter the date in the 
> > input field.
> >          * This format will be honored even if the input field is hidden. 
> > Use
> >          * Javascript notation, like '%m/%d/%Y'.
> >          */
> >         private String ifFormat = null;
> >
> > Use DatePicker#setDateConverter to align the two.
> >
> >
> I guess you mean something like
>
>             DatePicker dp = new DatePicker("birthDayPicker", dateField);
>             DateConverter dc = new DateConverter();
>             dc.setDateFormat(Locale.ENGLISH,
> DateFormat.getDateInstance(DateFormat.SHORT, Locale.ENGLISH));
>             dp.setDateConverter(dc);
>
> However, just try and no effect at al ... any problem ?
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to