click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Malcolm Edgar (JIRA)" <>
Subject [JIRA] Commented: (CLK-501) Add first class support for HTML Head resources such as Javascript and CSS
Date Tue, 10 Mar 2009 22:29:10 GMT


Malcolm Edgar commented on CLK-501:

I have this feeling, that what I am advocating is something you proposed earlier.

I haven't thought through the integration.  Off the top of my head I would imagine, controls
would have the same methods:

List<Element> getHeadElements() 

List<Element> getJsElements() 

The ClickServlet processes the page controls calling their onRender() methods.  The Container
controls then iterate through their children doing the same.  At this point it is up to the
individual control to add its Elements (Head, JS) to the parent Page's corresponding HeadElements
or JsElements. 

These page elements would automatically be added to the Velocity context / JSP request attributes
before rendering.

We could introduce some sort of adaptor mechanism to support depreciated getHtmlImports()

regards Malcolm Edgar

> Add first class support for HTML Head resources such as Javascript and CSS
> --------------------------------------------------------------------------
>                 Key: CLK-501
>                 URL:
>             Project: Click
>          Issue Type: New Feature
>          Components: core
>            Reporter: Bob Schellink
>            Assignee: Bob Schellink
>             Fix For: 2.1.0
> Currently Click supports HTML imports by overriding the method #getHtmlImports. 
> This method is string based which makes it difficult to support advanced features such
as templating, conditional imports, resource versioning etc.
> This feature request proposes to introduce first class HTML header resource classes including
Javascript, JavascriptImport, CssImport and Css.
> Further a new method should be added to the Control interface: 'public List getHtmlHeaders'
which returns a list of the Page or Control's HTML HEAD entries.
> This makes it possible to modify the Javascript and CSS imports without overriding a

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message