How to add a ajaxloadingpanel in a window

7 posts, 1 answers
  1. thdwlgP
    thdwlgP avatar
    34 posts
    Member since:
    Mar 2009

    Posted 20 Aug 2009 Link to this post

    I have a page that is a radwindow, but in the code, I have 2 panels. Panel 1 shows up on page load, and depending on the selection, it hides Panel1 and shows Panel2. and from Panel2, the selection needs to close the window and return the result back to parent page.

    It works fine except for the loadingpanel. I need a loader to show when it changes from Panel1 to Panel2 and when Panel2 button is closed. But as soon as I put in a Ajaxmanager and the loadingpanel, it wont close the window on uxSelectMarketType button click.

    HTML Code
    <script type="text/javascript"
     
            function RedirectToAddCustomer() { 
                GetRadWindow().BrowserWindow.RedirectToAddCustomer(); 
            } 
     
            function Close() { 
                GetRadWindow().Close(); 
            } 
          
        </script> 
     
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="uxContinueOrder"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="uxAllPanel" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="uxSelectMarketType"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="uxAllPanel" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Vista"
    /> 
        <div> 
            <asp:ImageButton ID="uxCancelNewOrder" runat="server" ImageUrl="~/images/closepopup.gif" 
                CssClass="FR" ToolTip="Cancel" OnClick="uxClose_Click" /> 
            <asp:Panel ID="uxAllPanel" runat="server"
                <asp:Panel ID="uxOrderTypePanel" runat="server"
                    <h2> 
                        Select Order Type</h2
                    <br /> 
                    <asp:RadioButtonList ID="uxOrderTypes" runat="server" CssClass="Table1" Width="100%"
                    </asp:RadioButtonList> 
                    <br /> 
                    <asp:Button ID="uxContinueOrder" runat="server" OnClick="SelectOrderTypes_Click" 
                        Text="Continue" CssClass="FR Button"
                    </asp:Button> 
                </asp:Panel> 
                <asp:Panel ID="uxMarketTypePanel" runat="server" Visible="false"
                    <h2> 
                        Select Market Type</h2
                    <br /> 
                    <asp:RadioButtonList ID="uxMarketType" runat="server" CssClass="Table1" Width="100%"
                    </asp:RadioButtonList> 
                    <br /> 
                    <asp:Button ID="uxSelectMarketType" runat="server" OnClick="uxSelectMarketType_OnClick" 
                        Text="Submit" CssClass="FR Button"
                    </asp:Button> 
                </asp:Panel> 
            </asp:Panel> 
        </div> 

    uxSelectMarketType_OnClick does... and it does run the code RedirectToAddCustomer() but just doesnt call RadWindow.Close().
                    ClientScript.RegisterStartupScript(Page.GetType(), "myKey""RedirectToAddCustomer();"true); 

  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 21 Aug 2009 Link to this post

    Hi thdwlgP,

    I see in your code that your RedirectToAddCustomer() function simply calls another function in the parent page, but it does not call GetRadWindow().close(). Have you tried putting GetRadWindow().close() in RedirectToAddCustomer()?
    Let me know if I am missing something.


    Regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. thdwlgP
    thdwlgP avatar
    34 posts
    Member since:
    Mar 2009

    Posted 21 Aug 2009 Link to this post

    I tried

    function RedirectToAddCustomer() { 
                GetRadWindow().BrowserWindow.RedirectToAddCustomer();
                GetRadWindow().Close(); 
            } 
     
     function Close() { 
                GetRadWindow().Close(); 
            } 

    Didnt work. I've tried to register the script from the serverside

     ClientScript.RegisterStartupScript(Page.GetType(), "myKey""RedirectToAddCustomer();"true);
     ClientScript.RegisterStartupScript(Page.GetType(), "myKey""Close();"true);

    as well but didnt work either...

    Is there a sample app that does something similar to this? Where it Shows the loader before the modal closes?


     ClientScript.RegisterStartupScript(Page.GetType(), "myKey""RedirectToAddCustomer();"true); 
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 24 Aug 2009 Link to this post

    Hello thdwlgP,

    There is no such example as this is a specific scenario, but if you open a support ticket and send me a small sample project where the problem can be reproduced, I will check it right away. Just make sure that the project can be run locally and attach it to the ticket.


    Regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. thdwlgP
    thdwlgP avatar
    34 posts
    Member since:
    Mar 2009

    Posted 26 Aug 2009 Link to this post

    Georgi,
    I've added a support ticket

    "Your ticket ID is : 237835"


    Please look at the attached solution. It's a simple 3 page project. Default has a button to open another page ModalForm.aspx in a Radwindow.

    I forgot to comment out the Line 39 through 53 in ModalForm.aspx. The code works with those lined commented out. If uncommented, the modal does not redirect.  After selecting radio buttons, on Continue button click it should redirect to RedirectPage.aspx

    Let me know what the fix is. Thanks.
  6. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 27 Aug 2009 Link to this post

    Hello thdwlgP,

    I see that Fiko has already answered your support ticket. For convenience I am pasting his reply below:

    In your case this behavior is the expected one. When you need to call JavaScript code from the server in an AJAX update, then you need to use the ScriptManager.RegisterStartupScript function. In your case the code inside the uxSelectMarketType_OnClick handler should look like this :

    protected void uxSelectMarketType_OnClick(object sender, EventArgs e)  
    {  
        if (uxMarketType.SelectedIndex > -1)  
        {  
            ScriptManager.RegisterStartupScript(thisthis.GetType(), "myKey""RedirectToAddCustomer();"true);  
        }  
    For your convenience I have reworked your project and attached it to the thread.
    Please do not hesitate to contact us if you experience any further problems.

    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. thdwlgP
    thdwlgP avatar
    34 posts
    Member since:
    Mar 2009

    Posted 27 Aug 2009 Link to this post

    I saw the response. Thanks. That worked.
Back to Top