Hi Alexandra,
Thanks. I’m using version 2.5. The version i downloaded has the example what you have said. Based on the example i did, but it is not working. Let me clear you one thing.
Instead of dropdown, i’m using this script,
var z = new dhtmlXCombo(“loctype”,“alfa1”,200);
z.enableFilteringMode(true);
z.loadXML(“Location.jsp”);
The above code is working fine. filtering is happening. data is being populated in the combo only once. But i want the combo to work in autocomplete mode.
For that i’m changing the code as,
var z = new dhtmlXCombo(“loctype”,“alfa1”,200);
z.enableFilteringMode(true,“Location.jsp”,true);
This Location.jsp will create an xml, which will have the data for the drop down.
My Location.jsp is as follows,
<?xml version="1.0" encoding="UTF-8" ?>
<@page contentType=“text/xml”; charset=“UTF-8” %>
<@page language=“java”,import=“java.sql.*;”>//includes all necessary classes.
<%
Connection conn=null;
String url=“jdbc:mysql://192.0.8.78:9999”;//here i’m giving a false data
String dbname=“sa”;
String password=“password”;
class.forName(“conn.mysql.jdbc.Driver”).newInstance();
conn.DriverManager.getConnection(url+dbname+password);
PrepareStatement stmt=null;
ResultSet rs=null;
String sql=null;
int v_loc_type_code=0;
String v_loc_type_desc="";
sql =" select loc_type_code, loc_type_desc from genl_location_type";
stmt=conn.prepareStatement(sql);
rs=stmt.executeQuery();
while(rs.next())
{
v_loc_type_code=rs.getInt(“loc_type_code”);
v_loc_type_desc=rs.getString(“loc_type_desc”);
out.print("<option value=""+v_loc_type_code+"">");
out.print(v_loc_type_desc);
out.print("");
}
rs.close();
stmt.close();
%>
The above code generate a xml file for the drop down data.
But in the documentation it is given that complete.php is working as an additional script for an preloaded combo, and the sql code in php has like command.?
1.Without any additional script cant we make the combo to work under autocomplete mode
2.Problem with the version?
3. For the combo i want the table data loaded from an xml and combo should work in auto complete mode.
But, here data is getting loaded more than once. And if i press any letter suggestion or selection from the combo is not happening for the below code.
var z = new dhtmlXCombo(“loctype”,“alfa1”,200);
z.enableFilteringMode(true,“Location.jsp”,true);
Very sorry for a lengthy question.
Thanks in advance,
Vigneshwarie