1 Reply Latest reply on Apr 25, 2010 12:07 AM by Flex harUI

    Regarding List control

    Mani S

      Hi,

       

      I tried to create a list control dynamially (without setting height for that list and i set rowCount as 10) as child of another control consider textInput. but list is not visible. when i set height for that list, then its visible in view.

       

                private var lis:List;

       

                private function init()   // this function function will be called after applicationComplete event (i also tried in creationComplete event) in MXML

                {

                      var ti:TextInput = new TextInput();
                      ti.width = 242;
                      ti.x = 50;
                      ti.y = 50;
                      ti.height = 22;
                      this.addChild(ti) ;


                      lis = new List();
                      lis.x = 50;
                      lis.y = ti.y+22;

                      lis.width = 242;
                      lis.dataProvider = collectionArray; // here collectionArray is a Array variable contains value for that dataprovider
                      lis.rowCount = 5;
                      ti.addChild(lis);


                      ti.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownHandler);
                  }  

             
                  private function onKeyDownHandler(evet:Object):void
                  {       
                    //  lis.height =  200; if i set the height then list will be visible on view
                  }

      i want to display the list based on the rowCount property not on the height property. Can any one help me?

       

      Thanks in advance,

      Mani.S