in my application i want to create a dynamic combobox data loader
that i have done successfully, but the prob is i am unable to get the
selectedItem value from combobox
i wanted to do that
can anybody suggest me for that or else send me source code
MY codings
Dynamiccombo.mxml
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
verticalGap="20" initialize="calling()" >
<mx:HTTPService id="employeeSrv" serviceName="SampleEmployeeSrv">
<mx:request>
<deptId>{dept.selectedItem.Name}</deptId>
</mx:request>
</mx:HTTPService>
<mx:Script>
<![CDATA[
function calling()
{
employeeSrv.send();
}
]]></mx:Script>
<mx:Label text="Select a department:"/>
<mx:ComboBox id="dept" width="150"
dataProvider="{employeeSrv.result.employees.test}">
</mx:ComboBox>
<mx:Button label="Get Employee List" click="employeeSrv.send();"/>
</mx:Application>
employee.jsp
String sql = "select distinct(name) from dct_test";
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection("jdbc:odbc:mydsn","sa","");
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(sql);
while(rs.next()){
String res = rs.getString(1);
System.out.println(res);
%><test><%=res%></test><%
}
if(rs != null)rs.close();
if(st!=null)st.close();
if(conn!=null)conn.close();
}
catch (Exception e)
{
System.out.println("ERROR : " + e);
}