Tuesday, 27 August 2013

How do I add a scroller to a List in Flex Mobile

How do I add a scroller to a List in Flex Mobile

I am fairly new to Flex Mobile development and I wanted to add a vertical
scroll bar to the view below. How do I do that? No matter what I have
tried from the examples I have seen I cannot get the scroller to show
up....
Here is my view code...
import mx.events.FlexEvent;
[Bindable]private var resultArr:ArrayCollection = new
ArrayCollection();
import mx.collections.ArrayCollection;
protected function vw_creationCompleteHandler(event:FlexEvent):void
{
}
[Bindable(event="myDataChanged")]
private function get myData():ArrayCollection
{
// stmt.text = "SELECT DMN_NAME FROM DOMAIN WHERE
DMN_ID = :id";
var conn:BaseSql = new BaseSql();
conn.stmt.text = "SELECT DMV_VALUE_1 FROM DOMAIN_VALUE";
var x:SQLStatement = new SQLStatement;
//x.parameters[":id"] = id;
x.sqlConnection = conn.stmt.sqlConnection;
x.text = conn.stmt.text;
x.execute();
var result:Array = x.getResult().data;
var r:ArrayCollection = new ArrayCollection();
if (result)
{
r.source = result;
return r;
} else {
return null;
}
}
]]>
</fx:Script>
<s:List id="list" top="0" bottom="0" left="0" right="0"
width="200%" height="200%"
verticalScrollPolicy="on" horizontalScrollPolicy="off"
pageScrollingEnabled="true"
dataProvider="{myData}" labelField="DMV_VALUE_1">
</s:List>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>

No comments:

Post a Comment