Hi, My code is this.
<?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="projectsSrv.send()" > <fx:Declarations> <s:HTTPService id="projectsSrv" url="http://localhost:8080/php/test.php" useProxy="false" method="POST"> </s:HTTPService> </fx:Declarations> <fx:Script> <![CDATA[ import spark.events.IndexChangeEvent; private function send_data():void { projectsSrv.send(); } ]]> </fx:Script> <s:ComboBox x="43" y="90" id="cmb1" dataProvider="{projectsSrv.lastResult.entries.date}" /> <s:Label x="45" y="78" text="Select Account"/> <s:TextInput x="43" y="121" id="username" text="test"/> </s:WindowedApplication> The PHP Code is <?php $connection_string = "DRIVER={SQL Server};SERVER=TSERVER\SQLEXPRESS;DATABASE=COMRADEERP6"; $user = "sa"; $pass = "QDCqdc123"; $connection = odbc_connect( $connection_string, $user, $pass ); if($connection) { $sql = "select acctype,groupdes from asgrp WHERE LEFT(ACCTYPE,2)='12'"; $result=odbc_exec($connection, $sql); $xml_output = "<?xml version=\"1.0\"?>\n"; $xml_output .= "<entries>\n"; for($x = 0 ; $x < odbc_num_rows($result); $x++) { $row = odbc_fetch_array($result); $xml_output .= "\t\t<date>" . $row['acctype'] . "</date>\n"; $xml_output .= "\t\t<date>" . $row['accountname'] . "</date>\n"; } $xml_output .= "</entries>"; echo $xml_output; } ?> First part is working properly.(combo box listing). second part,is textinput field. While i am selecting acctype from combo box, second field (ie groupdes) must shown in textinput field. Thanks Vigin Kurakar On Mon, Aug 1, 2011 at 3:32 PM, sathis kumar <[email protected]>wrote: > Put this will work! > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > layout="horizontal" > creationComplete="creationCompleteHandler(event)"> > <mx:Script> > <![CDATA[ > import mx.collections.ArrayCollection; > import mx.utils.ObjectUtil; > import mx.events.FlexEvent; > [Bindable] > private var ac:ArrayCollection; > public function creationCompleteHandler(event:FlexEvent):void > { > ac = new ArrayCollection([ > {label:15, data:"sathis"}, > {label:17, data:"ramesh"}, > {label:18, data:"suresh"} > ]); > nextCustomer.text = ac.getItemAt(1).data; > } > private function cbChangeHandler(event:Event):void > { > if((cb.selectedIndex+1)<ac.length){ > nextCustomer.text = ac.getItemAt(cb.selectedIndex+1).data; > }else > { > //looking first customer > nextCustomer.text = ac.getItemAt(0).data; > } > } > ]]> > </mx:Script> > <mx:ComboBox id="cb" dataProvider="{ac}" change="cbChangeHandler(event)"/> > <mx:HBox> > <mx:Label text="Next Member"/> > <mx:Text id="nextCustomer"/> > </mx:HBox> > </mx:Application> > > > > > > On Mon, Aug 1, 2011 at 12:45 AM, kurakar <[email protected]> wrote: > >> Hi Coders >> >> while i am selecting one item from combo box(field data retrieving >> from sql database),the corresponding another field fetching from >> database want to show in textbox. for example. >> database query is "select customernumber,customername from >> cust_table". >> customernumber is in combo box(working properly) and the while >> selecting firstitem from combobox second item want to show in textbox >> (not working). >> >> Please provide me one sample. >> >> Thanks >> Vigin Kurakar >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Flex India Community" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/flex_india?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Flex India Community" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/flex_india?hl=en. > -- You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.

