0 Replies Latest reply on Jun 17, 2009 12:17 AM by _prad

    Nested Repeater: data access

      Dear All,
      I'm a novice flex developer.  Ihave been trying to develop a sample application.
      I have been caught with a scenario and I'm completely stuck. Could you please guide me.
      Here is the snippet of my code.
      //propertyDataCollection is an ArrayCollection
          <mx:Repeater id="propertyRepeater" dataProvider="{propertyDataCollection}" >
                <mx:Panel headerHeight="5" width="780" height="165" layout="vertical">
                        <mx:VBox width="100%">
                               <mx:HBox width="100%" paddingTop="10" paddingLeft="10" horizontalGap="15">
                                    <mx:Label text="Property Id    "/>
                                    <mx:Text id="propIdText" text="{propertyRepeater.currentItem.propId}" />
                               <mx:HBox >
                                    <mx:Repeater id="imageRepeater" dataProvider="{imagesXML.image}">
                                             <mx:Image source="{imageRepeater.currentItem.@src}"
                                                        toolTip="{imageRepeater.currentItem.@alt}" click="mouse_click(event);"  />
      I have  "PropertyRepeater" and then ImageRepeater embedded within it. I'm getting all the visual coponents rendered right.
      What I need is to map the propertyRepeater.currentItem.propertyId to the image set rendered by the second repeater.
      When I click the image, I need to know which property has been clicked and do a functionality here.
      Could we do this?
      I tried the following like
      click="mouse_click(event, propertyRepeater.currentItem.valueOf());"    //Throws an error here saying Repeater cannot be executed!
      private function mouse_click(e:Event,p:Object){
      var pp:Property = p as Property;
      I also tried passing
      click="mouse_click(event, propIdText.text);"
      private function mouse_click(e:Event,p:String){
      //p is null here!
      Please help. Am I doing something wrong?