2 Replies Latest reply on Sep 2, 2009 11:36 PM by kgpatel

    List with item renderer using the tile layout

    kgpatel

      Hello

       

      I am facing problem using list with item rnder

       

      Below is my list componet

       

      protected function list_clickHandler(event:MouseEvent):void
                  {
                      var list : List = List(event.currentTarget);
                        // the data of the clicked row, change the name of the class to your own
                        var item :Image = Image(list.selectedItem);


                }

       

      <s:List id="list" dataProvider="{dataProver}" height="100%" width="100%"
                  selectionChanged="list_selectionChangedHandler(event)"
                  mouseDown="list_clickHandler(event)"  >
                      <s:layout>
                          <s:TileLayout requestedColumnCount="3"
                                  requestedRowCount="4"
                                  horizontalGap="35"
                                  verticalGap="35" columnWidth="100" rowHeight="100"
                                   />
                       
                      </s:layout>
                     
                      <s:itemRenderer>
                          <fx:Component>
                                      <mx:Image height="100%" width="100%" source="{data.Image}" scaleContent="false"/>
                          </fx:Component>
                      </s:itemRenderer>
                     
                                   
              </s:List>

       

      I an not getting the current item of the list ,, and geeting err ,, selected index == -1 ;;

       

      aslo in flex 4 there is not the properrty like

      indexToItemRenderer

       

       

      var rowRenderer : UIComponent = UIComponent(list.indexToItemRenderer(list.selectedIndex));