This is a migrated thread and some comments may be shown as answers.

Important Issues with RadWindow and RadAjaxManager

2 Answers 197 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Ahmed
Top achievements
Rank 1
Ahmed asked on 07 Sep 2011, 03:27 PM
How are you my friends? I am new to your controls and i am very happy with them, we will buy them soon
I have some issues that need to be fixed as soon as possible:-
My Scenario is RadWindow that contains ASP.NET Wizard control
1- when i ajaxify RadWindow using RadAjaxManager, I get the following error
Microsoft JScript runtime error: Sys.ArgumentException: Value must not be null for Controls and Behaviors.
Parameter name: element
2- Also,  I need if the Ajax Fuctionality works correctly, i need to show progress indication when the user click Next button in the first wizard and another different indication when the user click Next in the second Wizard
3-When Clicking Close Window to close the window, I use JavaScript function to close the window, but when i open it again; it opened on the status that was before closing it---------> i don't need this behaviour, i want it to open on the first step everytime i closed it and open it again.
My Code snippet is below
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DeploymentWizard.ascx.cs"
    Inherits="Horizons.SA.Presentation.UI.Web.Client.Admin.Controls.DeploymentWizard" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<style type="text/css">
      
</style>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function OpenDeploymentWizard() {
            var RadWindow = $find("<%=RadDeploymentWindow.ClientID%>");
            RadWindow.show();
        }
  
        function CloseDeploymentWizard() {
            var RadWindow = $find("<%=RadDeploymentWindow.ClientID%>");
            RadWindow.Close();
        }
     
    </script>
