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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




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

Reply via email to