Yes, this is possible.

But actually the previous solution is usally sufficient. You can easily define a page that is extended by all other pages. In the base page you can include the stylesheet as before and all other pages will get it too. (See the wiki for component inheritance.)

But anyway, here is a non tested approach:
- move the style.css (and variations) somewhere on your classpath. For example in the package that contains the java file JustSomeClass.java.
- remove the <wicket:link> from the markup file
- give the stylesheet link a wicket:id, eg.:
<link rel="stylesheet" type="text/css" href="style.css" wicket:id="abc"></link>
- in the code do something like:
 add(new StyleSheetReference("abc", JustSomeClass.class, "style.css"))

Regards,
    Erik.

tbt wrote:
Hi,

I like to have my css file('style.css') in a seperate folder instead of
having it in the same folder as HomePage.java because multiple web pages are
using the same classes in the css file. Is it possible to have both css
files(style.css and style_tw.css) in a seperate folder. This applies for
only css files and not property files which I would be happy to keep in the
same folder as the html and java files.

Thanks


Erik van Oosten-3 wrote:
You can call:
 getSession().setLocale(new Locale("en", "US"))

In the Java javadocs (http://java.sun.com/j2se/1.4.2/docs/api/java/util/Locale.html) you find references to language and country codes. Language code "ta" means Tamil so that is probably not what you want. Country Taiwan is represented by county code "TW".

Switching css is fairly easy. Put this in the header:
<wicket:link><link rel="stylesheet" type="text/css" href="style.css"></link></wicket:link>
and move style.css to the same folder as HomePage.html.

Now if you want to add another locale for the stylesheet, you just add a file called style_[language code].css. No other changes needed.

Regards,
     Erik.


tbt wrote:
Hi

I have a html page called HomePage.html

<html>
<head>
<link href="Resources/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
English Taiwanese
<wicket:message key="option_id" />


</body>
</html>

and two property files called HomePage.properties and
HomePage_ta.properties.

These files hold the values which should be replaced inside the
<wicket:message> tag.
How can I switch between these property files once the user selects a
particular language inside my HomePage .java class. I also need to change
the css file according to each language.

eg:- If Taiwanese is selected it should look like <link
href="Resources/css/style_ta.css" rel="stylesheet" type="text/css" />

Thanks
---------------------------------------------------------------------
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