flex - spark List with ItemRenderer click function not working -
i having issue itemrenderer, using spark list. code following:
i have list:
<s:list id="productsetlist" dataprovider="{ model.productsets }" change="model.selectset( productsetlist )" height="100%" width="100%" bordervisible="false" itemrenderer="sidebaritemrenderer" top="20" left="15"> </s:list>
and itemrenderer is:
<s:itemrenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" width="160" height="175" autodrawbackground="false" buttonmode="true" usehandcursor="true" click="click(event)" cacheasbitmap="true" > <fx:script> <![cdata[ import com.png.vm.model.vos.productset; protected function click(event:mouseevent):void { trace('arthur'); } ]]> </fx:script> <s:bitmapimage source="{productset(data).image}" width="160" height="175"/> </s:itemrenderer>
the thing is, if scroll list, , click on item, not trace 'arthur' ! why ? must trace time clicks in list!
edit: if remove change="model.selectset( productsetlist )"
in list, works!! cannot remove that, suggestions ? how can switch function?
trace works when debugging/using debugging version of flash player. make sure using that. if want pop-up message use alert.show("message")
for more information trace() check out: http://livedocs.adobe.com/flex/3/html/help.html?content=logging_08.html
and alert.show(): http://help.adobe.com/en_us/as2lcr/flash_10.0/help.html?content=00001965.html
if running debug player. try originating click event embedded <s:group>
way whatever add in here beyond bitmap still trigger click event.
something like:
<s:group width="100%" height="100%" click="click(event)" > <s:bitmapimage source="{productset(data).image}" width="160" height="175"/> </s:group>
i've had click events work me inside of itemrenderers before
Comments
Post a Comment