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

How to add a ajaxloadingpanel in a window

6 Answers 100 Views
Window
This is a migrated thread and some comments may be shown as answers.
thdwlgP
Top achievements
Rank 1
thdwlgP asked on 21 Aug 2009, 04:32 AM
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); 

6 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 21 Aug 2009, 07:51 AM
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.
0
thdwlgP
Top achievements
Rank 1
answered on 21 Aug 2009, 11:08 PM
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); 
0
Georgi Tunev
Telerik team
answered on 24 Aug 2009, 11:11 AM
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.
0
thdwlgP
Top achievements
Rank 1
answered on 26 Aug 2009, 07:03 AM
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.
0
Accepted
Georgi Tunev
Telerik team
answered on 27 Aug 2009, 07:37 AM
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.
0
thdwlgP
Top achievements
Rank 1
answered on 27 Aug 2009, 04:29 PM
I saw the response. Thanks. That worked.
Tags
Window
Asked by
thdwlgP
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
thdwlgP
Top achievements
Rank 1
Share this question
or