Load Content into TextInput Flex?
I've got content coming into my application using a query and an ArrayCollection. I know how to display the content into a DataGrid by using the dataProvider propriety, but I'd like to use TextInput components and drop the DataGrid altogether.
Does anyone have any examples or information on how I would go about doing this?
Thanks!
Thank you for the insight - invertedSpear
I'm still having a problem all that displays is [object,object]
Here is a bit of my code.
开发者_Go百科 [Bindable]
private var acCon:ArrayCollection;
private function reData():void //RETRIEVE DATA
{
var stmt:SQLStatement = new SQLStatement();
stmt.sqlConnection = sqlConn;
stmt.text = "SELECT * FROM person";
stmt.execute();
var result:SQLResult = stmt.getResult();
acCon = new ArrayCollection(result.data);
}
<mx:Repeater id="repeater1" dataProvider="{acCon}">
<mx:Label id="Label1" text="{repeater1.currentItem}"/>
</mx:Repeater>
Any thoughts?
Your question is not clear. The format of your query result and exactly how you are wanting to display them make a difference in this.
Things you need to do no matter what the format.
1) make sure you have a bindable variable to store your query result in:
[Bindable] public var myArrayCollection:ArrayCollection = new ArrayCollection();
2) assign you query result to this.
3) probably going to need to use a loop or a repeater based on your results length, not sure what your result looks like so you will have to figure this out.
4) assign the values to text boxes.
<mx:Text text="{myArrayCollection.FieldName}">
This answer is my best guess to what your question is. Please edit your question to make it more clear if this answer doesn't work for you.
Looking at your code example that's now up I am guessing you are very close, your repeater is kind of like your query result. Current item is like a row of your query. you probably just need to add the field name to it. So Maybe:
<mx:Label id="Label1" text="{repeater1.currentItem.LastName}"/>
精彩评论