3 Replies Latest reply on Feb 20, 2011 11:50 PM by Flex harUI

    Why won't my scroller work in this popup window?

    JoshBeall Level 1

      Hi All,

       

      I've got the following component:

       

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Panel xmlns:fx="http://ns.adobe.com/mxml/2009" 
                 xmlns:s="library://ns.adobe.com/flex/spark" 
                 xmlns:mx="library://ns.adobe.com/flex/mx" width="850" height="400"
                 creationComplete="creationCompleteHandler(event)">
           <fx:Script>
                <![CDATA[
                     import flashx.textLayout.conversion.TextConverter;
                     
                     import mx.events.FlexEvent;
                     import mx.managers.PopUpManager;
                     
                     import spark.utils.TextFlowUtil;
      
                     protected function creationCompleteHandler(event:FlexEvent):void
                     {
                          mainText.textFlow = TextConverter.importToFlow(html,TextConverter.TEXT_FIELD_HTML_FORMAT);
                     }
      
      
                     protected function closeButton_clickHandler(event:MouseEvent):void
                     {
                          PopUpManager.removePopUp(this);
                     }
      
                ]]>
           </fx:Script>
           <fx:Declarations>
                <fx:String id="html"><![CDATA[
      <p>A bunch of html here</p>     
                ]]></fx:String>
           </fx:Declarations>
           <s:Scroller id="scroller" width="100%" height="100%" hasFocusableChildren="true">
                <s:Group>
                     <s:layout>
                          <s:VerticalLayout paddingBottom="20" paddingLeft="20" paddingRight="20" paddingTop="0" />
                     </s:layout>
                     <s:RichEditableText editable="false" width="100%" height="100%" id="mainText" />
                     <s:HGroup horizontalAlign="right" width="100%">
                          <s:Button id="closeButton" click="closeButton_clickHandler(event)" label="Close" />     
                     </s:HGroup>
                </s:Group>
           </s:Scroller>
      </s:Panel>
      
       
      

       

       

      But the scroller isn't working.  I've tried getting rid of the height on the component (set to 400 in my example), making the height 100%, making the height 90%, getting rid of the height and using buttom/top values of 20.  Nothing works, the scroller is never available to scroll my content.

       

      What I really want is for the window to be about 90% the height of the browser viewport, and for scrollbars to only show if the viewport is visible.