[ 
https://issues.apache.org/jira/browse/TAP5-2211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13808518#comment-13808518
 ] 

Barry Books commented on TAP5-2211:
-----------------------------------

I don't think it's possible to build a datepicker component that uses the 
jQuery datapicker and is compatible with the current Tapestry datepicker. The 
current datepicker makes a call back to the java side to validate the date 
while the jQuery datepicker does this on the client side. The  current 
datepicker takes a DateFormat as a parameter and this causes at least two 
problems. First is DateFormat does not have a method to get the format string 
and the second is even if it did the jQuery datapicker does not use the same 
format as Java. 

Given that what's the next step? While it seems simple to build a datepicker 
the reality is it's complicated and even more so if you include localization. 
How do you get the localized date format string for both Java and jQuery 
datepicker? If you swap the jQuery datepicker for another one should it still 
work? From what I can tell different javascript datapickers have different date 
formats. 

Should it support input type='date' and work? This introduces other issues 
since it does not appear the date format is specified by the W3.

IMHO the correct way to implement this is with textField and a mixin where the 
mixin provides the Javascript. The one thing that keeps this from really 
working is the mixin cannot set the translator in the textfield because it has 
a default value which makes it read only. If you could set the translator then 
you could do something like

<t:textfield t:mixins='jQueryDatePicker' data-date-format='YYYY-MM-DD' 
value='date'/>

and make it work. I would be a big fan of allowing a mixin to overwrite a 
default value in a component



> Replace DatePicker with JQueryUI DatePicker
> -------------------------------------------
>
>                 Key: TAP5-2211
>                 URL: https://issues.apache.org/jira/browse/TAP5-2211
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.4
>            Reporter: Lenny Primak
>              Labels: datefield, datepicker
>
> The current 3rd party datepicker used by Tapestry is very old,
> and isn't very good.  It's time to update it to one of
> the better currently-available datepickers.
> There are about 15 unresolved issues opened against Datepicker that can all 
> be solved by just replacing it.
> I suggest JQueryUI datepicker (if JQuery is included as the default stack)
> The current datepicker can be left alone is prototype is chosen.
> By default, JQueryUI datepicker should be used with the button-to-activate 
> option so that it looks similar to the current datepicker.
> It should also work properly in BeanEditor and friends and even look good 
> with form-horizontal version of BeanEditor
>  



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to