Hi,

Your worker should use AssetSource and RenderSupport to automatically add
the js file if it exists, have a look at IncludeJavaScriptLibraryWorker
source file to see an exemple of script injection.
BTW in my experience, the multiplication of JS/CSS files is not really
appreciated by IE, so if you decide to work this way i advise you to also
turn on (default) combine-scripts feature.

Regards,
Christophe Cordenier

Developer of wooki @wookicentral.com

2010/2/5 Inge Solvoll <inge.tapes...@gmail.com>

> Hi!
>
> I find myself repeating myself. Quite often when creating a page or a
> component, I create a companion javascript file with the same name as my
> component class. I got the idea today to try to create some kind of worker
> or service that automatically includes a javascript that has the same name
> as the component class and exists in the same folder on the classpath.
> After
> all, this is how the tml and properties files are hooked up to component
> classes, so why not do it for javascript as well?
>
> Any pointers to get me started? :)
>



-- 
Regards,
Christophe Cordenier.

Developer of wooki @wookicentral.com

Reply via email to