You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Foror <fo...@mail.ru> on 2008/01/04 06:27:53 UTC

T5: jscalendar and prototype

jscalendar requires prototype and scriptaculo libs? If is not requires,
why they appear in a web-page?

public class MyPage {

    @Inject
    @Path("${tapestry.jscalendar}/skins/aqua/theme.css")
    private Asset themeStylesheet;

    @Inject
    @Path("${tapestry.jscalendar}/calendar_stripped.js")
    private Asset mainScript;

    @Inject
    @Path("${tapestry.jscalendar}/lang/calendar-ru.js")
    private Asset localizationScript;

    @Inject
    @Path("${tapestry.jscalendar}/calendar-setup_stripped.js")
    private Asset setupScript;
    
    @Inject
    @Path("context:js/history.js")
    private Asset historyScript;

    ...
    
    void beginRender(MarkupWriter writer) {
        support.addStylesheetLink(themeStylesheet, null);
        support.addScriptLink(mainScript, localizationScript, setupScript);
    }


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: jscalendar and prototype

Posted by Chris Lewis <ch...@bellsouth.net>.
Firstly, you can slim your code by using annotations to handle adding 
your css and js - see docs for @IncludeJavaScriptLibrary and 
@IncludeStylesheet 
(http://tapestry.apache.org/tapestry5/tapestry-core/guide/ajax.html and 
http://tapestry.apache.org/tapestry5/tapestry-core/guide/css.html).

Now I don't know if jscalendar needs prototype or not, but tapestry's 
current behavior is to assume that anytime you inject a script, or 
otherwise add one via PageRenderSupport (which is what backs the 
annotated version), you also want prototype and pals. Therefore, it adds 
them for you. This is nice for me because every time I've used these 
annotations I happened to need prototype as well, but there is concern 
about this autonomous behavior as well as the tight coupling to prototype.

chris

Foror wrote:
> jscalendar requires prototype and scriptaculo libs? If is not requires,
> why they appear in a web-page?
>
> public class MyPage {
>
>     @Inject
>     @Path("${tapestry.jscalendar}/skins/aqua/theme.css")
>     private Asset themeStylesheet;
>
>     @Inject
>     @Path("${tapestry.jscalendar}/calendar_stripped.js")
>     private Asset mainScript;
>
>     @Inject
>     @Path("${tapestry.jscalendar}/lang/calendar-ru.js")
>     private Asset localizationScript;
>
>     @Inject
>     @Path("${tapestry.jscalendar}/calendar-setup_stripped.js")
>     private Asset setupScript;
>     
>     @Inject
>     @Path("context:js/history.js")
>     private Asset historyScript;
>
>     ...
>     
>     void beginRender(MarkupWriter writer) {
>         support.addStylesheetLink(themeStylesheet, null);
>         support.addScriptLink(mainScript, localizationScript, setupScript);
>     }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org