Hello,
I am creating the RadWindowManager in the Page.Init event handler on every PostBack using the following code:
where contentContainer is an AspPanel in my ContentPage, which means I am using MasterPage also. I must add the RadWindowManager programmatic because it is done in a BasePage class from which all other content pages inherit.
I have tried many combination of the JavaScript that would show me the RadWindow, but I never got to see it shown. Here are two approaches that I tried (I am passing the RadWindowManager.ClientId to the function that generates the bellow JavaScripts).
The JavaScript I am adding everytime to the contentContainer (also on Page.Init) is:
and the code that I am adding to the same contentContainer after the Grid.ItemCommand event is:
So the code gets executed but client script debugger stops at:
or:
var oWnd = $find(ctl00_ContentPlaceHolderMain_CommandWindowManager).GetWindowByName('CommandWindow');
with the error: Microsoft JScript runtime error: 'null' is null or not an object.
Could you please give me a quick response.
Thank you in advance!
Regards,
Vladimir
I am creating the RadWindowManager in the Page.Init event handler on every PostBack using the following code:
| Dim cmdWindowManager As RadWindowManager = New RadWindowManager |
| cmdWindowManager.ID = "CommandWindowManager" |
| Dim cmdWindow As RadWindow = New RadWindow |
| cmdWindow.ID = "CommandWindow" |
| cmdWindow.ReloadOnShow = True |
| cmdWindow.ShowContentDuringLoad = False |
| cmdWindow.Modal = True |
| cmdWindow.AutoSize = True |
| cmdWindow.Width = Unit.Pixel(450) |
| cmdWindow.Height = Unit.Pixel(150) |
| cmdWindowManager.Windows.Add(cmdWindow) |
| contentContainer.Controls.Add(cmdWindowManager) |
where contentContainer is an AspPanel in my ContentPage, which means I am using MasterPage also. I must add the RadWindowManager programmatic because it is done in a BasePage class from which all other content pages inherit.
I have tried many combination of the JavaScript that would show me the RadWindow, but I never got to see it shown. Here are two approaches that I tried (I am passing the RadWindowManager.ClientId to the function that generates the bellow JavaScripts).
The JavaScript I am adding everytime to the contentContainer (also on Page.Init) is:
| function ShowEditForm(formUrl, formTitle) { |
| var oWnd = window.radopen(formUrl, formTitle); |
| return false; |
| } |
| function ShowInsertForm(formUrl, formTitle) { |
| alert('test'); |
| var oWnd = $find(ctl00_ContentPlaceHolderMain_CommandWindowManager).GetWindowByName('CommandWindow'); |
| oWnd.SetUrl(formUrl); |
| oWnd.Show(); return false; |
| } |
and the code that I am adding to the same contentContainer after the Grid.ItemCommand event is:
| ' configure Client Script for Command Items |
| Dim radCodeBlockAction As RadScriptBlock = New RadScriptBlock |
| Dim script As New LiteralControl("<script type=""text/javascript"" language=""javascript""> " & Environment.NewLine & _ |
| String.Format(ACTION_FUNCTION_FORMAT, _ |
| ActionFunction, _ |
| ActionFormUrl, _ |
| FormTitle) & Environment.NewLine & _ |
| "</script>") |
| ' the result of String.Format is "ShowInsert('edit.aspx','CommandWindow')" |
| radCodeBlockAction.Controls.Clear() |
| radCodeBlockAction.Controls.Add(script) |
| contentContainer.Controls.Add(radCodeBlockAction) |
So the code gets executed but client script debugger stops at:
| var oWnd = window.radopen(formUrl, formTitle); |
var oWnd = $find(ctl00_ContentPlaceHolderMain_CommandWindowManager).GetWindowByName('CommandWindow');
with the error: Microsoft JScript runtime error: 'null' is null or not an object.
Could you please give me a quick response.
Thank you in advance!
Regards,
Vladimir