hi raptor, Data binding doesnot work this way when item renderers are used. An item renderer is re-used by the list. So, to get same data in data.icon and statusIcon.status, use datachange event on the itemrenderer as follows -
ListNodeRenderer.mxml ~~~ <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="22" horizontalGap="0" verticalAlign="middle" mouseOver="mouseOverHandler(event)" dataChange="changeData()"> public function changeData():void { statusIcon.source= data.icon; frndID.text = data.label; } hope that helps, Dolly On May 21, 8:36 am, rApt0r <[email protected]> wrote: > my custom component ListNodeRenderer.mxml > > <?xml version="1.0" encoding="utf-8"?> > <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" > height="22" horizontalGap="0" > verticalAlign="middle" mouseOver="mouseOverHandler(event)"> > <mx:Script> > <![CDATA[ > private function mouseOverHandler(e:Event):void { > > parentDocument.parentDocument.parentDocument.text11.text += "mouse > listNode " + this.data.label + "\n"; > > parentDocument.parentDocument.parentDocument.text11.text += "mouse > listNode " + this.data.icon + "\n"; > > parentDocument.parentDocument.parentDocument.text11.text += "mouse > listNode " + frndID.text + "\n"; > > parentDocument.parentDocument.parentDocument.text11.text += "mouse > listNode " + statusIcon.source + "\n"; > } > ]]> > </mx:Script> > <mx:Binding source="data.icon" destination="statusIcon.source"/> > <mx:Binding source="data.label" destination="frndID.text"/> > <mx:Image id="statusIcon" width="22" height="22" source="{statusImg}"/ > > <mx:Label id="frndID" text="{frndName}" width="100%"/> > </mx:HBox> > > Class where i am using it is > <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" > height="100%" color="#000000" > creationComplete="createElement()" xmlns="myComponents.*" > xmlns:local="*"> > <mx:Script> > <![CDATA[ > [Bindable] > public var frndListArray:ArrayCollection = new > ArrayCollection(); > ]]> > </mx:Script> > <mx:Canvas width="100%" height="100%" x="0" y="100" > borderStyle="inset"> > <mx:List id="frndList" width="100%" height="100%" > borderThickness="0" itemRenderer="myComponents.ListNodeRenderer" > dataProvider="{frndListArray}"/> > </mx:Canvas> > </mx:Canvas> > > and a main application mxml where i am using the above widget is > setting the data on event fire to the ArrayCollection.. > > One point to note here is. i have tried now with BInding as well but > its not working.. the mouseover event handler is displaying the > differnt data for data.icon and statusIcon.status.. which should not > be the case if its binded help me please > > On May 19, 3:29 pm, MUKESH GUPTA <[email protected]> wrote: > > > try binding the status image of item renderer with status field of > > object in arraycollection > > > On 5/19/09,dolly<[email protected]> wrote: > > > > Can you show a snippet of your code? > > > > On May 18, 9:08 am, rApt0r <[email protected]> wrote: > > >> Hi all, > > >> I am creating one chat application. in that i have used mx:List to > > >> show my friend list members and used itemRenderer to have custom node > > >> for each friend in list. I used Bindable Array Collection as > > >> DataProvider to this list. > > >> But when any person in friend list changes its status let say from > > >> available to busy. Then the person will be notified by event with the > > >> new status and i am changing that status in Array Collection also. but > > >> i am not able to change the status image in friend list for > > >> corresponding user.. in that friend node i am listening to dataChange > > >> event but its not getting fired for change of data. its getting fired > > >> for the first time i am settting data. and in that too in the event > > >> listener i am getting the same old data. but when i check if it has > > >> been updated or not after that event listener has completed execution > > >> its showing me updated data. Please help me because i am stuck here. > > >> If you guys find any better way to do it.. i.e using some other event > > >> listener. or other method let me know.. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---

