flex3 - Problem getting tooltip to refresh properly on an itemrenderer in Flex -


i'm having following problem.

i have arraycollection that's acting data provider tilelist (called favoritelinkslist)

i use itemrenderer called favoriteitem tilelist's itemrenderer. favoriteitem looks this:

<?xml version="1.0" encoding="utf-8"?> <mx:vbox xmlns:mx="http://www.adobe.com/2006/mxml"  width="280" height="163"  horizontalalign="center"  paddingleft="5" paddingright="5" paddingtop="0" paddingbottom="0" xmlns:ns1="*">   <mx:canvas width="100%" height="100%">   <mx:image    id="thumbnail"    width="178" height="115"    source="{data.thumbnail}"    tooltip = "{data.tooltip}" x="46" y="10"/>    <mx:text    id="title"    text="{data.tilelisttitle}"     width="254"    tooltip="{data.tooltip}" x="10" y="133"/>  </mx:canvas>  </mx:vbox> 

as can see, tooltips 2 items in taken data.tooltip

this works fine.

the problem refreshing tooltip when has changed.

the objects (of type object) in arraycollection each have property called tooltip (obviously since that's itemrenderer getting info from).

when change property new value, tooltip of itemrenderer doesn't change reflect this.

i tried set manually getting itemrenderer event triggered upon clicking 1 of items in tilelist without success.

example:

event.itemrenderer.title.tooltip = event.currenttarget.selecteditem.tooltip; 

after having updated tooltip gives compilation error: access of possibly undefined property title through reference static type mx.controls.listclasses:ilistitemrenderer.

i tried performing refresh() on favoritelinkslist array collection gave mixed results. tooltip updated correctly 1 of items (the first one) in tilelist went missing! seems flex bug. data provider has same number of elements before , after refresh , doesn't happen if click on first element in tilelist.

all appreciated.

found solution problem.

the favoritelinkslist bindable , set dataprovider of tilelist. however, changes individual objects not being propagated itemrenderer.

i thought there must change favoritelinkslist array collection itself.

as mentioned in question, tried using favoritelinkslist.refresh() made first element in tilelist vanish (though still seemed in array collection). possible bug in flex perhaps?

anyway, discovered way around perform following:

favoritelinkslist.setitemat(favoriteobject, favoritelinkslist.getitemindex(favoriteobject)); 

essentially, i'm setting item @ index x not doing enough itemrenderer refresh data itemrenderer.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -