Hi there Ben, Thanks for the suggestions. I'll have to look into that patch and see how that could work for my applicationTool. I like to implement everything in applicationTools so other people can do the velocity stuff. I just want to provide them with the corretc data. I really do not want to be programming java classes for all the pages they can come up with only to provide them with a dateSelector. I was thinking of implementing locals in my application as well, but this have to figure out where to begin updating :-)
Thanks for the comment, Diederik > -----Original Message----- > From: Ben Peter [mailto:[EMAIL PROTECTED]] > Sent: zondag 14 april 2002 3:02 > To: Turbine Users List > Subject: Re: Examples of hadling date input > > > 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?listName=turbine-d [EMAIL PROTECTED]&msgNo=4424 and a further description in this very thread at http://nagoya.apache.org:8080/eyebrowse/ReadMsg?listName=turbine-user@jakart a.apache.org&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]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
