Well, setting the dataProvider to null than back again seems to work...

Of course, if the list hasn't gotten short enough to prevent scrolling, the
scroll-position is reset back to zero...  But that's a simple matter of
storing the current scroll-position in a variable, then re-setting the
data-provider, then restoring the scroll-position...  Seems to work fine.

But man, what a pain...  Why a simple dataprovider.refresh() wouldn't do it
is just beyond me...

L.
On Thu, Mar 24, 2011 at 6:50 PM, Vaibhav Seth <[email protected]>wrote:

> you can also try dispatching a CollectionChange event on the dataprovider,
> some time it works this way.
> So that you can avoid the flickering on the screen for that moment.
>
>
> On Thu, Mar 24, 2011 at 6:47 PM, Laurence MacNeill <[email protected]
> > wrote:
>
>> Oh, and to be clear, I'm not assigning a new data-provider to the List at
>> any time.  I'm simply updating the data in the data-provider, then calling
>> the .refresh() method on it.
>>
>> Perhaps setting my data-provider to null, then back to the real
>> data-provider would fix it?  I'm gonna give that a try, just for kicks.
>>
>> L.
>>
>>   On Thu, Mar 24, 2011 at 6:40 PM, Laurence MacNeill <
>> [email protected]> wrote:
>>
>>> I agree, it *should* take care of the renderer.  But it doesn't.  Only if
>>> the item scrolls off the screen then back onto the screen later does it show
>>> the updates.  It simply will not update if the item is on-screen.
>>>
>>> Re-sizing works, only if I can manage to re-size it enough to force the
>>> item not to appear on the screen anymore.  Actually, it has to go a bit
>>> farther -- far enough for the item-renderer to be recycled.  It's like the
>>> data simply is not updated until the item-renderer is recycled.  Perhaps
>>> there's a way to force the item-renderer to be recycled, then?  I don't
>>> know...
>>>
>>> L.
>>>
>>>   On Thu, Mar 24, 2011 at 6:36 PM, Vaibhav Seth <
>>> [email protected]> wrote:
>>>
>>>> If I got you right, when the scroll goes off and you give the List a new
>>>> dataprovider, the updated data does not reflect in the List ?
>>>> That seems very strange, as when you are giving the new dataprovider it
>>>> should take care of the renderer.
>>>>
>>>> Did you tried resizing the application when the scroll goes off ? Does
>>>> the resizing brings back the updated data ?
>>>>
>>>>
>>>> On Thu, Mar 24, 2011 at 6:27 PM, Eric DeCoff <[email protected]>wrote:
>>>>
>>>>> Laurence,
>>>>>
>>>>> Take a look at my datagrid render itemrender from 4.5
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Mar 24, 2011 at 5:36 PM, Laurence MacNeill <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Maybe y'all can help me here...  I've been banging my head against the
>>>>>> wall for hours on this stupid thing, and I can't seem to figure it out...
>>>>>>
>>>>>> I have a spark Panel which contains a spark List.  The List scrolls
>>>>>> automatically -- no user interaction required, as this is a simple app
>>>>>> that's just being used on a large display-screen at a convention center.
>>>>>> It's displaying a list of upcoming events, and that list needs to be 
>>>>>> updated
>>>>>> every so often (you know, if an event has sold out or been cancelled or
>>>>>> whatever) so I'm updating the data in the List's dataProvider every 3
>>>>>> minutes.
>>>>>>
>>>>>> As the day goes on, the list gets shorter and shorter -- events that
>>>>>> are in the past are removed from the dataProvider because the database 
>>>>>> query
>>>>>> excludes events that started more than 15 minutes ago.
>>>>>>
>>>>>> When the list is short enough, there is no more scrolling.  There's
>>>>>> enough room to display all the events without the list automatically
>>>>>> scrolling.  THAT is when the problem occurrs -- the custom item-renderer
>>>>>> stops updating, because it's not scrolling off the screen anymore...  
>>>>>> Even
>>>>>> though I'm calling the .refresh() method on the List's data-provider, 
>>>>>> it's
>>>>>> not updating the renderers that are already being rendered on the screen.
>>>>>>
>>>>>> So.  How to I make it update those renderers that are already on the
>>>>>> screen?  I've tried about 20 different suggestions that I found on
>>>>>> Google (my own custom-written invalidateListDisplay function since a 
>>>>>> Flex 4
>>>>>> List doesn't have one, using the List.dataProvider.itemUpdated() thingy,
>>>>>> setting the List's itemRenderer = null then back to the custom 
>>>>>> itemRenderer
>>>>>> again both with and without a validateNow() call in there, using the
>>>>>> updateRenderer() method, etc., etc..) I've tried them all, and NOTHING 
>>>>>> has
>>>>>> worked.
>>>>>>
>>>>>> I've really got to get this figured out soon.  It's for a live show
>>>>>> that's happening right now.
>>>>>>
>>>>>> Thanks,
>>>>>> Laurence MacNeill
>>>>>> Mableton, Georgia, USA
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Eric R. DeCoff
>>>>> Changing the world,
>>>>> 1 line of code at a time
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Thanks,
>>>> Vaibhav Seth.
>>>>
>>>>
>>>
>>
>
>
> --
> Thanks,
> Vaibhav Seth.
>
>

Reply via email to