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}” labelField=”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..
Correction are made to this post Plz refer the Below link::

it doesn’t work!
Hi Jerry,
It should work , plz check the code once again , or can you paste your code sample here so that i can have a glance and make some suggestions.
regards,
kumar.
I get an error that dataField does not exist. The thing is I am using Flex 3 so i am not sure I can use your example!
Thanks
Can you paste your code sample here .!
regards,
kumar.
Not working for me either.
Flex 3.0:
Php output, saved as .xml file for testing:
Kumar said:
It works fine and should work , r u getting any error message , r u sending the Httpservice , the code is correct.Plz have a look .
I don’t get an error message, the file is in the same directory, I don’t know what you mean by “sending the Httpservice”. The combobox just doesn’t get populated.
When you say “It works fine,”, whose code are you referring to, mine or yours?
Mine does not work.
Hi guys,
i tried this example. It worked. Only think i did was made few changes to the php page.
below is the php code to display states in XML format:
$sql = “select distinct state from schedule”;
$queryexe = odbc_do($connectionstring, $sql);
$cnt = 0;
$Return .= “”;
while(odbc_fetch_row($queryexe)){
$state = odbc_result($queryexe, 1);
$Return .= “”.$state.”";
}
$Return .= “”;
echo “$Return”;
MXML file:
MXML file:
Well, I figured it out.
The application tag needs a creationComplete=”search.send()”
Maybe you should specify this in your little blog post so newbies can actually use your example.
Thanks!
[...] post missed one line as it was pointed out in the comment , the line is to send the HttpService you are [...]
Thanks
your welcome. And there’s another post relating to this with correction plz refer that.,and the link for that is above your comment.
regards,
kumar.
This doesn’t work form me,
flex3 tells me that dataField isn’t a property of Combobox
There are some mistakes in this post and I have corrected them.
Plz do refer the below link.
http://flexonblog.wordpress.com/2008/06/21/reading-data-in-to-combobox-from-php-page-corrections/
And link is provided in this post also.Just added.
.. For any queries message.
regards,
kumar.
I think you should point out the another side of the topic too… Hats Off to the discussion.
ok i will plan that too.Thanks.
regards,
kumar.
Hi,
I want to show users with with their id as a value and user name as a text in combo box. I have created one file that returns data in xml format but i am not able to assign value to every option in combo box.
Will u plz send me a simple example for this
Thanx in advance
Regards,
Pradip Jadhav
Sorry for late reply, i will mail you some code examples, hope it will help you.
regards,
kumar.
Hello Kumar,
I want to call One Mxml File From Another File Just like if i am on login.html and after successful login i redirects to welcome.html. Just like this i want to call welcome.mxml after successful login.
So is there any way to call other mxml file from one file….?
Thanx in advance…….:)
Regards,
Pradip Jadhav
Hi,
Hence Flex is not document driven App we have views, the UI is divided into different views and these are views are made with different Components like TitleWindow,Canvas,Panel,..to CustomComponents , and these are loaded in to the App.So for your kind we can use States and Transitions in Flex they are very useful in this kind,just explore them you will find good example on that NP.
regards,
kumar.
Thanx a lot Kumar………….
One more problem i am using datagrid in which i am showing list of users. In my datagrid there is last column having text as a Edit User.
Now on clicking Edit User i want to call one function having parameter as as userId of current record.
I am not getting how to pass UserId of current record to function…
Will u please help me………?
Thanx in advance
Regards,
Pradip Jadhav
Hi,
the current selected record can be accessed like , dg.selectedItem , if dataField of that column is USERID then it would look like, dg.selectedItem.USERID , it contains the selected userid as per your example.Note here dg is the id of the DataGrid.
regards,
kumar.
I couldn’t make it work… here are my codes
https://sites.google.com/site/dudassobreflex/
I hope you can help me
Hi,
I checked your code and use this as dataProvider in to your ComboBox.
dataProvider=”{clients.lastResult.clientes.cliente}”
rest everything is fine and now it will work.
regards,
kumar.
sum1 plz help i wnt the codin to calculate options/combobox(vat calculator) dnt be suprised stil learnin
I’ve been trying to explain the exact thing to my pals but I think it’s better if I just email them the link to this site instead! Thanks for writing such an insightful post.Nice one.
first i convey my wishes ur blog is very very good
i need one help
i want insert item xml
i give xml format
i want additem at below this element
I have try an example to click on one combobox & display dat related that combobx display in another combobox.. in php
fo eg.. if i select one state in one combobox then display related district for that state in another state…..