tags:

views:

156

answers:

2

I have a List, that is not showing any items until you scroll, then the items show up. Does anyone know how to fix this? I tried calling list.invalidateDisplayList(); and list.invalidateList(); But with no luck.

Any ideas?

Thanks.

EDIT: Here is some code:

<mx:Script>
    <![CDATA[

     [Bindable]
     private var _xmlList:XMLList = new XMLList();


     override public function set data(value:Object):void
     {
       this.setStyle('borderColor','#cc6666');
      var xmllist:XMLList = XML(value).children();
      _xmlList = xmllist;
     }

    ]]>
</mx:Script>

<mx:List id="list" width="100%" height="100%" labelField="@user" dataProvider="{_xmlList}" itemClick="onItemClick(event)"/>

I found that if I add creationComplete="{list.dataProvider = _xmlList }" It solves the problem.

+1  A: 

You might try calling:

list.validateNow();

This causes an inline, synchronous control refresh. The invalidateDisplayList() call just tells the control that the next time it's drawn, it should re-compute the display list. It doesn't force the refresh immediately.

Matt Dillard
+1  A: 

Also trying adding

super.data = value
cliff.meyers