Read data from PHP into List Control of Flex.

January 8, 2008

This is similar to that of “read data into combobox control from PHP ” i posted on the other day.

Whatever let me explain this also.

First the PHP page looks like this.

<PRODUCT>

<TYPE name=”kumar”/>

<TYPE name=”Gandhi”/>

</PRODUCT>

Now we have to use the HttpService and list control in flex to get the data into.

<mx:HttpService id=”srvMain” url=”one.php” useProxy=”false”/>

<mx:List id=”mylist” dataProvider=”{srvMain.lastResult.PRODUCT.TYPE}” dataField=”name” />

Now the data from PHP sits into the List Control.The main thing to remember here is that the Properties dataProvider (List control),dataField(List Control).

Thats all for now Leave any comments for suggestions.