*Hi all,

Can i call a function in VB using the event*Listeners.Click.Handler ???? or something similar ???


Here is my code:


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>
<%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" 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>VTT® Technology</title>
** *<link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
** *<script type="text/javascript">
** * * *function nodeClick(t) {
** * * * * *alert('Nó: ' + t)
** * * *}
** *</script>
</head>
<body>
** *<form id="form1" runat="server">
** * * *<ext:ScriptManager ID="ScriptManager1" runat="server" />
** * * *<asp:PlaceHolder ID="PlaceHolder1" runat="server" />*
** *</form>
</body>
</html>

** *Inherits System.Web.UI.Page
** *Private grd As New Coolite.Ext.Web.GridPanel
** *Private sql As New SqlDataSource
** *Private str As New Coolite.Ext.Web.Store


** *Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
** * * *Dim Window1 As New Coolite.Ext.Web.Window
** * * *Window1.ID = "Window1"
** * * *Window1.Title = "VTT® Technology"
** * * *Window1.Icon = Coolite.Ext.Web.Icon.Application
** * * *Window1.Width = Unit.Pixel(800)
** * * *Window1.Height = Unit.Pixel(600)
** * * *Window1.Border = False
** * * *Window1.Maximizable = True
** * * *Window1.Plain = True


** * * *Dim Panel3 As New Coolite.Ext.Web.Panel
** * * *Panel3.ID = "Panel3"
** * * *Panel3.Height = Unit.Pixel(100)
** * * *Panel3.Title = "Footer"
** * * *Panel3.Collapsed = "false"


** * * *Dim BorderLayout1 As New Coolite.Ext.Web.BorderLayout
** * * *BorderLayout1.West.Collapsible = True
** * * *BorderLayout1.West.MinWidth = Unit.Pixel(175)
** * * *BorderLayout1.West.Split = True
** * * *BorderLayout1.West.Items.Add(Arvore)
** * * *BorderLayout1.Center.Items.Add(Grid("SELECT * FROM mtel.tb_empresas"))
** * * *BorderLayout1.South.Items.Add(Panel3)


** * * *Window1.Items.Add(BorderLayout1)
** * * *form1.Controls.Add(Window1)
** *End Sub


** *Protected Function Arvore() As Coolite.Ext.Web.TreePanel
** * * *Dim tree As New Coolite.Ext.Web.TreePanel


** * * *PlaceHolder1.Controls.Add(tree)


** * * *tree.ID = "TreePanel1"
** * * *tree.Width = Unit.Pixel(300)
** * * *tree.Height = Unit.Pixel(500)
** * * *tree.Icon = Coolite.Ext.Web.Icon.Computer
** * * *tree.Title = "Área de Trabalho"
** * * *tree.AutoScroll = True


** * * *Dim btnExpand As New Coolite.Ext.Web.Button
** * * *btnExpand.Icon = Coolite.Ext.Web.Icon.ApplicationSideTree
** * * *btnExpand.Listeners.Click.Handler = tree.ClientID + ".expandAll()"


** * * *Dim btnCollapse As New Coolite.Ext.Web.Button
** * * *btnCollapse.Icon = Coolite.Ext.Web.Icon.ApplicationTileHorizontal
** * * *btnCollapse.Listeners.Click.Handler = tree.ClientID + ".collapseAll()"


** * * *Dim toolBar As New Coolite.Ext.Web.Toolbar
** * * *toolBar.ID = "Toolbar1"
** * * *toolBar.Items.Add(btnExpand)
** * * *toolBar.Items.Add(btnCollapse)
** * * *tree.TopBar.Add(toolBar)


** * * *Dim statusBar As New Coolite.Ext.Web.StatusBar
** * * *statusBar.AutoClear = 1000
** * * *tree.BottomBar.Add(statusBar)


	'tree.Listeners.Click.Handler = "FunctionNameInVB()"
** * * *tree.Listeners.Click.Handler = statusBar.ClientID + ".setStatus({text: 'Item selecionado: ' + node.text + '', clear: true});nodeClick(node.id);"
** * * *tree.Listeners.ExpandNode.Handler = statusBar.ClientID + ".setStatus({text: 'Item expandido: ' + node.text + '', clear: true})"
** * * *tree.Listeners.ExpandNode.Delay = 30
** * * *tree.Listeners.CollapseNode.Handler = statusBar.ClientID + ".setStatus({text: 'Item recolhido: ' + node.text + '', clear: true})"


** * * *Dim root As New Coolite.Ext.Web.TreeNode("Statuses")
** * * *root.Expanded = True
** * * *tree.Root.Add(root)


** * * *Dim Menus As System.Data.DataTable
** * * *Dim Menu As System.Data.DataRow
** * * *Menus = RS("SELECT cod_status, status FROM mtel.tb_statuses ORDER BY cod_status")
** * * *For Each Menu In Menus.Rows
** * * * * *Dim composerNode As New Coolite.Ext.Web.TreeNode(Menu.Item("cod_status").ToString, Menu.Item("status").ToString, Coolite.Ext.Web.Icon.User)
** * * * * *root.Nodes.Add(composerNode)
** * * *Next


** * * *Return tree
** *End Function


** *Protected Function Grid(ByVal String_SQL As String) As Coolite.Ext.Web.GridPanel
** * * *Dim Registros As System.Data.DataTable
** * * *Dim Coluna As System.Data.DataColumn


** * * *sql.ConnectionString = String_CN
** * * *sql.SelectCommand = String_SQL
** * * *sql.ProviderName = "MySql.Data.MySqlClient"
** * * *sql.DataBind()


** * * *Dim rdr As New Coolite.Ext.Web.JsonReader
** * * *rdr.ReaderID = "Reader1"


** * * *Registros = RS(String_SQL)
** * * *For Each Coluna In Registros.Columns
** * * * * *Dim rcf As New Coolite.Ext.Web.RecordField
** * * * * *rcf.Name = Coluna.Caption
** * * * * *rcf.Type = Coolite.Ext.Web.RecordFieldType.Auto
** * * * * *rdr.Fields.Add(rcf)
** * * *Next


** * * *form1.Controls.Add(str)
** * * *str.ID = "Store1"
** * * *str.Reader.Add(rdr)
** * * *str.DataSource = sql
** * * *str.DataBind()


** * * *grd.ID = "GridPanel1"
** * * *grd.Width = "600"
** * * *grd.Height = "300"
** * * *grd.Title = "Grid"
** * * *grd.Icon = Coolite.Ext.Web.Icon.Table
** * * *grd.Frame = "true"
** * * *grd.StoreID = "Store1"


** * * *Registros = RS(String_SQL)
** * * *For Each Coluna In Registros.Columns
** * * * * *Dim col As New Coolite.Ext.Web.Column
** * * * * *col.DataIndex = Coluna.Caption
** * * * * *col.Header = Coluna.Caption
** * * * * *grd.ColumnModel.Columns.Add(col)
** * * *Next


** * * *grd.Load()
** * * *grd.DataBind()


** * * *Return grd
** *End Function


** *Protected Sub AtualizaGrid(ByVal String_SQL As String)
** * * *sql.SelectCommand = String_SQL
** * * *sql.DataBind()
** *End Sub