On 3/13/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
I am currently investigating if we can do without the explicit
registration. We can't totally do without, as we need at least
classloader to load any resources like that, but the intend now is to
make it at least easier. More about this later this week.
Eelco
On 3/13/06, Siddharth Agarwal < [EMAIL PROTECTED]> wrote:
>
> Thanks Johan !
>
> So having something like this hardcoded..
>
> background:
> url(contextroot/wicketservlet/resources/my.com.package.MyCom/images/hello.gif)
> ;
> is probably ruled out since if i were to ship a component, I would not have
> any idea of the user's contextroot etc?.
>
> So the only way left is to generate the url/css dynamically through call to
> new PackageResourceReference(MyComp.class, "images/hello.gif") ?
>
> How do you guys typically handle this (generating the background: CSS
> attribute dynamically?)
> I would have loved to have it in the css.
>
> Ok am thinking of just generating that attribute dynamically.
> So,
>
>
> style.css
> -----------
> .style1 {
> width:16px; height:22px;
> }
>
>
> While i try to do somethign in renderHead for just specifying that
> attribute.
>
> //dynamically specified by the component
> <style>
> .style1{
> background:
> url(contextroot/wicketservlet/resources/my.com.package.MyCom/images/hello.gif)
> ;
> }
> </style>
>
> Ok tell me this. Does it make sense for wicket to provide some place holders
> in the CSS for such things ?....am a newbie and i might be way off mark.
>
> style.css
> -----------
> .style1 {
> width:16px; height:22px;
> background: url($(hellogif)) ;
> }
> -----------
>
> and while creating a Creating a StyleSheetReference,
>
> Map context = new HashMap();
> context.put("hello.gif",new PackageResourceReference(MyComp.class,
> "images/hello.gif"));
> new StyleSheetReference("css_id", MyComp.class, "style.css",context);
>
> thanks!
>
>
