Diederik,

thanks a lot for the code example. I expect it works seamlessly.

What bothered be most about handling dates is that the result of the 
DateSelector cannot be it's input - only if you put together a String and then 
parse it. That is why I have augmented the DateSelector to allow this, along 
with some other enhancements.

I have added the possibility to read the results of the posted selector back 
in. The Calendar object in the DateSelector is adjusted to the new date. It 
also provieds a method to retrieve that Calendar, so that you can do the following:

// in the Screen
DateSelector ds = new DateSelector("myDate", Calendar.getInstance(), runData);
context.put("ds", ds);

## in the template
<form action="...">$ds<input type="submit"/></form>

// in the Action (or back in the same screen)
DateSelector ds = new DateSelector("myDate", Calendar.getInstance(), runData);
Calendar result = ds.getCalendar();

This last part might look a bit confusing. The behaviout of the ctor is the 
following:

- set the internal calendar to the calendar passed
- *set the internal locale (use for month names) to runData.getLocale()
- override the fields in the calendar with submitted information, if any.

* the locale-thing is a bit pointless, as in t2 the TurbineRunDataService does 
not put locale information into runData, you would need to call a
runData.setLocale(runData.getRequest().getLocale()) handish.


The patch is at
http://nagoya.apache.org:8080/eyebrowse/ReadMsg?[EMAIL PROTECTED]&msgNo=4424

and a further description in this very thread at
http://nagoya.apache.org:8080/eyebrowse/ReadMsg?[EMAIL PROTECTED]&msgNo=3326

Cheers,
Ben

Diederik de Groot wrote:
> Hi Ben,
> 
> You could implement it as an application tool so you can use it from
> Velocity directly.
> 
> 


>> 
>> Has anyone used intake and/or the DateSelector and can provide a simple
>> example
>> of how to use them?
>> 
-- 
Benjamin Peter                                          +49-69-96244395
Application Engineer                             Moerfelder Landstr. 55
(zentropy:partners)                            60598 Frankfurt, Germany


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to