Thanks Igor, I came up with this solution

public abstract class BasePage extends WebPage() {
int height = .../*get Browser height*/
String headerCss = String.format("<style type=\"text/css\">#leftmenu
{height:%spx}</style>", height);
add(new StringHeaderContributor(headerCss));


which isn't free of Javascript either - should have recognized this earlier
*ehem* 

But I saw that there's TextTemplateHeaderContributor for a more Java-like
solution. 

add(TextTemplateHeaderContributor.forCss(new CssTemplate(TextTemplate),
variableModel));

How do i create a TextTemplate to use this? 

Cheers, Roman


[email protected] wrote: 
> see IHeaderContributor
> 
> -igor
> 
> On Thu, Apr 3, 2008 at 12:43 AM, rzechner <[EMAIL PROTECTED]> wrote:
> > I want to resize the height of my pages dynamically, therefore I need to set
> > the height of some markup elements dynamically. I don't want to use
> > Javascript (although I found a nice solution with jquery).
> >  Is there a way to add a textblock like the following to the page header?
> >
> >  <!--[if lt IE 8]>
> >   <style type="text/css">
> >       #leftmenu{height:400px;} /*this value should is dynamic */
> >   </style>
> >  <![endif]-->
> >
> >  whereas the height of #leftmenu is set like this:
> >
> >  public abstract BasePage extends WebPage() {
> >  ...
> >  WebClientInfo w = (WebClientInfo)getWebRequestCycle().getClientInfo();
> >  ClientProperties cp = w.getProperties();
> >  int minHeight = cp.getBrowserHeight();
> >  //some imagination now
> >  addToHeader{
> >       addStyle("#leftmenu", "height", minHeight);
> >  }
> >
> >
> >  Thanks,
> >
> >  Roman
> >
> >
> >
> >
> >  ---------------------------------------------------------------------
> >  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]
> 
> 

-- 
-- 
Liland ...does IT better

Liland IT GmbH
Creative Master
email: [EMAIL PROTECTED]

office: +43 (0)463 220-111  | fax: +43 (0)463 220-288 
http://www.Liland.at


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

Reply via email to