5 Replies Latest reply on May 20, 2009 2:16 PM by firdosh

    Selecting a item in a list using a custom item renderer

    firdosh Level 1

      Hey guys,

                      so I have a TileList which uses a custom item renderer which is basically a Canvas with a Image and a TextField storingthe title name

       

      ----------------------

      |   .................  |

      |   .               .   |

      |   .               .   |

      |   .................  |

      |                     |

      |   TextField      |

      -----------------------

       

      So everything works fine if i click the item but if I click the TextField the item does not get selected by the list. I even did

       

      protected function onTextInputMouseClickHandler(event:MouseEvent):void
      {
           dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK , true, true));
      }
      
      
      private function __onTileListItemClickHandler(event:ListEvent=null):void
      {
        trace("__onTileListItemClickHandler | title = " + tileList.selectedItem.title);
      }
      

       

      But on my __onTileListItemClickHandler it always traces out the previous item that was selected and the TileList selection does not get updated.

      So basically in short items get selected when i click any part of the itemrenderer and fails when i click on the textField.

       

       

      Thanks,

      Firdosh