But i think you can do this pretty easy youreself.
in the head part of youre page do something like this:
<span wicket:id="headjsscripts">
<script wicket:id="headjsscript" type="text/_javascript_" src ="#"></script>
</span>
make that headjsscripts a ListView give that listview a model
that has somehow access to the Page.
Iterate over all the children searching for a specific interface (see visitChildren of us how we do that)
On that interface you have a method getJsScript where you return something the src of the js script you want)
Combine/merge all those sources and make link objects of them (the headjsscript) in the populateListItem of the ListView.
i think you can also do this:
<script wicket:id="headjsscripts" type="text/_javascript_" src ="#"></script>
and give the ListItem an attribute modifier src .. (you don't have to make a link component then)
On 9/30/05, Scott Sauyet <[EMAIL PROTECTED]> wrote:
But if I try to use the script as a resource of my Panel, which would be
ideal for making the panel a true component, then the URL is specific to
that panel. A different panel, or other JS on my page which depends
upon this script, would have the same _javascript_ referenced through a
differnt URL.
-- Scott
jan_bar wrote:
> It doesn't matter how many times you have <script src="" with the same URL on
> your page. It will be cached and downloaded only when needed.
>
> Jan
>
> "Scott Sauyet" <[EMAIL PROTECTED]> wrote in message
> news: [EMAIL PROTECTED]
>
>>Hi Folks,
>>
>>It's been far too long since I asked a question on this list. One might
>>think I was starting to "get it". :-)
>>
>>I'm planning on building my first reusable panel soon; and I'm pretty
>>sure I understand what I need to in order to do this, but one thing is
>>nagging at me. The panel will have associated _javascript_. This is
>>straightforward enough, but that _javascript_ file depends upon another
>>_javascript_ library, Ben Nolan's excellent Behaviours
>>(http://bennolan.com/behaviour/ ). I use that library for things other
>>than this panel on some pages, but not on others. I'd rather not
>>include it twice on a single page.
>>
>>I could simply include the Behaviour library on each page, needed or
>>not, and have the panel assume that it will be in place. But I really
>>don't like the idea that the panel can't be dropped into place. It's
>>not meant as a reusable panel for anything off my current project, but
>>it feels somehow... wrong. Perhaps I can add something to the Behaviour
>>library that will only define things if they haven't already been
>>defined, but that starts to bring back nightmares of old "#IFDEF" days;
>>possible but not pleasing.
>>
>>So, I guess the question is, has anyone found an elegant solution to
>>this problem? Am I missing something basic?
>>
>>Thanks for all the help this list has given.
>>
>> -- Scott
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by:
>>Power Architecture Resource Center: Free content, downloads, discussions,
>>and more. http://solutions.newsforge.com/ibmarch.tmpl
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
>
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
