5 Replies Latest reply on Jul 23, 2007 6:12 PM by gniit

    objects can't be refereneced once inside accordion

    dex002
      Hi, I have a simple function to add together the selection of 3 horizontal list controls. The function worked when the HL's were on there own in a panel, but then I put them in their own Vbox in an Accordion control. Once I did this, the function couldn't reference the variables anymore, as though the HL's no longer existed. Can anyone help me??
        • 1. Re: objects can't be refereneced once inside accordion
          rotoole
          the reason they aren't working or your getting null reference errors is because they technically don't exist yet until that accordian tab is viewed. you need to call your function to populate the lists on the change property of the accordian depending on which tab is being viewed using the myAccord.selectedIndex property. If you only need to that once for each tab you can troubleshoot with some boolean vars or somehting of that sort to make sure you don't keep trying to get new dataProviders over and over on every change.
          • 2. Re: objects can't be refereneced once inside accordion
            ntsiii Level 3
            Yes, this is called "deferred instantiation" and its purpose is to make the initial load of the app faster, since only visible items are rendered.

            While it is strongly discouraged, you can force rendering of all children by setting creationPolicy="all" on the Accordion.

            Tracy
            • 3. Re: objects can't be refereneced once inside accordion
              Hi,

              I'm facing a similar issue with accordion. When I try to use binding in the controls placed inside the accordion they don't display the values unless I use creationPolicy="all". Even the first tab doesn't display the values. I thought the first tab was always instantiated by default, but it doesn't seems so. Can anyone please shed a light on this ??
              • 4. objects can't be refereneced once inside accordion
                rotoole Level 1
                creationPolicy="all" !!!!!!

                i know that that it's "bad technique" but that definitely saves some workarounds that aren't needed sometimes.

                thanks for the obvious tip that i missed!!
                • 5. Re: objects can't be refereneced once inside accordion
                  Level 1
                  I'm trying to avoid creationPolicy=all as I have a lot of controls, and it's very slow to load.

                  Why couldn't there have been something like creationPolicy="control.indexvalue" or an array so that you can initialize which ever component, well that's my winge for now.

                  but I would really love to see something like this in the next version.;-)