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

RadAJAX Loading Panel

4 Answers 278 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
digitall
Top achievements
Rank 1
digitall asked on 17 May 2008, 04:08 AM
I am trying to use a LoadingPanel along with an AJAX callback over top of a ListView control and can't seem to get it to display. No errors occur and the AJAX callback works fine, but the loading panel never shows. I even tried using the old school "<font size='7'>UPDATING</font>" trick to see if I could see it flash anywhere, and still nothing. I had a call to make the thread sleep for 2500ms just to test the visibility and still nothing. Here is the markup, any suggestions?
    <asp:ListView runat="server" ID="lsHours"
        <LayoutTemplate> 
            <table id="tw" runat="server" class="yui-grid"
                <tr> 
                    <th>&nbsp;</th> 
                    <th>Day</th> 
                    <th>Hours</th> 
                </tr> 
                <tr id="itemPlaceholder" runat="server" /> 
            </table> 
        </LayoutTemplate> 
        <ItemTemplate> 
            <tr valign="top" class='<%# Container.DataItemIndex % 2 == 0 ? "row" : "altrow" %>'
                <td width="45"
                    <input type="button" onclick="javascript:openWindow('<%#Eval("Day") %>'); return false;" value="Edit" class="smallbutton" />  
                </td> 
                <td width="150" nowrap="nowrap"><strong><%# Eval("Day") %></strong></td> 
                <td><strong><%#Eval("Hours") %></strong></td> 
            </tr> 
        </ItemTemplate> 
    </asp:ListView> 
    <script language="javascript" type="text/javascript"
        function openWindow(pDay) { 
            var oWnd; 
             
            oWnd = window.radopen("modals/hoursmaint.aspx?Day=" + pDay, "RadWindow1") 
             
            oWnd.Center(); 
        } 
         
        function HoursModifiedCallback(args) { 
            var ajaxManager = $find('ctl00_cpContent_RadAjaxManager1'); 
            ajaxManager.ajaxRequest(args); 
        } 
    </script> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" VisibleOnPageLoad="false" Behaviors="Close, Reload" Modal="true" /> 
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" EnableHistory="True" OnAjaxRequest="RadAjaxManager1_AjaxRequest"
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="lsHours" LoadingPanelID="LoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1"
        <font size="7">UPDATING</font> 
    </telerik:RadAjaxLoadingPanel> 

As a side note, you'll notice I am specifying the ClientID of the RadAJAXManager control declaritively instead of using the ClientID property. Whenever I try using ClientID with <%= %> I get the infamous "Controls Collection cannot be modified.." error. If I use <%# %> as Rick Strahl suggests, the value is simply null so the $find function looks like $find('') which does me no good. If anyone has a workaround for that issue it would be much appreciated!

4 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 17 May 2008, 12:18 PM
Hi digitall,

Is this a content page of master page or a web user controls scenario? You can place the RadAjaxManager along with the LoadingPanel on the master/main page. You can use the GetCurrent() manager static method to get the instance and call its ajaxRequest method. Find more info here.

As to the server-side code block error, you can wrap the script in RadCodeBlock control.

Kind regards,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
digitall
Top achievements
Rank 1
answered on 17 May 2008, 02:27 PM
Hi Konstantin,

Your second option worked great with the RadCodeBlock control. I didn't even realize this existed, but will certainly use it from now on.

As for the other advice, I'm not entirely sure I follow. It is a master/content scenario (no user controls), but as of now I don't want the AjaxManager on the master page since not every page will need this functionality. Is there something in the way I am declaring everything in the markup that is incorrect and causing me not to see the LoadingPanel? I tried setting the updated control to RadAjaxManager1 and the LoadingPanel does flash in this scenario at the very top-left of the screen. I want it to cover my ListView control like all of the Telerik demos show where it is over top a RadGrid though (as an example). The AJAX call itself works great and my ListView control does in fact update itself when the RadWindow I am using closes itself, but I just can't get the LoadingPanel to display.
0
Accepted
Iana Tsolova
Telerik team
answered on 19 May 2008, 01:01 PM
Hi digitall,

Unfortunately I couldn't replicate the described behavior. Please find attached a sample project and let me know how it goes on your end or if I am missing something from your logic.

Best regards,
Iana
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
digitall
Top achievements
Rank 1
answered on 19 May 2008, 01:33 PM
Iana,

Your example works fine, however I am doing everything over a ListView control and not a RadGrid. For the sake of simplicity I think I am going to switch from the ListView to the RadGrid control though and give it a shot. If I still have issues I'll contact you again. Thanks!
Tags
Ajax
Asked by
digitall
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
digitall
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or