views:

16

answers:

0

Hi there :D,

I'm having trouble. I know that IE and FF have different kinds of event-models, but this is really beyond me. I am using Google Web Toolkit to create some Ajax-Application. I have a table (FlexTable) wrapped by a ScrollPanel. When this ScrollPanel ends up being scrolled to its bottom, I fire an RPC-request to fetch some more data and add them to the table.

All this works flawlessly in Firefox.

In Internet Explorer 8 though onScroll is triggered several times (two times to be precise)! What's even worse though, is, that they fire completely indepenent.. not one after the other, but obviously at the same time, because they don't know of each other.

Can anyone suggest something to fix the problem? I can't really post any code as I don't know what to post.. I have attached a ScrollHandler to the ScrollPanel, which calls "onScroll(event)".

This method looks like this:

    @Override
public void onScroll(ScrollEvent event) {
    if (itemScroller.getScrollPosition() + itemScroller.getOffsetHeight() > itemTable.getOffsetHeight()) {
        needsPartialReload = true;
        loadCharacterItems(items.size(), 15);
    }
}

I tried to like .. keep track of whether the method has been called already by setting needsPartialReload to true and then checking within loadCharacterItems whether it's set to true or not. If it's false, the method exits; if true, it's set to false and keeps the execution of the stuff there. But unfortunately it seems both times (this event is triggered twice by IE for some reason) it has needsPartialReload = true :/... but even if this worked, it'd be some strange hack...

do you know how to fix this problem of onScroll being triggered twice in IE?

Thank you in advance! divStar.