Solved

Panel scrolling problem in Adobe Flex 3

Posted on 2008-10-01
5
1,820 Views
Last Modified: 2012-05-05
Currently, I have an object that extends the Panel class in Flex.  In that object, I add a child that is an object that extends the Canvas class.

My problem is when the Canvas object is getting rendered, and it's larger than the parent Panel object, I get several different problems depending on if the Canvas object has children.

If the Canvas object does NOT have children and it's larger than the parent Panel object, it's drawn OVER the Panel object.  

If the Canvas object DOES have children and it's larger than the parent Panel object, the Canvas objects does NOT draw over Panel object. However, in both scenarios, the scroll bars on the parent Panel object do not take effect and display.

I have the set the "clipContent" property on the parent Panel object to true. I have turned OFF the horizontal and vertical scrolling properties on the child Canvas object, in order to keep the scroll bars from showing there.  The scroll bars on the Canvas object actually do work. However, that's not the intended result I want.

I need help getting the scroll bars to show and work on the parent Panel object.
0
Comment
Question by:ljthomas324
  • 2
  • 2
5 Comments
 
LVL 19

Expert Comment

by:Gary Benade
ID: 22718470
If you haven't solved this yet please post the mxml you are testing with.
0
 

Expert Comment

by:sinfree
ID: 22844305
I'm seeing a very similar bizarre problem, so you aren't going crazy :).  I think it is probably a related (or the same) issue, maybe a flex bug.

I have a class that extends a panel, and it has a bunch of children who each extend canvas.  When I add them to the the canvas, the children start drawing beneath the panel header, and if there is a scroll bar, it overlaps the panel header (very ugly).  I tried adding a top padding, which got the children out from under the panel header, but the scroll bar is still all wacky.  My code is rather simple, and I don't see anything strange to cause this problem.  I'll let you know if I stumble across a solution to my issue.

 

public class MyClass extends Canvas

{

  ...

}
 

public class CustomPanel extends Panel

{

  ...

  var foobar:MyClass = new MyClass();

  addChild(fooBar)

  // add several more children of type MyClass

  ...

}

Open in new window

0
 
LVL 19

Expert Comment

by:Gary Benade
ID: 22848001
I can't replicate the problem in flex builder 3.0.1

Change the code below so that it breaks and post it back
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">

	<local:MyPacel width="364" height="366">

		<local:MyCanvas width="351" height="140" borderStyle="solid">

			<mx:DataGrid width="1000" height="100">

				

			</mx:DataGrid>

		</local:MyCanvas>

		<local:MyCanvas width="351" height="63" borderStyle="solid">

			

		</local:MyCanvas>

		<local:MyCanvas width="417" height="44" borderStyle="solid">

			

		</local:MyCanvas>

		<local:MyCanvas width="346" height="29" borderStyle="solid">

			

		</local:MyCanvas>

		<local:MyCanvas width="351" height="63" borderStyle="solid">

			

		</local:MyCanvas>

		<local:MyCanvas width="351" height="63" borderStyle="solid">

			

		</local:MyCanvas>

	</local:MyPacel>	

</mx:Application>
 

//MyCanvas.as

package

{

	import mx.containers.Canvas;

	

	public class MyCanvas extends Canvas 

	{

		public function MyCanvas()

		{

		}
 

	}

}
 
 

//MyPacel.as

package

{

	import mx.containers.Panel;

	

	public class MyPacel extends Panel

	{

		public function MyPacel()

		{

		}
 

	}

}

Open in new window

0
 

Expert Comment

by:sinfree
ID: 22848023
I found a solution to making the a child component of a panel to display it's scrollbar.  Simply set it's minHeight to 0.  So my problem is taken care of.  The issue is covered here:

http://bugs.adobe.com/jira/browse/SDK-13884

I'm not sure if this addresses the original problem in this thread or not, but hopefully it helps.
0
 

Accepted Solution

by:
ljthomas324 earned 0 total points
ID: 22850746
I fixed my problem.  

What fixed it is overwriting the measure() method in my class that extends the Canvas class.

Check out the code snippet.  This caused the scroll bars to show up in my Panel sub-class.
override protected function measure():void 

{

    super.measure();

            

    measuredMinHeight = parent.height;

    measuredMinWidth = parent.width; 

}

Open in new window

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now