It's probably null, in which case it returns 800 (the second parameter
you provide which is the default value in case the property wasn't
found.

You probably still have to do:

getRequestCycleSettings().setGatherExtendedBrowserInfo(true);

in your application's init method.

Also, note the section on ClientProperties in
http://cwiki.apache.org/WICKET/migrate-13.html for Wicket 1.3.

Eelco


On 1/30/07, Carfield Yim <[EMAIL PROTECTED]> wrote:
> Thanks a lot, however for now I use the following code to get the screen 
> height:
>
> final ClientProperties prop =
> ((WebClientInfo)modal.getSession().getClientInfo()).getProperties();
>         final int screenHeight =
> prop.getInt(ClientProperties.SCREEN_HEIGHT, 800);
>
> However it just return 800 for all browse (I am using 1400x1050), am I
> using wrong method?
>
> On 1/31/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > this has been added in svn today
> >
> > see the wicket-1.x branch
> >
> > -igor
> >
> >
> >
> > On 1/30/07, Carfield Yim <[EMAIL PROTECTED] > wrote:
> > > I can get the SCREEN_HEIGHT value using
> > >
> > http://wicket.sourceforge.net/apidocs/wicket/protocol/http/ClientProperties.html#SCREEN_HEIGHT
> > > but this is kind of hard to work with in my case as I need to guess
> > > the height of the browsing area of the browser.
> > >
> > > Can I get the body element height? I found some resource at web -
> > > http://www.quirksmode.org/js/doctypes.html . Can I refer
> > to value of
> > > some valuables there?
> > >
> > > On 1/31/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > > > Yep. You can take a look at wicket.examples.hellobrowser to see it in
> > > > action. You can customize this by overriding
> > > > wicket.RequestCycle#newClientInfo() (which would
> > obviously have to be
> > > > in a custom request cycle). Take a look at
> > > > wicket.markup.html.pages.BrowserInfoPage to see how it
> > all works in
> > > > case you want to built it from scratch yourself.
> > > >
> > > > Eelco
> > > >
> > > >
> > > > On 1/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > > > > wicket does this for you
> > > > >
> > > > > ==== pasted from eelco's reply to another thread =======
> > > > > Just FYI, in case you need to know whether your client supports
> > > > > JavaScript, can be determined with:
> > > > >
> > > > >
> > ((WebClientInfo)getSession().getClientInfo()).getProperties().isJavaEnabled()
> > > > >
> > > > > which works (best) when you do:
> > > > >
> > > > >
> > getRequestCycleSettings().setGatherExtendedBrowserInfo(true);
> > > > >
> > > > > in your application's init method.
> > > > > ===========================================
> > > > >
> > > > > if you set gatherextendedbrowserinfo(true) that will also give you the
> > > > > window size in clientinfo properties
> > > > >
> > > > > -igor
> > > > >
> > > > >
> > > > >
> > > > >  On 1/30/07, Carfield Yim <[EMAIL PROTECTED]> wrote:
> > > > > > My boss like me to add some script to detect browser dimensions and
> > > > > > set better height / width to modalwindow, there is some site telling
> > > > > > me how to get the dimensions. The only way I know is adding hidden
> > > > > > fields to webpages and update those fields using javascript.
> > > > > >
> > > > > > However, if something changed at javascript side it is easy to
> > forget
> > > > > > update at HTML side and deliver software with bugs to clients. Just
> > > > > > wonder if wicket provide any API which help to update session
> > variable
> > > > > > or hidden field with custom javascript so that it is easier to
> > > > > > maintain?
> > > > > >
> > > > > >
> > > > >
> > -------------------------------------------------------------------------
> > > > > > Take Surveys. Earn Cash. Influence the Future of IT
> > > > > > Join SourceForge.net's Techsay panel and you'll get the chance to
> > share
> > > > > your
> > > > > > opinions on IT & business topics through brief surveys - and earn
> > cash
> > > > > >
> > > > >
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > > > > > _______________________________________________
> > > > > > Wicket-user mailing list
> > > > > > [email protected]
> > > > > >
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > > >
> > > > >
> > > > >
> > > > >
> > -------------------------------------------------------------------------
> > > > > Take Surveys. Earn Cash. Influence the Future of IT
> > > > > Join SourceForge.net's Techsay panel and you'll get the chance to
> > share your
> > > > > opinions on IT & business topics through brief surveys - and earn cash
> > > > >
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > > > >
> > > > > _______________________________________________
> > > > > Wicket-user mailing list
> > > > > [email protected]
> > > > >
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > -------------------------------------------------------------------------
> > > > Take Surveys. Earn Cash. Influence the Future of IT
> > > > Join SourceForge.net's Techsay panel and you'll get the chance to share
> > your
> > > > opinions on IT & business topics through brief surveys - and earn cash
> > > >
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > > > _______________________________________________
> > > > Wicket-user mailing list
> > > > [email protected]
> > > >
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > >
> > >
> > >
> > -------------------------------------------------------------------------
> > > Take Surveys. Earn Cash. Influence the Future of IT
> > > Join SourceForge.net 's Techsay panel and you'll get the chance to share
> > your
> > > opinions on IT & business topics through brief surveys - and earn cash
> > >
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > > _______________________________________________
> > > Wicket-user mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> >
> >
> > -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share your
> > opinions on IT & business topics through brief surveys - and earn cash
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> >
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
> >
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to