webcontainer.ScrollTo do not scroll

Hi there,

Using Xojo 2013 r4.1
IDE running on OSX 10.9
Tested with Safari & Chrome

I have a dynamically created webcontainer filled with agenda entries.
Entries can be entered for 24 hours but by default the agenda shows event starting at, let’s say, 8:00am.

The ScrollTo method has NO effect

Webcontainer is created as follow

[code]Dim cc As new WebContainer
AddHandler cc.ContentsScrolled, AddressOf cc_Scrolled

cc.EmbedWithin(self, l, t, w, h) 'self is another webcontainer, l,t,w,h are filled elsewhere
'… some processing
cc.ScrollTo(toTop, toLeft) 'toTop, toLeft filled in processing
[/code]

The cc.ScrollTo has no effect at all.

The cc_Scrolled method is called when I’m scrolling “manually” using the mouse wheel or scrollbars.

How can I scroll to a specific position if ScrollTo doesn’t work ??

It is possible that you’re calling the ScrollTo before the container has been Shown to the client? Have the scrollTo() occur in the Shown event of the container and see if that works.

Hi Brock,

Thanks for the advice.
The method performing the ScrollTo is called from within the Shown event of the webcontainer where the container I want to scroll is embedded.

Now I’ve added an event handler for the Shown event of the container to scroll and waiting this event to scroll… It seems to work but the 1st time.

Thanks for putting me on the right track !

Thanks Brock, I had to work a bit more because of a cascade of embedded containers but it works … finally.