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::


April 29, 2008 at 7:53 pm |
it doesn’t work!
May 3, 2008 at 9:52 am |
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.
May 6, 2008 at 8:35 pm |
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
May 8, 2008 at 2:17 pm |
Can you paste your code sample here .!
regards,
kumar.
June 16, 2008 at 7:01 pm |
Not working for me either.
Flex 3.0:
Php output, saved as .xml file for testing:
June 17, 2008 at 3:14 pm |
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.
June 17, 2008 at 4:06 pm |
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:
June 17, 2008 at 4:06 pm |
MXML file:
June 18, 2008 at 7:20 pm |
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!
June 21, 2008 at 10:36 am |
[...] post missed one line as it was pointed out in the comment , the line is to send the HttpService you are [...]
October 9, 2008 at 11:49 am |
Thanks
October 21, 2008 at 6:01 pm |
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.
November 14, 2008 at 10:18 am |
This doesn’t work form me,
flex3 tells me that dataField isn’t a property of Combobox
November 14, 2008 at 1:56 pm |
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.
December 23, 2008 at 3:48 pm |
I think you should point out the another side of the topic too… Hats Off to the discussion.
December 25, 2008 at 5:13 am |
ok i will plan that too.Thanks.
regards,
kumar.
February 2, 2009 at 7:14 am |
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
February 6, 2009 at 4:43 am |
Sorry for late reply, i will mail you some code examples, hope it will help you.
regards,
kumar.
February 9, 2009 at 11:36 am |
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
February 9, 2009 at 3:28 pm |
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.
February 16, 2009 at 11:32 am |
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
February 23, 2009 at 10:47 am |
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.
September 1, 2009 at 7:00 pm |
I couldn’t make it work… here are my codes
https://sites.google.com/site/dudassobreflex/
I hope you can help me
September 2, 2009 at 4:05 am |
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.