Select to view content in your preferred language

Issue of verticalScrollPolicy

830
3
Jump to solution
07-10-2012 10:37 AM
ShaningYu
Honored Contributor
In a widget, the code like that below:
<viewer:WidgetTemplate id="wTemplate" width="340" height="440"
         closed="wTemplate_closeHandler(event)"
         open="wTemplate_openHandler(event)" >

  <mx:VBox verticalScrollPolicy="on" width="100%" height="100%" >
                         ......
But the verticalscrollbar does not work.  How to make it work?  Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
ShaningYu
Honored Contributor
Solved by multiple times of width setup.  Thanks.

View solution in original post

0 Kudos
3 Replies
BjornSvensson
Esri Regular Contributor
<mx:VBox verticalScrollPolicy="on" width="100%" height="100%" >
......
But the verticalscrollbar does not work.  How to make it work?


I don't know why that isn't working, but (depending on which Flex SDK Version you are using)... any reason you couldn't sparkify the widget and remove the mx? That's what we been doing in the Flex Viewer source code - using Spark and <s:Scroller> instead of mx.

See for example the source code for the Bookmark Widget:
https://github.com/ArcGIS/ArcGISViewerForFlex/blob/master/src/widgets/Bookmark/BookmarkWidget.mxml

Read more about the Scroller component on http://help.adobe.com/en_US/flex/using/WSb04c7610c3432839-13869d09121418556f1-7ffc.html
0 Kudos
ShaningYu
Honored Contributor
Dear bjorn:
Thanks for your response.  If I use the code your recommended, the red-cross small icon displays on the Desing Mode view, which makes me very hard to code.  In my script, the code likes that:

  <viewer:WidgetTemplate id="wTemplate" width="340" height="440"
         closed="wTemplate_closeHandler(event)"
         open="wTemplate_openHandler(event)">

  <mx:VBox verticalScrollPolicy="auto" width="100%" height="100%" backgroundColor="0x0F8F8F">
  
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>   
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
   <s:HGroup horizontalAlign="left">
    <s:Label text="1)  Click the tool icon to open the widget."/>
   </s:HGroup>
  </mx:VBox>

</viewer:WidgetTemplate>
</viewer:BaseWidget>

Is it possible for you to paste it into yours and see what should be done to fix it?  Thanks.
0 Kudos
ShaningYu
Honored Contributor
Solved by multiple times of width setup.  Thanks.
0 Kudos