4 Replies Latest reply on Nov 7, 2006 5:54 AM by Vrieskist

    Accordian Containers

    JennHysuick Level 1
      I have a question about accordian containers. I currently have an accordian with two child containers. Each one contains a list box that I populate from a database on load of the page, and each one has a form that can be filled in.
      The first problem that I'm encountering is that on load, I get an error that it cannot populate the list box on the second child (the first one is open on load), but yet once I dismiss the error, the box has been populated.
      The second problem is one I found during testing - if you click "submit" right after the form loads, it throws an error that it can't find the form on the second child, but if after I load the form, I view all the children forms, and then submit (still not filling anything in), it works just fine. I'm guessing both of these issues must have something to do with initialize the forms/containers some how, but I'm not sure what to do in my code to make it work.
      I kinda found a work around to the first problem - in the list boxes, I have specified each control (listA and listB), with dataProvider={myList}, and in the actionscript function, I only tell it listA.dataProvider = myList (if I make both listA and listB.dataProvider = myList, I get the error, but this way seems to work, but I don't know why).

      Any one have any ideas???

      Thanks!
      Jenn
        • 1. Re: Accordian Containers
          mac_martine Level 1
          on the Accordion, set creationPolicy=all. This will make everything accessible once it's loaded.
          • 2. Re: Accordian Containers
            JennHysuick Level 1
            mac_martine

            Thank you so much for your reply - worked like a charm! The more work I do with Flex, the bigger it seems to get, and it will take a LONG time to figure all the properties out!
            • 3. Re: Accordian Containers
              ntsiii Level 3
              Be aware that creationPolicy="all" is a meat cleaver approach to what should be surgery.

              Tracy
              • 4. Re: Accordian Containers
                Vrieskist
                Because I ran into the same problem I found this topic. But it just doesn't seem to work for me. I made a very simple example in which it doesn't work:



                <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
                <mx:Accordion width="200" height="242" creationPolicy="all">
                <mx:Canvas id="summarytab" label="Summary" width="100%" height="100%">
                <mx:Text width="100%" height="100%" id="summarytext" text="123"/>
                </mx:Canvas>
                <mx:Canvas id="detailtab" label="Details" width="100%" height="100%">
                <mx:Text width="100%" height="100%" id="detailtext" text="asdadadasd"/>
                <mx:Canvas x="5" y="23" width="124" height="166" backgroundColor="#00ff00">
                </mx:Canvas>
                </mx:Canvas>
                </mx:Accordion>
                </mx:Application>


                the second child in the accordion doesn't preload, I would really appreciate any help on this!