You could do
public class MyPanel extends Panel {
public static ResourceReference CSS = new ResourceReference(MyPanel.class,
"mycss.css");
public MyPanel(String id) {
add(CSSPackageResource.getHeaderContribution(CSS ));
}
}
Similar for JavaScript with JavascriptPackageResource instead
of CSSPackageResource
Best,
Ernesto
On Wed, Oct 7, 2009 at 1:21 PM, Ittay Dror <[email protected]> wrote:
> In the panel's html i have something like:
>
> <script type="text/javascript" src="./js/application.js"></script>
>
>
> This works well when the html is viewed as standalone. but in the context
> of the application i need the tag to be rendered as:
>
> <script type="text/javascript" src="prefix/js/application.js"></script>
>
>
> Ittay
>
>
> Ernesto Reinaldo Barreiro wrote:
>
> Not quite following you... What do you mean? Something like:
>> a.myClass {
>> background: url('${myURL}');
>> }
>>
>> and get ${myURL} replaced?
>>
>> Best,
>>
>> Ernesto
>>
>>
>> On Wed, Oct 7, 2009 at 12:55 PM, Ittay Dror <[email protected]> wrote:
>>
>>
>>
>>> Hi,
>>>
>>>
>>> Is there a way in which I can convert javascript/css relative references
>>> in
>>> a <wicket:head> of a panel and add a prefix to them?
>>>
>>>
>>> Regards,
>>>
>>> Ittay
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>>
>>>
>>
>>
>>
>
> --
> -- Tikal <http://www.tikalk.com>
> Tikal Project <http://tikal.sourceforge.net>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>