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.
No Comments » |
Flex and PHP related.. | Tagged: data from php to list control, Flex and PHP related.. |
Permalink
Posted by kumargandhi
January 7, 2008
First the PHP page looks like this:
echo “<search>”;
echo “<type name=’kumar’ />” ;
echo “<type name=’gandhi’ />” ;
echo “</search>”;
here we have to send data from PHP page in this format.Then to take data in to ComboBox we have to use a HTTPService and dataProvider Property of the ComboBox control.
<mx:HttpService id=”search” useproxy=”false” url=”first.php”/>
<mx:ComboBox id=”searchbox” dataProvider=”{search.lastResult.search.type}” dataField=”name” />
Here in the dataField property specifies which attribute value you wanted from the list.
Here name is the attribute of the <type> tag in PHP and that data i wanted it in the ComboBox list.thats it its simple and small try it..
Leave any comments for suggestions..
10 Comments |
Flex and PHP related.. | Tagged: Flex and PHP related.. |
Permalink
Posted by kumargandhi
January 5, 2008
First the data in PHP looks like this–
echo “<CALCU>”;
echo “<CALCUS>”;
echo “<ID>”1232″</ID>”;
echo “<AMTSPE>”12365″</AMTSPE>”;
echo “<DATE>”2007/11/11″</DATE>”;
echo “<DESCRY>”hai”</DESCRY>”;
echo “</CALCUS>”; .
echo “</CALCU>”;
Now to get this data into Flex app we got to use HttpService(there are other services) and a property result in it..
<mx:HTTPService id=”srvMain” useProxy=”false” showBusyCursor=”true”
fault=”httperror()” result=”readmeMain(event);”/>
now the result will be fetched into event so to get it define the method as mentioned in the result property of the httpService.. as below..
private function readmeMain(event:ResultEvent):void
{
var amountspe:String=new String;
amountspe=event.result.CALCU.CALCUS.AMTSPE;
}
Now the string amountspe contains the valuse sent by the PHP page(particular as given in colors).
Similarly get other values into strings or inputs..
No Comments » |
Flex and PHP related.. | Tagged: data from PHP to Flex, Flex and PHP related.. |
Permalink
Posted by kumargandhi