it should fallback just fine..
what version of wicket are you using?
Because in the ResourceStreamLocator we do now this:
public IResourceStream locate(final Class clazz, String path, final String
style,
final Locale locale, final String extension)
{
// Try the various combinations of style, locale and extension to find
// the resource.
ResourceNameIterator iter = new ResourceNameIterator(path, style, locale,
extension);
while (iter.hasNext())
{
String newPath = (String)iter.next();
IResourceStream stream = locate(clazz, newPath);
if (stream != null)
{
stream.setLocale(iter.getLocale());
return stream;
}
}
return null;
}
johan
On Nov 9, 2007 1:11 PM, German Morales <[EMAIL PROTECTED]> wrote:
> Hi again,
>
> Also, the problem is not giving the parameters to the ResourceReferences,
> if i call the full constructor then the ResourceReference works, but the
> problem is that it does not make a look up to see what's available, it
> just goes for the full thing. So, if i call the constructor with the
> session locale and style, what it does is search for the file
> style_mystyle_mylocale.css. This is not my intention, what i want it that
> that the framework searches for the style_mystyle_mylocale.css, then if
> not found fall back to style_mystyle.css, style_mylocale.css, style.css
> and so on (i'm not sure of the exact order of look up). So, modifying the
> constructor or passing the full parameters is not the solution, i think.
>
>
> Regards,
>
> German
>
> It seems that Johan Compagner wrote:
> > if you are creating your own ResourceReferences then you have to give
> the
> > style and locale to them
> > We could enhance the constructors that it does Session.get().getLocale()
> > and
> > Session.get().getStyle()
> > if you dont give them..
> >
> > johan
> >
> >
> >
> > On Nov 9, 2007 10:27 AM, German Morales <[EMAIL PROTECTED]>
> > wrote:
> >
> >> Hi,
> >>
> >> I was thinking (as a last hope) that if this works for the HTMLs, i
> >> could
> >> provide different HTMLs that point internally to different CSSs, and it
> >> should work. But that would be duplicating the HTML just to have the
> CSS
> >> changed, and then it's not a good idea.
> >>
> >> Perhaps someone can tell me an official way to have localized and
> styled
> >> CSSs, the wicket way?
> >>
> >> Thanks again,
> >>
> >> German
> >>
> >> It seems that German Morales wrote:
> >> > Hi,
> >> >
> >> > I use it inside a page.
> >> >
> >> > I've tried...
> >> >
> >> > // inside the page constructor
> >> > add(HeaderContributor.forCss(new ResourceReference(MyPage.class,
> >> > "style.css")));
> >> >
> >> > and
> >> >
> >> > // inside renderHead
> >> > cResponse.getHeaderResponse().renderCSSReference(new
> >> > ResourceReference(MyPage.class, "style.css"));
> >> >
> >> >
> >> > And I don't want to set the style and locale explicitely. What i want
> >> is
> >> > to deliver the application to a customer, and, if he wants, he adds
> >> the
> >> > customized page for a locale or style by itself (he could set the
> >> style
> >> > with a parameter or whatever). And as far as i understand the wicket
> >> > approach, that's how it should work automatically. In fact it works
> >> > perfecly when i do it for the html of the same page. The difference
> is
> >> > that the html is handled in other way (the framework does it) and
> when
> >> i
> >> > try to do it for the CSS of the page i do it (and it doesn't work).
> So
> >> > there must be something i'm not doing properly.
> >> >
> >> > Or, how should be the way to provide styled CSSs, there is another
> >> > aproach?
> >> >
> >> > thanks and bye,
> >> >
> >> > German
> >> >
> >> > It seems that Eelco Hillenius wrote:
> >> >>> 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.
> >> >>
> >> >> How do you use the resource reference? I think the class was
> designed
> >> >> in such a way that the components that use it (Image for instance)
> >> are
> >> >> responsible for setting the appropriate locale/ style 'just in
> time',
> >> >> so that switching locales etc works.
> >> >>
> >> >> Eelco
> >> >>
> >> >>
> ---------------------------------------------------------------------
> >> >> 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]
> >> >
> >> >
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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]
>
>