2 Replies Latest reply on Feb 7, 2008 1:40 AM by MarkofBomo

    linkbar dataprovider refresh


      I have got a viewstack (a-z list) which is populated dynamically if an entry exists under the Letter a vbox is created and populated, if not then a vbox is created and enabled set to false. When this is run first time the bound linkbar
      greys out the disabled letters and enables the right ones as expected.

      The problem comes when i need to refresh the data in use a removeAllChildremn on the viewstack and repopulate using a different list and no matter whats in the second list all the letters in the link bar are enabled.

      The linkbar dataprovider is set in the MXMXL but everything else is happening in a class. I can't seem to create a pure .as dynamic control but i can live with that.

      Anyone had anything similar.



        • 1. Re: linkbar dataprovider refresh
          Flex harUI Adobe Employee
          How are you wiring up the disabling? Maybe that logic needs to be re-run.
          • 2. Re: linkbar dataprovider refresh
            MarkofBomo Level 1

            Thanks for the response Flex harUI
            I think the refresh not happening is tied to why i can't create a dynamic linkbar.

            I have a codebehind sort of class which is usually pretty good at manipulating objects.

            posted the code JIC i'm doing something stupid.



            _vsInst = viewstack on page this is cleared with a removeAllChildren
            _lbAlpha = linkbar in MXML
            _lbAlpha1 trying to creat a dynamic linkbar without any sucess.

            private function writeInstIndex():void
            var InstIndexXML:XML

            InstIndexXML = ZincConnect.getInstance().xmlquery("CD_GetStateInst_AI " + curr_stateid.toString());

            var strAlpha:String = 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,S,T,U,V,W,X,Y,Z'
            var arrAlpha:Array = strAlpha.split(',')

            //trying to add this (_lbAlpha1) dynamically but it doesn't appear

            var _lbAlpha1:LinkBar = new LinkBar;
            _lbAlpha1.name = 'lbInst1';
            _lbAlpha1.id = 'lbInst1';
            _lbAlpha1.direction= BoxDirection.HORIZONTAL;

            //this linkbar is present in the MXMXL
            _lbAlpha.selectedIndex = -1;

            for (var i:int = 0; i<26; i++)

            var vb:VBox = new VBox();
            var lbi:LinkButton;
            var xl:XMLList;
            vb.id = arrAlpha .toString();
            vb.name = arrAlpha
            vb.label = arrAlpha .toString();
            vb.percentWidth = 99;
            vb.percentHeight = 99;

            xl = InstIndexXML.AlphaInsts.(AlphaIndex == arrAlpha
            var xlLen:int = 0;
            xlLen = xl.length();
            if ( xlLen != 0)
            for (var j:int = 0; j < xlLen;j++)

            var strInstName:String = xl.DisplayName[j].toString();
            var strOrgID:String = xl.OrgID[j].toString();;
            lbi = new LinkButton();
            lbi.label = strInstName;

            lbi.id = "iLB_"+strOrgID;
            lbi.name = "iLB_"+strOrgID;



            vb.enabled = false;


            //this linkbar is present in the MXMXL and does clear properly
            //it is bound as dataprovidr in the MXML as the next line does not
            // work.
            _lbAlpha.dataProvider = _vsInst;
            _lbAlpha1.dataProvider = _vsInst;