By now , as already mentioned several times , javascript support in tap 5 is not yet fully implemented. Till then , the way to go is using OutputRaw (i think.. ) for dinamic javascript and adding JS file links for static jsvascript. For dinamic javascript it will be changed probably but can't say when ;)
You can use both <span t:type="OutputRaw" ../> or <t:outputRaw .... /> starting with 5.0.3 onwards . Anyway , for what you tried to do ( linking the calendarJS.js to the page ) : i'm not sure how you did it , but it should be used PageRenderSupport : @Environmental PageRenderSupport pageRenderSuport; void beginRender(MarkupWriter writer ) { pageRenderSupport.addScriptLink(calendarJS); ............ ........... } - tap 5.0.4 - @Inject @Path("...") private Asset getCalendarJS(); - tap 5.0.3 - @Inject("...") private Asset getCalendarJS(); Cheers , Alex On 4/11/07, Daniel Drasin <[EMAIL PROTECTED]> wrote:
If i read this, you're dumping the body of the script into the page via a OutputRaw. (I can't see the actual content of the code on the java side w/o decompiling the class file, right?) I'm also thinking that this isn't quite 5.0.3 since u'r using t:type="OutputRaw" rather than the OutputRaw tag itself (new in 5.0.3). Is this really the way to do it (it seems more complicated than i would expect...) That said, my attempts haven't worked... The closest i came was using <script type="text/javascript" src="calendarJS"></script> and then injecting an asset to the right location for calendarJS on the java side. However, this doesn't get the URL to show up in the src attribute in the eventual html... Am i close - or am i all wrong? (and is the Output method above the way to go?) Dan Alexandru Dragomir <[EMAIL PROTECTED]> wrote: You might want to use this datepicker component http://code.google.com/p/tapestry5-jscalendar/ And you can also look into it for an example of how to include javascript. Cheers , Alex On 4/11/07, Daniel Drasin wrote: > > Can anyone point me to an example or how-to for including/using > javascription in T5.0.3? (like i want to drop a datepicker in...) > > Thanks in advance, > > Dan > > > Daniel Drasin > [EMAIL PROTECTED] 8612 Long Meadow Ct > (c) 614 330 7795 Columbia, MD 21045 > (c) 443 742 5738 > > --------------------------------- > 8:00? 8:25? 8:40? Find a flick in no time > with theYahoo! Search movie showtime shortcut. Daniel Drasin [EMAIL PROTECTED] 8612 Long Meadow Ct (c) 614 330 7795 Columbia, MD 21045 (c) 443 742 5738 --------------------------------- The fish are biting. Get more visitors on your site using Yahoo! Search Marketing.