OK, Here's the main border layout page
<%@ Page Language="VB" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>MainBorderLayout</title>
<link href="styles/stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="Form1" runat="server">
<%--
Make sure that the Ext.Net resource manager is loaded, otherwise noting's gonna work.
--%>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Button
ID="Button1"
runat="server"
Text="Show Window"
Icon="Application">
<Listeners>
<Click Handler="#{Window1}.show();" />
</Listeners>
</ext:Button>
<ext:Window
ID="Window1"
runat="server"
Title="RAMtr@ck-WV"
Icon="Application"
Width="1000"
Height="600"
Border="false"
Collapsible="true"
Maximizable="true"
Layout="Fit">
<Items>
<ext:BorderLayout ID="BorderLayout1" runat="server">
<West Collapsible="true" MinWidth="300" Split="true">
<ext:Panel ID="pnl_TreeView" runat="server" Title="Vehicles" Padding="2" Width="300" >
<AutoLoad Url="TreePanel.aspx" Mode="IFrame" ShowMask="true" />
</ext:Panel>
</West>
<Center>
<ext:TabPanel
ID="TabPanel1"
runat="server"
ActiveTabIndex="0"
Width="650"
Height="500"
Plain="true"
EnableTabScroll="true"
MinWidth="300"
MinHeight="100"
ResizeTabs="true"
DeferredRender="false">
<Items>
<ext:Panel
ID="tab_1"
runat="server"
Title="Details"
Padding="2"
AutoScroll="true">
<AutoLoad Url="DetailsPage.aspx" Mode="IFrame" ShowMask="true" />
</ext:Panel>
<ext:Panel
ID="tab_2"
runat="server"
Title="Picture"
Padding="2"
AutoScroll="true">
<AutoLoad Url="DetailsPage2.aspx" Mode="IFrame" ShowMask="true" />
<Listeners>
<Activate handler="Ext.net.DirectMethod.request('PopulateTab', { url: 'DetailsPage2.aspx'});" />
</Listeners>
</ext:Panel>
</Items>
</ext:TabPanel>
</Center>
</ext:BorderLayout>
</Items>
</ext:Window>
</form>
</body>
</html>
Here's the TreePanel code.
<%@ Page Language="VB" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim PopulateTreeSuccess_b As Boolean
PopulateTreeSuccess_b = b_AddLocationsToTree()
End Sub
<DirectMethod()>
Public Sub TreeSvrSideMethodCode(ByVal NodeName_s As String, ByVal NodeID_s As String, ByVal NodeQtip_s As String)
'Save the selected node details into global variables
AppGlobals.s_SelectedNodeName = NodeName_s
AppGlobals.l_SelectedNodeID = Val(NodeID_s)
AppGlobals.s_SelectedNodeQTip = NodeQtip_s
End Sub
Protected Function b_AddLocationsToTree() As Boolean
Dim RetVal_b As Boolean
Dim tree As Ext.Net.TreePanel
Dim btnExpand As Ext.Net.Button
Dim btnCollapse As Ext.Net.Button
Dim toolBar As Toolbar
Dim statusBar As StatusBar
Dim root As Ext.Net.TreeNode
Dim nd_Locations As Ext.Net.TreeNode
RetVal_b = True
Try
tree = New Ext.Net.TreePanel()
Me.ph_TreeviewPlaceHolder.Controls.Add(tree)
tree.ID = "TreePanel1"
tree.Width = Unit.Pixel(270)
tree.Height = Unit.Pixel(400)
tree.Icon = Icon.BookOpen
tree.AutoScroll = True
btnExpand = New Ext.Net.Button()
btnExpand.Text = "Expand All"
btnExpand.Listeners.Click.Handler = tree.ClientID + ".expandAll();"
btnCollapse = New Ext.Net.Button()
btnCollapse.Text = "Collapse All"
btnCollapse.Listeners.Click.Handler = tree.ClientID + ".collapseAll();"
toolBar = New Toolbar()
toolBar.ID = "Toolbar1"
toolBar.Items.Add(btnExpand)
toolBar.Items.Add(btnCollapse)
tree.TopBar.Add(toolBar)
statusBar = New StatusBar()
statusBar.AutoClear = 1000
tree.BottomBar.Add(statusBar)
tree.Listeners.Click.Handler = "parent.TabPanel1.activeTab.getBody().Ext.net.DirectMethods.HandleTreePanelSelection(node.text, node.id, node.attributes.qtip);"
tree.Listeners.ExpandNode.Handler = statusBar.ClientID + ".setStatus({text: 'Node Expanded: <b>' + node.text + '</b>', clear: true});"
tree.Listeners.ExpandNode.Delay = 30
tree.Listeners.CollapseNode.Handler = statusBar.ClientID + ".setStatus({text: 'Node Collapsed: <b>' + node.text + '</b>', clear: true});"
root = New Ext.Net.TreeNode("Root")
root.NodeID = 0
root.Qtip = "Root Qtip"
root.Expanded = True
tree.Root.Add(root)
' Normally the tree node structure will be built from a database table
nd_Locations = New Ext.Net.TreeNode("Node 1")
nd_Locations.NodeID = "1"
nd_Locations.Qtip = "Qtip 1"
root.Nodes.Add(nd_Locations)
nd_Locations = New Ext.Net.TreeNode("Node 2")
nd_Locations.NodeID = "2"
nd_Locations.Qtip = "Qtip 2"
root.Nodes.Add(nd_Locations)
Catch ex As Exception
RetVal_b = False
End Try
b_AddLocationsToTree = RetVal_b
End Function
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Treeview</title>
</head>
<body>
<%--
Make sure that the Ext.Net resource manager is loaded, otherwise noting's gonna work.
--%>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<form id="form1" runat="server">
<div>
<asp:PlaceHolder ID="ph_TreeviewPlaceHolder" runat="server" />
</div>
</form>
</body>
</html>
Here's the page that's loaded into the first tab.
<%@ Page Language="VB" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
' I want this routine to load the correct picture when the picture tab is activated.
' Currently, it causes an error (if the comment apostrophe is removed) during rendering
' because the image control does not exist at the point when image URL is assigned.
<DirectMethod()>
Public Sub PopulateTab()
Dim TextBox_tf As Ext.Net.TextField
TextBox_tf = Ext.Net.X.GetCmp("TextField1")
TextBox_tf.Text = "Item Details for " & AppGlobals.s_SelectedNodeName & ", Node ID: " & AppGlobals.l_SelectedNodeID & ", Node QTip: " & AppGlobals.s_SelectedNodeQTip
End Sub
<DirectMethod()>
Sub HandleTreePanelSelection(ByVal NodeText_s As String, ByVal NodeID_s As String, ByVal NodeType_s As String)
Dim TextBox_tf As Ext.Net.TextField
TextBox_tf = Ext.Net.X.GetCmp("TextField1")
TextBox_tf.Text = "Item Details for " & NodeText_s & ", Node ID: " & NodeID_s & ", Node Type: " & NodeType_s
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Item Details</title>
<link href="styles/stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<form id="form1" runat="server">
<ext:TextField ID="TextField1" Width="500px" runat="server" ></ext:TextField>
</form>
</body>
</html>
Here's the page that's loaded into the second tab.
<%@ Page Language="VB" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
' I want this routine to load the correct picture when the picture tab is activated.
' Currently, it causes an error (if the comment apostrophe is removed) during rendering
' because the image control does not exist at the point when image URL is assigned.
<DirectMethod()>
Public Sub PopulateTab()
Dim TextBox_tf As Ext.Net.TextField
TextBox_tf = Ext.Net.X.GetCmp("TextField1")
TextBox_tf.Text = "Item Details for " & AppGlobals.s_SelectedNodeName & ", Node ID: " & AppGlobals.l_SelectedNodeID & ", Node QTip: " & AppGlobals.s_SelectedNodeQTip
End Sub
<DirectMethod()>
Sub HandleTreePanelSelection(ByVal NodeText_s As String, ByVal NodeID_s As String, ByVal NodeType_s As String)
Dim TextBox_tf As Ext.Net.TextField
TextBox_tf = Ext.Net.X.GetCmp("TextField1")
TextBox_tf.Text = "Item Details for " & NodeText_s & ", Node ID: " & NodeID_s & ", Node Type: " & NodeType_s
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Item Details</title>
<link href="styles/stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<form id="form1" runat="server">
<ext:TextField ID="TextField1" Width="500px" runat="server" ></ext:TextField>
</form>
</body>
</html>
Here's the AppGlobals class (sits in the App_Code folder) that looks after global variables
Imports Microsoft.VisualBasic
' Contains my site's global variables.
Public NotInheritable Class AppGlobals
Private Sub New()
End Sub
' Global variables for storing important stuff.
Shared SelectedNodeName_s As String
Shared SelectedNodeID_l As Long
Shared SelectedNodeQTip_s As String
' Get or set the static TreeView Selected Node Name.
Public Shared Property s_SelectedNodeName() As String
Get
Return SelectedNodeName_s
End Get
Set(ByVal value As String)
SelectedNodeName_s = value
End Set
End Property
' Get or set the static TreeView Selected Node ID.
Public Shared Property l_SelectedNodeID() As Long
Get
Return SelectedNodeID_l
End Get
Set(ByVal value As Long)
SelectedNodeID_l = value
End Set
End Property
' Get or set the static TreeView Selected Node ToolTip.
Public Shared Property s_SelectedNodeQTip() As String
Get
Return SelectedNodeQTip_s
End Get
Set(ByVal value As String)
SelectedNodeQTip_s = value
End Set
End Property
End Class