I was thinking in another direction actually:
We could have something like a 'header contributor'. That could be an interface like:
interface HtmlPageHeaderContributor
{
String getHeaderContribution();
}When rendering, the render process could stop at the header section (if there isn't one, create it?), and visit all children of type HtmlPageHeaderContributor. Then, the results of getHeaderContribution of the children could be pasted in the header section.
I kind of did this for my current project, where I have components (panels) that use their own CSS files. The difference is that I just created it as a component (a ListView combined with a ComponentTagAttributeModifier); it doesn't touch the rendering process directly.
Though my approach is quite crude, it can be extremely usefull to be able to do this. No checking on the actual output; that's all the developer's responsibility. We might want to have that checking later, though that could also be very expensive and error prone. And as a developer who wants to use it, I can come up with enough tricks to keep my Javascript methods etc. unique.
Eelco
Juergen Donnerstag wrote:
Without havng thought about how to implement it, what are the requirements for the javascript / css support.
a) each html component should support it b) Javascript / css should be part of the components markup and enclosed by some tags (e.g. <wicket:javascript>) which identifies the region c) Such region should be rendered only once per page, no matter how many components of the same type are on the same page. d) we need to support for the page html to determine where to insert the javascript region. We must support multiple markers (add to <head> or <body> e.g.) what else?
problems I see without having deeply thought about. We are currently scanning the markup and if required we read a sub-component markup and include it. This approach might not work out for javascript / css regions due to the requirements mentioned above.
Juergen
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
