Hello, folks,
I am developing a Java application and realized that I need
some advice. My application is simple:
I have a MSSQL server, tomcat 5.5 ,flex data services.
In my application , i have two combo boxes.. country, town..
i have populated the country combobox with the values from
DB(country table) obtained using the fill(List ListArgs) in
Assembler Class.
Now, based on the country selected in have to populate my
town combobox from (town table)
How can i populate the town combobox from the DB based on the
country code?
Is there any function to pass the selected index and populate
the town combo box..????
My code is as below:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"layout="absolute" >
<mx:DataService id="ds" destination="quick-search-country"
autoCommit="false" autoSyncEnabled="false"/>
<mx:DataService id="tds" destination="quick-search-town"
autoCommit="false" autoSyncEnabled="false"/>
<mx:ArrayCollection id="cntry_list"/>
<mx:ArrayCollection id="town_list"/>
mx:Panel layout="absolute" backgroundColor="#c6daf5"
verticalCenter="0" horizontalCenter="0">
<mx:Form id="SearchForm">
<mx:TabNavigator >
<mx:Canvas label="Hotel" width="339" height="234"
backgroundColor="#ffffff">
<mx:Label x="10" y="91" text="Country :" alpha="0.12"
/>
<mx:ComboBox x="93" y="89" fontSize="10" id="Country"
dataProvider="{cntry_list}"
labelField="countryName"
creationComplete="ds.fill(cntry_list)"
change="tds.getItem(Country.selectedItem)" prompt="United
Kingdom" >
</mx:ComboBox>
<mx:Label x="10" y="126" text="Town / City :"
fontFamily="Georgia" alpha="0.12"/>
<mx:ComboBox id="town" x="94" y="124" fontSize="10"
dataProvider="{town_list}"
labelField="townName" prompt="London WC1" >
</mx:ComboBox>
</mx:Canvas>
</mx:TabNavigator>
</mx:Form>
</mx:Panel>
</mx:Application>
this is my main.mxml . I have CountryAssembler to fill the
country combo and a DAO class . Have a Town assembler..
Please advice me on how to populate the town combo based on
country selected from the DB...
I am really stuck up... and also dont have any documentation
on Flex data services with Java support..
please give me some suggestions on this.
Thanks in Advance,
Ambili