A property that indicates whether the vertical scroll bar is always on, always off, or automatically changes based on the parameters passed to the
setScrollBarProperties()method. Allowed values are
ScrollPolicy.AUTO. MXML values can be
Setting this property to
ScrollPolicy.OFFfor ListBase subclasses does not affect the
verticalScrollPositionproperty; you can still scroll the contents programmatically.
But he's not doing that anywhere in his code. Also the behavior he's describing isn't at all what happens when you disable scrolling. The symptoms described are definitely unusual..
Although, I'd be curious to know what happens if you try setting the scroll bar policy to "on" (or "off"). (verticalScrollPolicy="on") What version of the SDK is this running on?
See if there are collectionChange events firing as you scroll. If there are
because data is paging in, that might mess up scrolling.
I did try setting the verticalScrollPolicy to "off". It removed the scroll bar and prevented any scrolling as expected. I then tried the "on" and "auto" settings. In both cases, the same symptoms occurred.
Please forgive the newbie question but, how do I determine the SDK version? Are you referring to the AIR SDK? I am still using a trial version of Flex 4 that I downloaded about 21 days ago and I installed AIR at the same time.
Sorry about my newbie status, but how would I check for the collectionChange event firing?
Sounds like something in your script block is re-fireing your query. As a guess I would say you have the multiple calls to the same token. If you see duplicates you might comment out one to see what happens. Or post your script block. Maybe someone will see the problem.
protected function adg1_creationCompleteHandler(event:FlexEvent):void
protected function getAllTABLESResult_resultHandler(event:ResultEvent):void
I figured it out!
The problem was caused by me calling the data retrieval functions from the render event of a component. I did this because the component is only visible when the user switches to a certain application state. The component contains many datagrids and other bound controls, so I didn't want to retrieve data into its controls unless the user chose to switch to that state. Unfortunately, it seems that the render event fires over and over again. In fact, I suspect that it re-fired whenever data was displayed in the controls, so an endless loop was occurring.
I have moved the retrieval logic to the application itself. This solved my datagrid scrolling problem. Unfortunately, this adds overhead and prevents me from achieving my original goal of loading the data only when the state is changed.
If anyone has a suggestion for a good way to load data on state change, I would be interested. I suppose that I could put back it on the render event and set a "dataLoaded" flag variable to true after loading. On the render event, I would only load the data if the variable was false. I'm sure there's a better event or technique out there.
Many thanks to all those who responded. The suggestions that an event was firing repeatedly certainly pointed me in the right direction!