Hi Michael,

The Widget.onLoad method should be called after its attached to the
document (rendered)...

Assuming that you have a "MyComponent" inside a ScrollPanel, perhaps
try this in your MyComponent:

@Override
public onLoad() {

        Widget parent = getParent();

        if (parent != null && parent.isAttached() && parent.isVisible
()) {
             // set parent scrollPosition...
        }
}

How are you calculating the scollPosition?

Cheers,
Dave

On Oct 19, 11:27 am, grue <[email protected]> wrote:
> Hi,
>
> I have placed a GWT component within my web application which contains
> a ScrollPanel. The initial scroll position
> should be set when the page is loaded. Now the problem is that this
> will only work when the content of the ScrollPanel
> is ready (so there actually is anything scrollable inside the panel).
> When I call the setScrollPosition() in the constructor of my component
> nothing happens because the component is
> not rendered yet (there is no async stuff in my component).
> How can I execute any method after a component is rendered? I have
> tried window.onload but it doesn't seem to work.
> Also Widget.onLoad() is called before the widget is rendered.
>
> Thanks in advance for any hints.
> Michael
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to