ContentsScrolled Event for WebContainer

Hey gang,

A customer reported a problem and I can see what is happening but I don’t know why.

I have a WebContainer on my window. The actual size of the container may be larger than what I have allocated for it on the window. So then the WebContainer scrolls. In the ContentsScrolled event I set some properties of the Container to the x and y variables in the event. I use these scroll positions to calculate some positions of other controls. However, this event is never firing! The properties I am using to store the scroll position never get updated. And this is causing the problem my customer reported.

Am I doing something wrong? When I scroll the WebContainer, shouldn’t the ContentsScrolled event fire?

I tried trapping the MouseMove event and that doesn’t fire either.

Using 2014R3.2 still.

Before we get too far, what platforms and what browsers have you tested?

Safari on OS X. But my customer reporting the issue is running on Windows. Unknown what browser.

Any love here Greg? What’s going on?

OK. I must be the only person who is attempting to use the ContentsScrolled event on a WebContainer. I’ll have to figure this out myself then. I’ll file a bug report if I figure out is in indeed a bug. Problem is I’m not entirely sure if what I am doing is supposed to trigger that event. I think so but I’m not positive. That’s why it would be helpful if others who are using this event could say “yeah - it works.” Oh well… :expressionless:

Jon, I placed a 1000 pix listbox on a WebContainer, added the ContentScrolled event to it and inside a debuglog with str(x) and y.

The values show up fine in DebugView.

Windows 10, 2015R1.

Maybe it is your code ?

Was the CC placed on the window or embedded. Mine is embedded.

The event does not fire upon vertical scroll when the WebContainer is embedded.

You want to file a bug report. That is the only way this can get any love.

In the meantime, as a workaround you may want to store instances on the left handside out of the webpage area, and move them in place when needed. Or use the visible property.

Actually, it doesn’t fire on a WebContainer placed right on the page either when vertically scrolled. It does fire when you horizontal scroll.

The issue I have is with knowing where to place some other controls when the page is scrolled. I don’t know if you remember the menu you helped me create using a listbox. That works great, but I am using the scroll position to calculate the position of the menu. But I’ll have to look at doing it another way.