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?