Re: getOffsetHeight returns 0 although onload has been called

2011-11-30 Thread George Agiasoglou
Absolutely brilliant, the deferred command worked like a charm. Many thanks to all of you! -G -- "Please consider the environment before printing this e-mail" The Newspaper Marketing Agency: Opening Up Newspapers: http://www.nmauk.co.uk/ This e-mail and any attachments are confidential, may

Re: getOffsetHeight returns 0 although onload has been called

2011-11-30 Thread George Agiasoglou
Unfortunately, I need the width and height of the area because I append that information on a url. I will try the deferred command and let you know. Many thanks, G -- "Please consider the environment before printing this e-mail" The Newspaper Marketing Agency: Opening Up Newspapers: http:/

Re: getOffsetHeight returns 0 although onload has been called

2011-11-30 Thread Andrei
You don't need getOffsetHeight to achieve what you want. There are two solutions: 1. Use LayoutPanel instead of DockLayoutPanel. LayoutPanel allows you to add two widgets that occupy the same space. If you don't specify the position of each child widget, each child widget will occupy the entire sp

Re: getOffsetHeight returns 0 although onload has been called

2011-11-30 Thread Jens
getOffsetHeight/Width only returns a value other than 0 if the element has been successfully rendered by the browser (possibly including elements that have visibility:hidden css). When you call DeckLayoutPanel.setWidget(w) the DeckLayoutPanel schedules a layout command which will be executed af

Re: getOffsetHeight returns 0 although onload has been called

2011-11-30 Thread George Agiasoglou
The problem is that I call getOffsetHeight/Width on a panel which belongs to a widget which has display property set to none. The display property is set to none because that widget is not currently displayed by the decklayoutpanel but it is attached to it, which is the desired behaviour. I a

Re: getOffsetHeight returns 0 although onload has been called

2011-11-30 Thread Ed
Use firebug to analyze your problem. If it's your display property then change this by widget.getElement().getStyle().setDisplay(Display.BLOCK) (can be little different). By default the Display property is set to auto so if you aren't setting it, it wouldn't give you any problem. On Nov 30, 1:19 

Re: getOffsetHeight returns 0 although onload has been called

2011-11-30 Thread George Agiasoglou
t @Vitrums I am convinced that my problem is caused because the property display is set to none, however I don't know how to solve it. I could add an AnimationCallback on the decklayoutPanel to find out when the widget is finally being displayed, but that kinda defeats the use of Activity.st

Re: getOffsetHeight returns 0 although onload has been called

2011-11-30 Thread George Agiasoglou
Thank you for your suggestions, however, the display property is not set to none, actually is not set at all. Thanks, G -- "Please consider the environment before printing this e-mail" The Newspaper Marketing Agency: Opening Up Newspapers: http://www.nmauk.co.uk/ This e-mail and any attach

Re: getOffsetHeight returns 0 although onload has been called

2011-11-30 Thread Ed
Make sure your widget is attached (check the attached property) before requesting the widget for any dimensions. Example: in my animation components I always first check that the widget is attached as otherwise the animations are based on (most of the time) incorrect dimensions as the browser didn

Re: getOffsetHeight returns 0 although onload has been called

2011-11-30 Thread Vitrums
getOffsetHeight() of an element which *display* property was set to *none*will always return 0 -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/

Re: getOffsetHeight returns 0 although onload has been called

2011-11-29 Thread skippy
>From what I have found is the objects need to be visable in the Document object first. So try this: public static void adjustHeight(final DockLayoutPanel topPanel, final SimplePanel bodyPanel, final DockLayoutPanel outerPanel, final boolean isIpad) { Scheduler.get().scheduleDeferred(new

getOffsetHeight returns 0 although onload has been called

2011-11-29 Thread George Agiasoglou
Hi group, Consider an application which has a *DeckLayoutPanel* as a shell, and has two DockLayoutPanel as children, which means only one child is shown at any time. I am using MVP with Activities and Places, there are two places and each place corresponds to displaying a child. When the app