Issues when i want to ajaxify RadWindow that contains Wizard Control with RadAjaxManager

3 posts, 0 answers
  1. Ahmed
    Ahmed avatar
    2 posts
    Member since:
    Sep 2011

    Posted 08 Sep 2011 Link to this post

    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">
    </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. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4613 posts

    Posted 13 Sep 2011 Link to this post

    Hello Ahmed,

    I am not sure how you are ajaxifying the RadWindow and the asp Wizard, since there are no update panels or AJAX settings in the code you have sent, yet I suggest that you examine the following help article on the correct way to ajaxify a RadWindow: http://www.telerik.com/help/aspnet-ajax/radwindow-ajaxifying.html.

    What I would advise is that you manage to get this working outside of a RadWIndow by placing it simply in an asp Update Panel. THe buttons that should close the RadWindow and reset the wizard can have server-side handlers that set the ActiveStepIndex of the wizard and inject a JavaScript function that will close the RadWindow. I would also advise using the regular asp Update Panel with updateMode set to conditional for such a complex scenario, as I am generally not sure if your wizard works correctly without the RadWindow - the error you get means that for some reason the RadButton has been disposed and not initialized properly ,which usually indicated an incorrect AJAX  scenario. I believe you may also find this MSDN article useful.

    The easiest alternative is to place the wizard in a separate page, point the RadWindow to it and set its ReloadOnShow property to true so that every time it reopens the page will be loaded anew and thus the wizard will start from the beginning.


    Kind regards,
    Marin
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Ahmed
    Ahmed avatar
    11 posts
    Member since:
    Jul 2011

    Posted 13 Sep 2011 Link to this post

    Thanks
Back to Top