Hi johan,

The problem is that the file is there... just that it doesn't seem to be
looking for it.

If i force the full constructor:

new ResourceReference(MyPage.class, "style.css", getLocale(), getStyle())

all works, so the file is correcly found and the name is correct.

The problem is when i don't set the locale and style explicitely (as it is
supposed to be done):

new ResourceReference(MyPage.class, "style.css")

then it doesn't find the file. Actually i think it doesn't even try to
find it, since as i mention i put a breakpoint in
ResourceReference#setStyle() and nobody is calling it. So later internal
code to load the resource uses style and locale with null values.

I'm not sure if there's something i'm missing, or how it is supposed to be
done.

Thanks,

German


It seems that Johan Compagner wrote:
> they locale and style are used to search for it yes
> they are not forced.. What do you mean with that?
> If the file with that style and locale isn't there it will fallback
>
> johan
>
>
> On Nov 7, 2007 10:50 PM, German Morales <[EMAIL PROTECTED]>
> wrote:
>
>> Hi all,
>>
>> I'm having trouble with localized and styled CSSs.
>>
>> Everything works alright with HTML. For example, wicket finds
>> MyPage_mystyle.html instead of MyPage.html if i've called
>> session.setStyle("mystyle"). But for CSS i can't get it working.
>>
>> i've tried different approaches like:
>>
>>   // inside the page constructor
>>   add(HeaderContributor.forCss(new ResourceReference(MyPage.class,
>> "style.css")));
>>
>>
>>   // inside renderHead
>>   cResponse.getHeaderResponse().renderCSSReference(new
>> ResourceReference(MyPage.class, "style.css"));
>>
>>
>> None of this worked for me. However, it works if I call the full
>> constructor of ResourceReference:
>>
>> new ResourceReference(MyPage.class, "style.css", getLocale(),
>> getStyle())
>>
>> But i'm not supposed to do that, because then the Locale and Style are
>> forced, and i want this only if the file is present. I know some
>> ResourceStreamLocator should be involved in the process, but i don't
>> know
>> how. I see in the ResourceReference javadoc that the framework should be
>> calling the setStyle() method, but i debugged it and it doesn't happen.
>>
>> What am i doing wrong?
>>
>> Thanks in advance,
>>
>> German
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to