Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Panel scrolling problem in Adobe Flex 3

Posted on 2008-10-01
5
Medium Priority
?
1,840 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

715 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