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

LoadOnDemand problem with AjaxPanel

10 Answers 183 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 13 Feb 2009, 02:08 PM
I'm having a combobox (with load on demand enabled) and a ajax panel on my page. When the ajax panel is loading, the combobox is unable to retrieve the items. How can I solve this, so the user can open the combobox while the panel is loading?

You can use the following code to reproduce the problem. Just click the reload button, and open the combobox immediately afther that.

<telerik:RadScriptBlock runat="server" ID="scriptBlock"
<script type="text/javascript"
function reload()  
    $find("<%=pnl.ClientID %>").ajaxRequest(); 
</script> 
</telerik:RadScriptBlock> 
 
<script runat="server"
     
    Protected Sub pnlAjaxRequest(ByVal sender As Object, ByVal e As EventArgs) 
 
        Threading.Thread.Sleep(1000) 
 
    End Sub 
     
    Protected Sub cmbTestItemsRequested(ByVal sender As Object, ByVal e As EventArgs) 
         
        Dim cmb = DirectCast(sender, RadComboBox) 
        cmb.DataSource = New String() {"John Doe", "Jane Doe", "Baby Doe"} 
        cmb.DataBind() 
         
    End Sub 
     
</script> 
 
<asp:Button runat="server" ID="clickme" OnClientClick="reload(); return false;" Text="Reload" /> 
 
<telerik:RadComboBox runat="server" ID="cmbTest" OnItemsRequested="cmbTestItemsRequested" EnableLoadOnDemand="true"
</telerik:RadComboBox> 
       
<telerik:RadAjaxLoadingPanel runat="server" ID="loadingPanel"></telerik:RadAjaxLoadingPanel> 
<telerik:RadAjaxPanel ID="pnl" runat="server" LoadingPanelID="loadingPanel" OnAjaxRequest="pnlAjaxRequest"
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean fermentum auctor lectus. Aliquam erat volutpat. Integer in tellus. Morbi vitae pede quis pede rutrum feugiat. Vestibulum et dui vel mauris placerat porta. In hac habitasse platea dictumst. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus blandit. Maecenas hendrerit orci non turpis eleifend venenatis. Duis vitae orci eget turpis tristique venenatis. Aliquam vitae libero vel libero pharetra bibendum. Mauris hendrerit hendrerit mauris. Cras fringilla dolor in nibh. Duis gravida rhoncus tellus. Praesent eget orci. Duis ultrices leo non justo. Quisque egestas.        
</telerik:RadAjaxPanel> 

10 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 16 Feb 2009, 03:07 PM
Hi Paul,

Unfortunately you can't execute multiple simultaneous partial postbacks in the current framework. The requests are queued and executed one after another. 

Kind regards,
Yana
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
Paul
Top achievements
Rank 1
answered on 16 Feb 2009, 03:29 PM
Hello Yana,

When the request is queued, I'm expecting the items to be loaded when the ajax panel is completed reloading, but the message in the combobox stays 'Loading...'. There is also no request failed event triggered to catch this case. Using firebug in Firefox, I cannot discover a request that loads the items.

I need a solution to catch this case in JavaScript, so I can reload them manually, or in the ideal situation, the items are loaded after all.

Kind regards,
Paul
0
Yana
Telerik team
answered on 17 Feb 2009, 08:22 AM
Hi Paul,

I tested the provided code and RadComboBox items are loaded right after RadAjaxPanel's request is finished. It's weird that it's not working at your side. Can you reproduce it with exactly the same code from your first post?

Kind regards,
Yana
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
Paul
Top achievements
Rank 1
answered on 17 Feb 2009, 08:36 AM
It's weird indeed. I've just created a new webpage and copied the code; eventually I also had to add a RadScriptManager, but after that, it still did not work.
The following steps I execute:
  1. Click 'Reload'
  2. BEFORE the panel completes loading, open the combobox
  3. wait till the panel is completed loading
  4. The combobox should load now, but nothing happens
    If I check the events which are triggered by the combobox, the itemsrequesting is NOT triggered. 
  5. Close the combobox and open it again; now the items are loaded...

I want to avoid step 5, because this is confusing for the end-user.

Kind regards,
Paul


0
Yana
Telerik team
answered on 19 Feb 2009, 02:43 PM
Hello Paul,

I also changed EventArgs of event handlers like this:

 Protected Sub pnlAjaxRequest(ByVal sender As ObjectByVal e As Telerik.Web.UI.AjaxRequestEventArgs)  
        Threading.Thread.Sleep(1000)  
    End Sub 
        
    Protected Sub cmbTestItemsRequested(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs)  
        Dim cmb = DirectCast(sender, RadComboBox)  
        cmb.DataSource = New String() {"John Doe""Jane Doe""Baby Doe"}  
        cmb.DataBind()        
    End Sub 

Could you please try it?

All the best,
Yana
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
Paul
Top achievements
Rank 1
answered on 19 Feb 2009, 02:52 PM
I've just tried your piece of VB-code, but this doesn't solve the problem.

Have you got another solution for this problem?
0
Yana
Telerik team
answered on 20 Feb 2009, 12:20 PM
Hello Paul,

I've attached a screenshot showing that both ajax requests are returned at our side, the first one is from RadAjaxPanel, the second from RadComboBox, even the second is returned before the first. Please check the settings of your IIS, it may cause this issue. 

Greetings,
Yana
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
Paul
Top achievements
Rank 1
answered on 20 Feb 2009, 02:50 PM
Indeed, your screenshot indicates the loading works. But here it doesn't...
I've created a new ajax enabled project, pasted the code in the page and added a reference to Telerik.Web.UI (version 2008.3.1314.35), added a tag prefix, added the handler and compiled the project.
But when I open the page with the built in web server from Visual Studio 2008, my sample still doesn't work.

Also, which setting in IIS could cause this problem? All the other telerik functionality does work.

I personally don't think the problem is IIS because the request is NOT displayed in Firebug. I also tried to find the request with Fiddler, but also with this proxy, I can't find the request. So I'm sure the request is NOT made.

Kind regards,
Paul
0
Yana
Telerik team
answered on 23 Feb 2009, 02:07 PM
Hi Paul,

Finally I was able to reproduce this issue in Visual Studio 2008 with 2008.3.1314.35 version of RadControls, until now I tested  in Visual Studio 2005 with  v2008.3.1314.20 and it worked without a problem. We need some more time to investigate the reasons for this issue and try to fix it. You'll be informed as soon as we're ready. Thank you for your patience.

All the best,
Yana
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
Yana
Telerik team
answered on 27 Feb 2009, 01:52 PM
Hi Paul,

I'm sorry for the delayed reply.

We've replaced RadAjaxPanel with classic UpdatePanel and the issue still persists. Unfortunately it seems to be a problem with the framework and we're not able to help further.

Regards,
Yana
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.
Tags
ComboBox
Asked by
Paul
Top achievements
Rank 1
Answers by
Yana
Telerik team
Paul
Top achievements
Rank 1
Share this question
or