Note that there are some explanatory texts on larger screens.

plurals
  1. POFlex Mobile: Strange behavior in IconItemRenderer List
    primarykey
    data
    text
    <p>I'm desperately trying to fix a strange behavior in my custom iconitemrenderer list: When I change the view to the view with the list inside and start scrolling, the list gets white for the fraction of a second (apperently completely redrawn), but only once when scrolling the first time after the view change.</p> <p>In the IconItemRenderer I add a check mark:</p> <pre><code>&lt;s:IconItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"&gt; ... override protected function commitProperties():void { //create checkbox if(!checkMarkImage &amp;&amp; data.isChecked) { //create image holder imageHolder = new Group; addChild(imageHolder); //create image checkMarkImage = new BitmapImage(); checkMarkImage.source = checkBoxSource; imageHolder.addElement(checkMarkImage); } //delete checkmark else if(checkMarkImage &amp;&amp; !data.isChecked) { removeChild(imageHolder); imageHolder = null; checkMarkImage = null; } super.commitProperties(); } override protected function layoutContents(w:Number, h:Number):void { super.layoutContents(w, h); //layout the checkmark if(checkMarkImage) { // don't do it like this! (see correct answer) checkMarkImage.x = w-40; checkMarkImage.y = 14; } } </code></pre> <p>The list change handler sets the mark on the selected item and removes it from the old one. After this is done it calls popView(), but when you come again to this view the list gets created in the views addHandler and when you start scrolling the list behaves as mentioned above.</p> <pre><code>//list change protected function myList_changeHandler(event:IndexChangeEvent):void { //is already selected? var item:Object = myList.selectedItem; if(!item.isChecked) { //deselect the other one? var length:int = myList.dataProvider.length; var oldItem:Object; for(var i:int = 0; i &lt; length; i++) { oldItem = myList.dataProvider.getItemAt(i); if(oldItem.isChecked) { oldItem.isChecked = false; myList.dataProvider.itemUpdated(oldItem); break; } } //select new one item.isChecked = true; myList.dataProvider.itemUpdated(item); } //pop view navigator.popView(); } </code></pre> <p>I think the problem is in the myList.dataProvider.itemUpdated(oldItem), apperently the renderer thinks it has to redraw everthing, but I have no idea why.. and why only after the view is shown again...?</p> <p>Any ideas if it's a bug or something? how can I get rid of this bahavior or how can I debug this this properly? thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload