I have an ActiveX treeView Control,<br>
I need to pass a node parameter (the node.name)<br>
to a textbox<br>
<br>
any Ideas??? Code Follows, notice NewNode.Key is = to strTopicTitle ----- If I could somehow pass that value...<br>
<br>
********** CODE BELOW **************************<br>
<br>
<% Response.Buffer = True %><br>
<br>
<!--#include file="adovbs.inc"--><br>
<Html><br>
<head><br>
<META name=VI60_defaultClientScript content=VBScript><br>
<title>Shore Side Tracking</title><br>
<br>
<br>
<br>
<br>
<br>
</head><br>
<br>
<Body BgColor="#FFFFFF" Link="#003366" Vlink="#006633" ALink="#000000" bgProperties=fixed><br>
<!-- Top include --><br>
<!--#include file="includes/top.inc"--><br>
<!-- End Top SSI --><br>
<br>
<Form name="treeForm" action="name.asp" method="post"><br>
<table border="0" valign="top" width="100%"><br>
<tr><br>
<td valign="top"><br>
<br>
<br>
<%<br>
Dim objConn<br>
Set objConn = Server.CreateObject ("ADODB.Connection")<br>
' Access Conection String for Development ####################################################<br>
objConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.mapPath("data/esd.mdb")<br>
'Oracle Connection String ####################################################################<br>
'objConn = "DRIVER={Microsoft ODBC for Oracle};UID=esdtav;SERVER=oracle;User Id=esdtav;PASSWORD=esdtav;"<br>
<br>
strSQL = "SELECT * " & "From xxx ORDER BY Esd_ID" <br>
'strSQL = "SELECT Parent, Esd_Name, esdtav_ID FROM xxx Where Class <> '' " & "ORDER BY Class"<br>
Set oRS = objConn.Execute(strSQL, LngRecs, 1) ' Fetch a Recordset<br>
<br>
%><br>
<br>
<%<br>
Quot = Chr(34) ' Double Quotes<br>
Crlf = Chr(10) ' Carriage return<br>
<br>
Dim sTxt<br>
Dim iDex<br>
<br>
<br>
<br>
' Setup the VbScript<br>
Response.Write "<script language=" & Quot & "VbScript" & Quot & ">" & Crlf<br>
Response.Write "Sub window_onLoad()" & Crlf<br>
Response.Write "Dim newNode, ssChild" & Crlf <br>
Response.Write "SSTree1.LabelEdit=0" & Crlf<br>
Response.Write "SSTree1.LineStyle=1" & Crlf<br>
Response.Write "ssChild = 4" & Crlf & Crlf<br>
<br>
<br>
' Setup The Root Dir, which we call "CG"<br>
Response.Write "Set newNode = SSTree1.Nodes.Add()" & Crlf<br>
Response.Write "newNode.Key =" & Quot & "CG" & Quot & Crlf<br>
Response.Write "newNode.TagVariant = " & Quot & "REPORT1.ASP?esdid=1&" & "esdname=cg" & Quot & Crlf<br>
Response.Write "newNode.Text = " & Quot & "CG" & Quot & Crlf<br>
Response.Write "newNode.Expanded = True" & Crlf<br>
Response.Write "newnode.font.size = 8" & Crlf<br>
Response.Write "newNode.Font.Bold = True" & Crlf<br>
Response.Write "newNode.ForeColor = rgb(0,0,1)" & Crlf & Crlf <br>
<br>
<br>
'Declare Variables<br>
strCurrentClass = ""<br>
Do While Not oRS.EOF 'Loop until EOF<br>
strNewClass = oRS.Fields("ESDParent") 'Parent Nodes<br>
strTopicTitle = oRS.Fields("ESD_Name") 'Child Nodes<br>
strEsdID = oRS.Fields("Esd_ID") 'ID<br>
<br>
' Setup the control and populate it with data<br>
' Something buggy here<br>
<br>
Response.Write "Set newNode = SSTree1.Nodes.Add(" & Quot & strNewClass & Quot & ", ssChild," & Quot & strTopicTitle & Quot & ")" & Crlf<br>
Response.Write "newNode.Key =" & Quot & strTopicTitle & Quot & Crlf<br>
Response.Write "newNode.TagVariant = " & Quot & "REPORT1.ASP?esdid=" & strEsdID &"+" & strTopicTitle & Quot & Crlf<br>
Response.Write "newNode.Text = " & Quot & strTopicTitle & Quot & Crlf<br>
Response.Write "newNode.Expanded = True" & Crlf<br>
Response.Write "newNode.LoadStyleChildren = 3" & Crlf<br>
Response.Write "newnode.font.size = 8" & Crlf<br>
Response.Write "newNode.Font.Bold = True" & Crlf<br>
Response.Write "newNode.ForeColor = rgb(0,0,1)" & Crlf & Crlf <br>
<br>
oRS.MoveNext<br>
Loop ' Loop thru the Rs to pull out all the data<br>
%><br>
<br>
<%<br>
' Put the finish on the VbScript<br>
Response.Write "End Sub" & Crlf<br>
Response.Write "Sub SSTree1_NodeClick(ItemClicked)" & Crlf<br>
Response.Write "If ItemClicked.Level > 1 then" & Crlf<br>
Response.Write "End If" & Crlf<br>
Response.Write "End Sub" & Crlf & Crlf<br>
<br>
Response.Write "Sub button1_onclick()" & Crlf<br>
Response.Write "IF SSTree1.SelectedItem.TagVariant <>" & Quot & Quot & "THEN" & Crlf<br>
Response.Write "window.parent.frames(" & Quot & "reports" & Quot & ").location.href = SSTree1.SelectedItem.TagVariant" & Crlf<br>
Response.Write "End IF" & Crlf<br>
Response.Write "End Sub" & Crlf<br>
Response.Write "</SCRIPT>" & Crlf<br>
%><br>
<br>
<br>
</form><br>
<br>
<!-- Active Tree View --><br>
<p align="left"> <OBJECT classid="clsid:1C203F13-95AD-11D0-A84B-00A0247B735B" height=800 id=SSTree1 <br>
style="HEIGHT: 800px; LEFT: 0px; TOP: 0px; WIDTH: 260px" width=260 name="treeview" border="2"><br>
<PARAM NAME="_ExtentX" VALUE="10663"><br>
<PARAM NAME="_ExtentY" VALUE="7699"><br>
<PARAM NAME="_Version" VALUE="65538"><br>
<PARAM NAME="BackColor" VALUE="#CCC3FF"><br>
<PARAM NAME="ForeColor" VALUE="#FFFFFF"><br>
<PARAM NAME="ImagesMaskColor" VALUE="12632256"><br>
<PARAM NAME="PictureBackgroundMaskColor" VALUE="12632256"><br>
<PARAM NAME="Appearance" VALUE="0"><br>
<PARAM NAME="BorderStyle" VALUE="0"><br>
<PARAM NAME="LabelEdit" VALUE="1"><br>
<PARAM NAME="LineStyle" VALUE="0"><br>
<PARAM NAME="LineType" VALUE="1"><br>
<PARAM NAME="MousePointer" VALUE="1"><br>
<PARAM NAME="NodeSelectionStyle" VALUE="1"><br>
<PARAM NAME="PictureAlignment" VALUE="Left"><br>
<PARAM NAME="ScrollStyle" VALUE="1"><br>
<PARAM NAME="Style" VALUE="7"><br>
<PARAM NAME="IndentationStyle" VALUE="1"><br>
<PARAM NAME="TreeTips" VALUE="3"><br>
<PARAM NAME="PictureBackgroundStyle" VALUE="5"><br>
<PARAM NAME="Indentation" VALUE="12"><br>
<PARAM NAME="MaxLines" VALUE="1"><br>
<PARAM NAME="TreeTipDelay" VALUE="900"><br>
<PARAM NAME="ImageCount" VALUE="0"><br>
<PARAM NAME="ImageListIndex" VALUE="-1"><br>
<PARAM NAME="OLEDragMode" VALUE="1"><br>
<PARAM NAME="OLEDropMode" VALUE="1"><br>
<PARAM NAME="AllowDelete" VALUE="1"><br>
<PARAM NAME="AutoSearch" VALUE="1"><br>
<PARAM NAME="Enabled" VALUE="1"><br>
<PARAM NAME="HideSelection" VALUE="1"><br>
<PARAM NAME="ImagesUseMask" VALUE="1"><br>
<PARAM NAME="Redraw" VALUE="1"><br>
<PARAM NAME="UseImageList" VALUE="0"><br>
<PARAM NAME="PictureBackgroundUseMask" VALUE="0"><br>
<PARAM NAME="HasFont" VALUE="4"><br>
<PARAM NAME="Font" VALUE="arial, 8"><br>
<PARAM NAME="HasMouseIcon" VALUE="0"><br>
<PARAM NAME="HasPictureBackground" VALUE="0"><br>
<PARAM NAME="PathSeparator" VALUE="\"><br>
<PARAM NAME="TabStops" VALUE="6"><br>
<PARAM NAME="ImageList" VALUE="images/book.gif"><br>
<PARAM NAME="LoadStyleRoot" VALUE="0"><br>
<PARAM NAME="Sorted" VALUE="1"><br>
<PARAM NAME="OnDemandDiscardBuffer" VALUE="500"></OBJECT><br>
</P><br>
</td><br>
<td valign="top" align="right"><br>
<IFRAME align="right" Name="reports" FrameBorder="0" resizable="yes" Scrolling="auto" marginheight="2" marginwidth="2" width="500" height="800" src="/ax/report1.asp"><br>
</IFRAME><br>
</td><br>
<br>
</tr><br>
</table><br>
<br>
</body></html>
I need to pass a node parameter (the node.name)<br>
to a textbox<br>
<br>
any Ideas??? Code Follows, notice NewNode.Key is = to strTopicTitle ----- If I could somehow pass that value...<br>
<br>
********** CODE BELOW **************************<br>
<br>
<% Response.Buffer = True %><br>
<br>
<!--#include file="adovbs.inc"--><br>
<Html><br>
<head><br>
<META name=VI60_defaultClientScript content=VBScript><br>
<title>Shore Side Tracking</title><br>
<br>
<br>
<br>
<br>
<br>
</head><br>
<br>
<Body BgColor="#FFFFFF" Link="#003366" Vlink="#006633" ALink="#000000" bgProperties=fixed><br>
<!-- Top include --><br>
<!--#include file="includes/top.inc"--><br>
<!-- End Top SSI --><br>
<br>
<Form name="treeForm" action="name.asp" method="post"><br>
<table border="0" valign="top" width="100%"><br>
<tr><br>
<td valign="top"><br>
<br>
<br>
<%<br>
Dim objConn<br>
Set objConn = Server.CreateObject ("ADODB.Connection")<br>
' Access Conection String for Development ####################################################<br>
objConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.mapPath("data/esd.mdb")<br>
'Oracle Connection String ####################################################################<br>
'objConn = "DRIVER={Microsoft ODBC for Oracle};UID=esdtav;SERVER=oracle;User Id=esdtav;PASSWORD=esdtav;"<br>
<br>
strSQL = "SELECT * " & "From xxx ORDER BY Esd_ID" <br>
'strSQL = "SELECT Parent, Esd_Name, esdtav_ID FROM xxx Where Class <> '' " & "ORDER BY Class"<br>
Set oRS = objConn.Execute(strSQL, LngRecs, 1) ' Fetch a Recordset<br>
<br>
%><br>
<br>
<%<br>
Quot = Chr(34) ' Double Quotes<br>
Crlf = Chr(10) ' Carriage return<br>
<br>
Dim sTxt<br>
Dim iDex<br>
<br>
<br>
<br>
' Setup the VbScript<br>
Response.Write "<script language=" & Quot & "VbScript" & Quot & ">" & Crlf<br>
Response.Write "Sub window_onLoad()" & Crlf<br>
Response.Write "Dim newNode, ssChild" & Crlf <br>
Response.Write "SSTree1.LabelEdit=0" & Crlf<br>
Response.Write "SSTree1.LineStyle=1" & Crlf<br>
Response.Write "ssChild = 4" & Crlf & Crlf<br>
<br>
<br>
' Setup The Root Dir, which we call "CG"<br>
Response.Write "Set newNode = SSTree1.Nodes.Add()" & Crlf<br>
Response.Write "newNode.Key =" & Quot & "CG" & Quot & Crlf<br>
Response.Write "newNode.TagVariant = " & Quot & "REPORT1.ASP?esdid=1&" & "esdname=cg" & Quot & Crlf<br>
Response.Write "newNode.Text = " & Quot & "CG" & Quot & Crlf<br>
Response.Write "newNode.Expanded = True" & Crlf<br>
Response.Write "newnode.font.size = 8" & Crlf<br>
Response.Write "newNode.Font.Bold = True" & Crlf<br>
Response.Write "newNode.ForeColor = rgb(0,0,1)" & Crlf & Crlf <br>
<br>
<br>
'Declare Variables<br>
strCurrentClass = ""<br>
Do While Not oRS.EOF 'Loop until EOF<br>
strNewClass = oRS.Fields("ESDParent") 'Parent Nodes<br>
strTopicTitle = oRS.Fields("ESD_Name") 'Child Nodes<br>
strEsdID = oRS.Fields("Esd_ID") 'ID<br>
<br>
' Setup the control and populate it with data<br>
' Something buggy here<br>
<br>
Response.Write "Set newNode = SSTree1.Nodes.Add(" & Quot & strNewClass & Quot & ", ssChild," & Quot & strTopicTitle & Quot & ")" & Crlf<br>
Response.Write "newNode.Key =" & Quot & strTopicTitle & Quot & Crlf<br>
Response.Write "newNode.TagVariant = " & Quot & "REPORT1.ASP?esdid=" & strEsdID &"+" & strTopicTitle & Quot & Crlf<br>
Response.Write "newNode.Text = " & Quot & strTopicTitle & Quot & Crlf<br>
Response.Write "newNode.Expanded = True" & Crlf<br>
Response.Write "newNode.LoadStyleChildren = 3" & Crlf<br>
Response.Write "newnode.font.size = 8" & Crlf<br>
Response.Write "newNode.Font.Bold = True" & Crlf<br>
Response.Write "newNode.ForeColor = rgb(0,0,1)" & Crlf & Crlf <br>
<br>
oRS.MoveNext<br>
Loop ' Loop thru the Rs to pull out all the data<br>
%><br>
<br>
<%<br>
' Put the finish on the VbScript<br>
Response.Write "End Sub" & Crlf<br>
Response.Write "Sub SSTree1_NodeClick(ItemClicked)" & Crlf<br>
Response.Write "If ItemClicked.Level > 1 then" & Crlf<br>
Response.Write "End If" & Crlf<br>
Response.Write "End Sub" & Crlf & Crlf<br>
<br>
Response.Write "Sub button1_onclick()" & Crlf<br>
Response.Write "IF SSTree1.SelectedItem.TagVariant <>" & Quot & Quot & "THEN" & Crlf<br>
Response.Write "window.parent.frames(" & Quot & "reports" & Quot & ").location.href = SSTree1.SelectedItem.TagVariant" & Crlf<br>
Response.Write "End IF" & Crlf<br>
Response.Write "End Sub" & Crlf<br>
Response.Write "</SCRIPT>" & Crlf<br>
%><br>
<br>
<br>
</form><br>
<br>
<!-- Active Tree View --><br>
<p align="left"> <OBJECT classid="clsid:1C203F13-95AD-11D0-A84B-00A0247B735B" height=800 id=SSTree1 <br>
style="HEIGHT: 800px; LEFT: 0px; TOP: 0px; WIDTH: 260px" width=260 name="treeview" border="2"><br>
<PARAM NAME="_ExtentX" VALUE="10663"><br>
<PARAM NAME="_ExtentY" VALUE="7699"><br>
<PARAM NAME="_Version" VALUE="65538"><br>
<PARAM NAME="BackColor" VALUE="#CCC3FF"><br>
<PARAM NAME="ForeColor" VALUE="#FFFFFF"><br>
<PARAM NAME="ImagesMaskColor" VALUE="12632256"><br>
<PARAM NAME="PictureBackgroundMaskColor" VALUE="12632256"><br>
<PARAM NAME="Appearance" VALUE="0"><br>
<PARAM NAME="BorderStyle" VALUE="0"><br>
<PARAM NAME="LabelEdit" VALUE="1"><br>
<PARAM NAME="LineStyle" VALUE="0"><br>
<PARAM NAME="LineType" VALUE="1"><br>
<PARAM NAME="MousePointer" VALUE="1"><br>
<PARAM NAME="NodeSelectionStyle" VALUE="1"><br>
<PARAM NAME="PictureAlignment" VALUE="Left"><br>
<PARAM NAME="ScrollStyle" VALUE="1"><br>
<PARAM NAME="Style" VALUE="7"><br>
<PARAM NAME="IndentationStyle" VALUE="1"><br>
<PARAM NAME="TreeTips" VALUE="3"><br>
<PARAM NAME="PictureBackgroundStyle" VALUE="5"><br>
<PARAM NAME="Indentation" VALUE="12"><br>
<PARAM NAME="MaxLines" VALUE="1"><br>
<PARAM NAME="TreeTipDelay" VALUE="900"><br>
<PARAM NAME="ImageCount" VALUE="0"><br>
<PARAM NAME="ImageListIndex" VALUE="-1"><br>
<PARAM NAME="OLEDragMode" VALUE="1"><br>
<PARAM NAME="OLEDropMode" VALUE="1"><br>
<PARAM NAME="AllowDelete" VALUE="1"><br>
<PARAM NAME="AutoSearch" VALUE="1"><br>
<PARAM NAME="Enabled" VALUE="1"><br>
<PARAM NAME="HideSelection" VALUE="1"><br>
<PARAM NAME="ImagesUseMask" VALUE="1"><br>
<PARAM NAME="Redraw" VALUE="1"><br>
<PARAM NAME="UseImageList" VALUE="0"><br>
<PARAM NAME="PictureBackgroundUseMask" VALUE="0"><br>
<PARAM NAME="HasFont" VALUE="4"><br>
<PARAM NAME="Font" VALUE="arial, 8"><br>
<PARAM NAME="HasMouseIcon" VALUE="0"><br>
<PARAM NAME="HasPictureBackground" VALUE="0"><br>
<PARAM NAME="PathSeparator" VALUE="\"><br>
<PARAM NAME="TabStops" VALUE="6"><br>
<PARAM NAME="ImageList" VALUE="images/book.gif"><br>
<PARAM NAME="LoadStyleRoot" VALUE="0"><br>
<PARAM NAME="Sorted" VALUE="1"><br>
<PARAM NAME="OnDemandDiscardBuffer" VALUE="500"></OBJECT><br>
</P><br>
</td><br>
<td valign="top" align="right"><br>
<IFRAME align="right" Name="reports" FrameBorder="0" resizable="yes" Scrolling="auto" marginheight="2" marginwidth="2" width="500" height="800" src="/ax/report1.asp"><br>
</IFRAME><br>
</td><br>
<br>
</tr><br>
</table><br>
<br>
</body></html>