May 14, 2012, 3:41 PM
Dynamic Control with DirectMethod Javascript Parameter
Hello,
I would like to know how could i do this, i would like to send newly created control in javascript to the new DirectMethod, let me explain...
On DirectMethod Temp.Save i would like to send as parameter wTemp or btnSave, but i cant find those controls or dont exists.
Temp1.aspx
GeneralJs.js
I would like to know how could i do this, i would like to send newly created control in javascript to the new DirectMethod, let me explain...
On DirectMethod Temp.Save i would like to send as parameter wTemp or btnSave, but i cant find those controls or dont exists.
Temp1.aspx
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" DirectMethodNamespace="Temp">
</ext:ResourceManager>
</form>
</body>
</html>
Temp1.aspx.vbImports Ext.Net
Public Class Temp1
Inherits System.Web.UI.Page
<DirectMethod()> _
Public Sub Save()
Dim btn As Ext.Net.Button = Ext.Net.X.GetCmp(Of Ext.Net.Button)("btnSave")
Dim win As Ext.Net.Window = Ext.Net.X.GetCmp(Of Ext.Net.Window)("wTemp")
win.Title = "New Title"
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Ext.Net.X.IsAjaxRequest Then
'Title, URL as parameter here to JS Function
PublicFunctions.OpenPageJS("Temp2", "temp2.aspx")
End If
End Sub
PublicFuntions.OpenPage Public Shared Sub OpenPageJS(ByVal title As String, ByVal url As String)
ResourceManager.GetInstance().RegisterClientScriptInclude("GeneralJs", ConfigurationManager.AppSettings("GeneralJs"))
X.Js.Call("createwin", titulo, url)
End Sub
GeneralJs.js
function createwin(titulo, url) {
Ext.net.ResourceMgr.registerIcon(["Disk"]);
win = new parent.Ext.Window(
{
tbar: [
{
itemId: 'btnSave',
xtype: 'button',
text: 'Save',
iconCls: 'icon-disk',
listeners: {
click: {
fn: function () {
Temp.Save();
}
}
}
}
],
renderTo: parent.Ext.getBody(),
itemId: 'wTemp',
maximizable: false,
resizable: false,
collapsible: false,
constrain: false,
title: titulo,
height: 600,
width: 800,
modal: true,
frame: true,
autoLoad: {
maskMsg: "Loading...",
showMask: true,
mode: "iframe",
url: url
},
bodyStyle: 'background-color: #fff;'
});
win.show();
Temp2.aspx<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
</form>
</body>
</html>
Thanks in Advance...