English 中文(简体)
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.

        [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}"/> 
问题回答

暂无回答




相关问题
Disable button tooltip in AS3

I want to disable the tooltip on certain buttons. The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?

Multiple Remote call made simultenously

I was making multiple remote calls and they are done sequentially and when I am getting a result event back it s triggering calls to all the methods with ResultEvent as an argument . I am supposed to ...

Attaching a property to an event in Flex/AS3

I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

What s a good way of deserializing data into mock objects?

I m writing a mock backend service for my flex application. Because I will likely need to add/edit/modify the mock data over time, I d prefer not to generate the data in code like this: var mockData =...

AS3 try/catch out of memory

I m loading a few huge images on my flex/as3 app, but I can t manage to catch the error when the flash player runs out of memory. Here is the what I was thinking might work (I use ???? because i dont ...

热门标签