AWTX Home | Demo | Documentation | Download | Support
Here samples of usage of the JTree applet are listed...
Simple tree:
Tree with checkboxes:
Dynamical loading - ASP code sample:
<%
parentID=Request("id")
dbDir = Server.MapPath("data.mdb")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DBQ="& dbDir &";Driver={Microsoft Access Driver (*.mdb)};FIL=MS Access;"
Set rs = Conn.Execute("select * from child where parentid=" & parentID)
do while not rs.EoF
id=rs("childid")
name = rs("name")
response.write """" & name & """,""" & id & """,""1,'" & id & "'"",0"
response.write vbCrLf
rs.movenext
loop
rs.close
%>
Dynamical loading - JSP code sample:
<%
String parentID = request.getParameter("id");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection("jdbc:odbc:jtree");
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select * from child where parentid=" + parentID);
while (rs.next())
{
String id=rs.getString("childid");
String name = rs.getString("name");
out.println("\"" + name + "\",\"" + id + "\",\"1,'" + id + "'\",0");
}
rs.close();
st.close();
conn.close();
%>
Questions or comments? Write us, you are always welcome.
Check our other products.
|