You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sjoerd Lohuis <s....@func.nl> on 2007/11/06 14:25:45 UTC

How do others include their browser specific styles in Wicket?

There are a few ways to include your browser specific styles in a project:
- CSS hacks to target specific browsers
- IE Conditional Comments
- Server-side browsercheck

I'm not asking which way is better or the best. I'm asking who's using 
one of these methods and what is the best way to implement this in Wicket.

The way I'm currently doing it is by using a server-side browsercheck 
which includes the necessary stylesheets in my pages. This is done by a 
Java Class which we reuse in evrey new project. Is there maybe a 
standard Wicket browsercheck component for this?

-- 
Sjoerd Lohuis
Func. Internet Integration
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How do others include their browser specific styles in Wicket?

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
We dont, we have one css for them all. Thats. IE 6,7 FF 1.5,2 Safari  
for us.

regards Nino

Sjoerd Lohuis wrote:
> There are a few ways to include your browser specific styles in a 
> project:
> - CSS hacks to target specific browsers
> - IE Conditional Comments
> - Server-side browsercheck
>
> I'm not asking which way is better or the best. I'm asking who's using 
> one of these methods and what is the best way to implement this in 
> Wicket.
>
> The way I'm currently doing it is by using a server-side browsercheck 
> which includes the necessary stylesheets in my pages. This is done by 
> a Java Class which we reuse in evrey new project. Is there maybe a 
> standard Wicket browsercheck component for this?
>

-- 
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How do others include their browser specific styles in Wicket?

Posted by Eelco Hillenius <ee...@gmail.com>.
> Hi,
> We get the client info the same way, but how do you prevent having to
> manually do (for example):
>         page.add(HeaderContributor.forCss("_css/style.css", "screen"));
>
>         if (clientProperties.isBrowserInternetExplorer()) {
>             page.add(HeaderContributor.forCss("_css/screen_ie.css",
> "screen"));
>         }
>        // possibly even: else if isBrowserXXX, etc.
>
> ...in the XXXBasePage for each and every project. Not that this is very
> hard or cumbersome to do so. I just want to know what is the wicket way
> (tm)?

You should be able to use Session's style property for that. The
contribution that is added through calling
add(HeaderContributor.forCss("foo.css")) should use that when
rendering:

  protected Resource newResource() {
    PackageResource packageResource =
CompressedPackageResource.get(getScope(), getName(), getLocale(),
getStyle());
    ...

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How do others include their browser specific styles in Wicket?

Posted by Sjoerd Lohuis <s....@func.nl>.
Hi,
We get the client info the same way, but how do you prevent having to 
manually do (for example):
        page.add(HeaderContributor.forCss("_css/style.css", "screen"));
      
        if (clientProperties.isBrowserInternetExplorer()) {
            page.add(HeaderContributor.forCss("_css/screen_ie.css", 
"screen"));
        }
       // possibly even: else if isBrowserXXX, etc.

...in the XXXBasePage for each and every project. Not that this is very 
hard or cumbersome to do so. I just want to know what is the wicket way 
(tm)?

@Nino: How do you cope with differences in css interprations between 
browsers? Css hacks?

Regards,
Sjoerd

-- 
Sjoerd Lohuis
Func. Internet Integration
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500



Johan Compagner wrote:
> Session.getClientInfo() ?
>
> On 11/6/07, Sjoerd Lohuis <s....@func.nl> wrote:
>   
>> There are a few ways to include your browser specific styles in a project:
>> - CSS hacks to target specific browsers
>> - IE Conditional Comments
>> - Server-side browsercheck
>>
>> I'm not asking which way is better or the best. I'm asking who's using
>> one of these methods and what is the best way to implement this in Wicket.
>>
>> The way I'm currently doing it is by using a server-side browsercheck
>> which includes the necessary stylesheets in my pages. This is done by a
>> Java Class which we reuse in evrey new project. Is there maybe a
>> standard Wicket browsercheck component for this?
>>
>> --
>> Sjoerd Lohuis
>> Func. Internet Integration
>> W http://www.func.nl
>> T +31 20 4230000
>> F +31 20 4223500
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How do others include their browser specific styles in Wicket?

Posted by Eelco Hillenius <ee...@gmail.com>.
On Nov 11, 2007 2:24 AM, Johan Compagner <jc...@gmail.com> wrote:
> Session.getClientInfo() ?

See also the HelloBrowser example
(http://wicketstuff.org/wicket13/hellobrowser/).

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How do others include their browser specific styles in Wicket?

Posted by Johan Compagner <jc...@gmail.com>.
Session.getClientInfo() ?

On 11/6/07, Sjoerd Lohuis <s....@func.nl> wrote:
> There are a few ways to include your browser specific styles in a project:
> - CSS hacks to target specific browsers
> - IE Conditional Comments
> - Server-side browsercheck
>
> I'm not asking which way is better or the best. I'm asking who's using
> one of these methods and what is the best way to implement this in Wicket.
>
> The way I'm currently doing it is by using a server-side browsercheck
> which includes the necessary stylesheets in my pages. This is done by a
> Java Class which we reuse in evrey new project. Is there maybe a
> standard Wicket browsercheck component for this?
>
> --
> Sjoerd Lohuis
> Func. Internet Integration
> W http://www.func.nl
> T +31 20 4230000
> F +31 20 4223500
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org