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

Ajax manager issues - button disappears and 'a is undefined'

1 Answer 77 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Iggy
Top achievements
Rank 1
Iggy asked on 31 Mar 2010, 03:43 PM

I am using a RadWindow to show a wizard style dialog.  On the page I have a RadMultiPage and on each pageview I have the controls  and navigation buttons.

The first pageview contains two RadListBoxes.  The first one has autopostback set to true and on the Check event I populate the second listbox.  I have these ajaxified as follows:

<telerik:AjaxSetting AjaxControlID="rlbList1">  
    <UpdatedControls> 
        <telerik:AjaxUpdatedControl ControlID="rlbList1" /> 
        <telerik:AjaxUpdatedControl ControlID="rlbList2" /> 
        <telerik:AjaxUpdatedControl ControlID="lblErrorText" /> 
    </UpdatedControls> 
</telerik:AjaxSetting> 

This works fine, when I click an item in the first list the second list is updated correctly through the callback.

The issues come in when I press the "Next" button on this pageview.  I have it ajaxified as follows:
<telerik:AjaxSetting AjaxControlID="btnNext">  
    <UpdatedControls> 
        <telerik:AjaxUpdatedControl ControlID="btnNext" LoadingPanelID="rlpDisable" /> 
        <telerik:AjaxUpdatedControl ControlID="btnCancel" LoadingPanelID="rlpDisable" /> 
        <telerik:AjaxUpdatedControl ControlID="rlbList1" /> 
        <telerik:AjaxUpdatedControl ControlID="rlbList2" />                          
        <telerik:AjaxUpdatedControl ControlID="rmpMain" /> 
        <telerik:AjaxUpdatedControl ControlID="lblPage1ErrorText" /> 
        <telerik:AjaxUpdatedControl ControlID="lblPage2ErrorText" /> 
    </UpdatedControls> 
</telerik:AjaxSetting> 


This is the code I have in the Next click event method, Page_Load and Init only have code that runs on the initial load.

if (rlbList2.CheckedItems.Count == 0)  
{  
    lblErrorText.Text = "At least one item must be selected.";  
}  
else 
{  
    //Populate items on the second page using selected items on first page  
    _PopulateListOnPage2(rlbList2.CheckedItems.Select(p => p.Value).ToArray());  
    rmpMain.SelectedIndex = 1;  


This causes two "a is undefined" errors in javascript.  If I remove the rlbList# controls from the ajax this stops the javascript errors. 

The other issue is that if an error occurrs and I don't change the mulpage selectedindex, then the buttons disappear.  I've tried it without the loading panel showing over the buttons and the same thing occurs.  Also, if I leave the listboxes in the updated controls collection these will also disappear if the selected pageview doesn't change (I receive the 'a is undefined' errors though). 

But if I switch to the next pageview and come back to this one then everything shows correctly. 

If I remove the Ajax manager then everything works correctly through the postbacks.  So to get around this I removed the Ajax manager and wrapped the MultipPage with a RadAjaxPanel and now everything seems to work correctly.  I would rather not do this though because the loading panel shows over the whole ajax panel control instead of just the controls I want to disable.  Is there something I'm missing with how the ajax manager works with the RadMultiPage or why would my controls be disappearing?


1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 06 Apr 2010, 11:21 AM
Hello Iggy,

I reviewed the code snippets, and they look correct.
If the issues persist, you can open a formal support ticket, and send us a small project, demonstrating your setup, for additional review and testing.

Kind regards,
Yavor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Ajax
Asked by
Iggy
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or