</telerik:RadCodeBlock>
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadDeploymentWindow">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadDeploymentWindow" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadWindow ID="RadDeploymentWindow" Title="<%$ Resources:Text, DeploymentWizard %>"
    runat="server" VisibleOnPageLoad="false" VisibleStatusbar="false" Width="535px"
    Modal="true" Height="430px" Behaviors="Close,Move" Skin="Windows7" ShowContentDuringLoad="false"
    EnableViewState="false" DestroyOnClose="true" ReloadOnShow="true">
    <ContentTemplate>
        <%--Deployment Wizards--%>
        <asp:Wizard runat="server" ID="DeployWizards" Width="100%" DisplaySideBar="False"
            DisplayCancelButton="true" OnNextButtonClick="DeployWizards_NextButtonClick">
            <HeaderTemplate>
                <table cellpadding="0" cellspacing="0" class="wizardHeader">
                    <tr>
                        <td class="wizardTitle">
                            <%= DeployWizards.ActiveStep.Title%>
                        </td>
                        <td>
                            <table style="width: 100%; border-collapse: collapse;">
                                <tr>
                                    <td class="wizardHeaderTableCell">
                                        <span class="wizardProgress">
                                            <%= Resources.Text.Steps%></span>
                                    </td>
                                    <asp:Repeater ID="SideBarList" runat="server">
                                        <ItemTemplate>
                                            <td class="stepBreak">
                                                   
                                            </td>
                                            <td class="<%# GetClassForWizardStep(Container.DataItem) %>" title="<%# DataBinder.Eval(Container, "DataItem.Name")%>">
                                                <%# DeployWizards.WizardSteps.IndexOf(Container.DataItem as TemplatedWizardStep ) + 1%>
                                            </td>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </HeaderTemplate>
            <StartNavigationTemplate>
                <asp:Panel ID="panStart" runat="server" CssClass="wizardNavContent">
                    <telerik:RadButton ID="NextButtonValidationStep" CssClass="wizardNavButton" runat="server"
                        Text="<%$ Resources:Text, Next %>" CommandName="MoveNext" AlternateText="Next">
                    </telerik:RadButton>
                    <telerik:RadButton ID="CancelButtonValidationStep" CssClass="wizardNavButton" runat="server"
                        Text="<%$ Resources:Text, Cancel %>" AlternateText="Cancel" OnClientClicked="CloseDeploymentWizard">
                    </telerik:RadButton>
                </asp:Panel>
            </StartNavigationTemplate>
            <StepNavigationTemplate>
                <asp:Panel ID="panStep" runat="server" CssClass="wizardNavContent">
                    <telerik:RadButton ID="PrevButtonDeployment" CssClass="wizardNavButton" runat="server"
                        Text="<%$ Resources:Text, Previous %>" CommandName="MovePrevious" AlternateText="Previous">
                    </telerik:RadButton>
                    <telerik:RadButton ID="NextButtonDeploymentStep" CssClass="wizardNavButton" runat="server"
                        Text="<%$ Resources:Text, Next %>" CommandName="MoveNext" AlternateText="Next">
                    </telerik:RadButton>
                    <telerik:RadButton ID="CancelButtonDeploymentStep" CssClass="wizardNavButton" runat="server"
                        Text="<%$ Resources:Text, Cancel %>" AlternateText="Cancel" OnClientClicked="CloseDeploymentWizard">
                    </telerik:RadButton>
                </asp:Panel>
            </StepNavigationTemplate>
            <FinishNavigationTemplate>
                <asp:Panel ID="panFinish" runat="server" CssClass="wizardNavContent">
                    <telerik:RadButton ID="FinishButton" CssClass="wizardNavButton" runat="server" CommandName="MoveComplete"
                        OnClientClicked="CloseDeploymentWizard" Text="<%$ Resources:Text, Finish %>"
                        AlternateText="Finish">
                    </telerik:RadButton>
                </asp:Panel>
            </FinishNavigationTemplate>
            <WizardSteps>
                <asp:TemplatedWizardStep ID="DeploymentConfigurationStep" runat="server" Title="<%$ Resources:Text, DeploymentConfiguration %>">
                    <ContentTemplate>
                        <div class="WizardContent">
                            <div>
                                <fieldset class="DeploymentFieldset">
                                    <legend class="Deploymentlegend">
                                        <%= Resources.Text.DeploymentConfiguration%></legend>
                                    <table cellpadding="0" cellspacing="0" style="width: 100%;">
                                        <tr>
                                            <td>
                                                <div style="width: 100%;">
                                                    <fieldset style="margin-right: 5px;" class="DeploymentFieldset">
                                                        <legend class="Deploymentlegend">
                                                            <%= Resources.Text.UnityWeightSum%></legend>
                                                        <SA:RadioButton ID="RadioButtonEnforce" runat="server" GroupName="UnityWeightSum"
                                                            Checked="true" Text="Enforce" />
                                                        <SA:RadioButton ID="RadioButtonRelax" CssClass="RadioButtonImportContinue" runat="server"
                                                            GroupName="UnityWeightSum" Text="Relax" />
                                                    </fieldset>
                                                </div>
                                            </td>
                                            <td>
                                                <div style="width: 100%;">
                                                    <fieldset class="DeploymentFieldset">
                                                        <legend class="Deploymentlegend">
                                                            <%= Resources.Text.WeightOption%></legend>
                                                        <SA:RadioButton ID="RadioButtonModel" runat="server" GroupName="WeightOption" Checked="true"
                                                            Text="Model" />
                                                        <SA:RadioButton ID="RadioButtonCalculation" CssClass="RadioButtonImportContinue"
                                                            runat="server" GroupName="WeightOption" Text="Calculation" />
                                                    </fieldset>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <div style="width: 100%;">
                                                    <fieldset class="DeploymentFieldset">
                                                        <legend class="Deploymentlegend">
                                                            <%= Resources.Text.DatabaseOptions%></legend>
                                                        <SA:CheckBox Checked="false" CssClass="DeploymentDatabaseOption" Text="<%$ Resources:Text, ClearActualValues %>"
                                                            ID="CheckBoxRunInBackground" runat="server" />
                                                        <SA:CheckBox Checked="false" CssClass="DeploymentDatabaseOption" Text="<%$ Resources:Text, ClearReferenceValues %>"
                                                            ID="CheckBox1" runat="server" />
                                                        <SA:CheckBox Checked="false" CssClass="DeploymentDatabaseOption" Text="<%$ Resources:Text, ClearInitiativesValues %>"
                                                            ID="CheckBox2" runat="server" />
                                                        <SA:CheckBox Checked="false" CssClass="DeploymentDatabaseOption" Text="<%$ Resources:Text, CleanDatabase %>"
                                                            ID="CheckBox3" runat="server" />
                                                    </fieldset>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </fieldset>
                            </div>
                            <div class="DeploymentFile">
                                <fieldset class="DeploymentFieldset">
                                    <legend class="Deploymentlegend">
                                        <%= Resources.Text.DeploymentFile%></legend>
                                    <table style="width: 100%; border-collapse: collapse;">
                                        <tr>
                                            <td>
                                                <SA:Label ID="Label1" runat="server" Text="<%$ Resources:Text, SelectMapFile %>"></SA:Label>
                                            </td>
                                            <td>
                                                <telerik:RadAsyncUpload Width="100%" runat="server" ID="DeploymentFileUpload" ControlObjectsVisibility="None"
                                                    OnFileUploaded="FileUploaded" InitialFileInputsCount="1" MaxFileInputsCount="1">
                                                    <%--                                                           <FileFilters>
                                                             <telerik:FileFilter Description="<%$ Resources:Text, SelectMapFile %>" Extensions="xmp"   />
                                                           </FileFilters> --%>
                                                </telerik:RadAsyncUpload>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <%= Resources.Text.DeploymentDate%>
                                            </td>
                                            <td>
                                                <telerik:RadDatePicker Width="100%" runat="server" ID="DeploymentDatePicker">
                                                </telerik:RadDatePicker>
                                            </td>
                                        </tr>
                                    </table>
                                </fieldset>
                            </div>
                        </div>
                    </ContentTemplate>
                </asp:TemplatedWizardStep>
                <asp:TemplatedWizardStep ID="DeploymentValidationStep" runat="server" Title="<%$ Resources:Text, DeploymentValidation %>">
                    <ContentTemplate>
                        <div style="height: 320px; overflow: auto;">
                            <telerik:RadGrid ID="DeploymentGrid" Skin="Office2007" runat="server" AutoGenerateColumns="False"
                                AllowSorting="True" PageSize="10" ShowStatusBar="True" CellSpacing="0" GridLines="Both"
                                AllowPaging="True" OnNeedDataSource="RadGrid_NeedDataSource">
                                <MasterTableView DataKeyNames="ObjectID" AutoGenerateColumns="false">
                                    <ItemStyle Wrap="false" />
                                    <Columns>
                                        <telerik:GridBoundColumn HeaderStyle-HorizontalAlign="Center" DataField="ObjectID"
                                            HeaderText="ID">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn HeaderStyle-HorizontalAlign="Center" DataField="ObjectType"
                                            HeaderText="Type">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn HeaderStyle-HorizontalAlign="Center" DataField="Name" HeaderText="Name">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn HeaderStyle-HorizontalAlign="Center" DataField="Attribute"
                                            HeaderText="Attribute">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn HeaderStyle-HorizontalAlign="Center" DataField="Error" HeaderText="Description">
                                        </telerik:GridBoundColumn>
                                        <%--                                                        <telerik:GridBoundColumn HeaderStyle-HorizontalAlign="Center" DataField="ProposedSolution"
                                                            HeaderText="Proposed Solution">
                                                        </telerik:GridBoundColumn>--%>
                                        <telerik:GridBoundColumn HeaderStyle-HorizontalAlign="Center" DataField="Severity"
                                            HeaderText="Severity">
                                        </telerik:GridBoundColumn>
                                    </Columns>
                                </MasterTableView>
                                <ClientSettings>
                                    <Resizing AllowColumnResize="True"></Resizing>
                                </ClientSettings>
                            </telerik:RadGrid>
                        </div>
                    </ContentTemplate>
                </asp:TemplatedWizardStep>
                <asp:TemplatedWizardStep ID="DeploymentExcutionStep" runat="server" Title="<%$ Resources:Text, DeploymentExecution %>">
                    <ContentTemplate>
                        <div style="font-size: 15px; font-weight: bold; height: 250px; border: 1px solid;
                            margin-top: 40px; margin-bottom: 10px;">
                            <SA:Panel runat="server" ID="ExecutionPanel">
                                <SA:Label ID="lblStatus" runat="server" />
                            </SA:Panel>
                        </div>
                    </ContentTemplate>
                </asp:TemplatedWizardStep>
            </WizardSteps>
        </asp:Wizard>
    </ContentTemplate>
</telerik:RadWindow>

2 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 12 Sep 2011, 01:58 PM
Hi Ahmed,

Could you please try using RadAjaxPanel to wrap the whole RadWindow control instead of using RadAjaxManager and verify of the error still persists. Also please note that is you need to execute some javascript after ajax update you should use the ResponseScripts method of the ajax as described here.
Regarding the loading panels requirement, unfortunately this specific scenario could not be achieved with Wizard control and RadAjaxLoadingPanel, you could use the show method for showing the LoadingPanel on ButtonClick event however the next button has the same ID in each step so it could not be determined which next button in which step is clicked so you could show different LoadingPanel. You could show the same LoadingPanel by adding it as LoadingPanelID for the RadAjaxPanel.
As for the window reset issue, in the provided mark up i noticed that you are setting all the needed propertied for avoiding this behaviour. Please do let me know if the same behaviour is observed if the ajax is disabled on the page. Also please let me know what is the result after applying the suggestions above.



Greetings,
Maria Ilieva
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ahmed
Top achievements
Rank 1
answered on 13 Sep 2011, 03:31 PM
Thank you
Tags
Ajax
Asked by
Ahmed
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Ahmed
Top achievements
Rank 1
Share this question
or