Couple things to try:
- set an explicit width and height on your itemRenderer, even 100%
- set the scrollRect on the list to be the rect of the list
 
----- Original Message -----
Sent: Monday, July 10, 2006 12:27 PM
Subject: [flexcoders] Flex2: Problem with list item renderers in a popup title window

Hello Flexcoders;

 

I have a TitleWindow whose only child is a List. The List uses a custom itemRenderer that just draws an HBox with a TextLabel inside. This all works as expected. However, if I use PopupManager to create a popup using the TitleWindow sublass, there are problems.

 

When scrolling the list down, an extra itemRenderer is drawn above the bounds of the list. Likewise, when scrolling up, an itemRender is drawn below the bottom bounds of the List. I tried setting clipContents on the TitleWindow to “true”, but that made no difference.

 

This problem only occurs when the TitleWindow is “popped up”. Does anyone have an idea what I can do to fix this?

 

Thanks.

Tobias.

 

Here’s a simple application that reproduces the problem:

 

<?xml version="1.0" encoding="utf-8"?>

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

            creationComplete="OnLoad()">

           

            <mx:Script>

                        <![CDATA[

                                    import mx.managers.PopUpManagerChildList;

                                    import mx.managers.PopUpManager;

                                    private function OnLoad() : void

                                    {

                                                var win : MyTitleWindow = MyTitleWindow( PopUpManager.createPopUp(

                                                            this, MyTitleWindow, false, PopUpManagerChildList.POPUP ) );

                                                win.title = "Popup Title Window";

                                   

                                                PopUpManager.centerPopUp( win );

                                                win.y *= 1.5;

                                    }

                        ]]>

            </mx:Script>

           

            <local:MyTitleWindow title="Title Window"/>

</mx:Application>

 

 

-------- MyTitleWindow.mxml --------

 

<?xml version="1.0" encoding="utf-8"?>

<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"

            layout="vertical"

            width="400"

            height="300">

 

            <mx:ArrayCollection id="ac">

                        <mx:String>One</mx:String>

                        <mx:String>Two</mx:String>

                        <mx:String>Three</mx:String>

                        <mx:String>Four</mx:String>

                        <mx:String>Five</mx:String>

            </mx:ArrayCollection>

 

            <mx:List width="100%"

                        height="100%"

                        borderStyle="none"

                        dataProvider="{ac}">

                        <mx:itemRenderer>

                                    <mx:Component>

                                                <mx:HBox height="100"

                                                            borderStyle="solid"

                                                            verticalAlign="middle">

                                                            <mx:Label text="{data}"/>

                                                </mx:HBox>

                                    </mx:Component>

                        </mx:itemRenderer>

            </mx:List>

           

</mx:TitleWindow>

Kodak Graphic Communications Canada Company

Tobias Patton | Software Developer | Tel: +1.604.451.2700 ext: 5148 | mailto:[EMAIL PROTECTED] | http://www.creo.com

 

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to