3 Replies Latest reply on Aug 6, 2010 5:18 AM by BhaskerChari

    Graphical layout anamoly

    RonnieCR7 Level 1

      Hi all,
      I am building a graphical layout by dragging a set of buttons onto the canvas and connecting them by drawing lines. I save this layout in the database(by saving their properties like (x,y) coordinates on the canvas, icon associated etc). Then i load this layout again from the database whenever i need.


      Now, the problem is, when i populate the canvas with too many buttons, which makes the canvas scrollable, the connectors(lines connecting the buttons) dont adjust to the new canvas. To be precise, once the scroll bars appear, and i scroll the canvas down, the buttons maintain their original positions, but the connectors kind of stick to the canvas and move down with it as the canvas moves making them look like some random lines drawn on the canvas.


      Can anyone tell me what i have to do to make the connectors maintain their positions along with the buttons???


      Message was edited by: RonnieCR7

        • 1. Re: Graphical layout anamoly
          BhaskerChari Level 4

          Hi Ronnie,


          Have you fixed the canvas height in which you are adding many buttons...???


          If you have fixed the height of the canvas....Remove the fixed height of the canvas and give it to another container enclosing your canvas say a VBox

          container and fix the height for VBox and make the canvas to extend to its full height without scrolling...


          So the structure should be something like below..



          <mx:VBox verticalGap="0" width="100%" height="400">

               <mx:Canvas width="100%">

                    // Your dynamic buttons are added here...Here this should should not be scrollable ..but your VBox should be scrollable so that you can see

                    // all the contents..




          Hope you got my point ...



          Bhasker Chari.S

          • 2. Re: Graphical layout anamoly
            RonnieCR7 Level 1

            Hi Bhaskar,

            You were spot on Bhaskar....

            Actually i had set the height of the  canvas to "100%". I have removed it now and it is working fine:)

            Thx a lot...

            I owe you a treat Bhaskar. U helped solve a lot of flex problems..

            • 3. Re: Graphical layout anamoly
              BhaskerChari Level 4

              Hi RonnieCR7,


              I am very glad that the solution worked for you....


              Defenitely I will take a treat then...:)



              Cheers ,