Can't make a selection following AJAX call

7 posts, 0 answers
  1. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 29 Mar 2013 Link to this post

    Hi

    I have a RADCombo Box updating another RADCombo on selected changed event. This is done with the RadAjaxManager.

    It works for the first selection, but I'm not able to make any selection in the first Radcombo box following the first one.

    I have both combo boxes in a RadPanelBar Panel item content template.

    Any ideas?

    In addition the expand behaviour of the RadPanelBar is also broken following the AJAX roundtrip.

    Andy
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 29 Mar 2013 Link to this post

    Hi Andy,

    Can you please provide some more information on the scenario that you have? For instance if you are using master and content page scenario or user controls. Providing us with the  code that you use will help us replicate the issue that you describe from our side so we can help you out in the most efficient way.

    Kind regards,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 29 Mar 2013 Link to this post


    Hi

    This is the page, there is some control loading that takes place to populate the specialties combo, but I've not included that.

    The problem seems to be where I have the PanelBar on the page. I use this code in other places in a masterpage and its OK.

    Andy
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Outcome.aspx.vb" Inherits="Modal_Outcome" %>
     
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
     
    <head id="Head1" runat="server">
     
    <meta http-equiv="Cache-Control" content="no-cache"/>
    <meta http-equiv="Pragma" content="no-cache"/>
    <meta http-equiv="Expires" content="0"/>
     
        <title>Outcomes</title>
         
        <link rel="shortcut icon" href="/favicon.ico"/>
         
        <link id="Link1" href="~/App_Themes/Default/Grid.Activity.css" rel="stylesheet" type="text/css" runat="server"/>
        <link id="Link2" href="~/App_Themes/Default/ToolTip.Activity.css" rel="stylesheet" type="text/css" runat="server"/>
        <link id="Link3" href="~/App_Themes/Default/ComboBox.Activity.css" rel="stylesheet" type="text/css" runat="server"/>
        <link id="Link4" href="~/App_Themes/Default/Calendar.Activity.css" rel="stylesheet" type="text/css" runat="server"/>
        <link id="Link5" href="~/App_Themes/Default/Button.Activity.css" rel="stylesheet" type="text/css" runat="server"/>
             
        <link id="Link6" href="~/App_Themes/Default/Layout.css" rel="stylesheet" type="text/css" runat="server" />
        <link id="Link7" href="~/App_Themes/Default/Styles.css" rel="stylesheet" type="text/css" runat="server" />
     
     
        <asp:literal id="overrideCss" runat="server"></asp:literal>
     
        <script src="../JavaScript/Outcome.js" type="text/javascript"></script>
        <script src="../JavaScript/jquery-1.9.1.min.js"  type="text/javascript"></script>
     
      
    </head>
    <body>
               
    <form id="aspnetForm" runat="server">
     
    <telerik:RadScriptManager ID="ScriptManager" Runat="server"></telerik:RadScriptManager>
     
    <telerik:RadAjaxManager ID="AjaxManager" runat="server" UpdatePanelsRenderMode="Inline" DefaultLoadingPanelID="LoadingPanel" OnAjaxRequest="AjaxManager_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ddlSpecialty">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlClinic" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
        </telerik:RadAjaxManager>
              
    <script type="text/javascript">
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }
     
        function CloseAndRebind(args) {
            GetRadWindow().BrowserWindow.refreshGrid();
            GetRadWindow().Close();
        }
     
        function Close() {
            GetRadWindow().Close();
        }
     
     
        function setRoutineFollowupTime(val) {
            
            if ($("#rblPriority_0").attr('checked')) {
                var txt = $find('#rblPriority');
                //alert(txt);
                txt.set_value(val);
            }
        }
     
     
        $(document).ready(function () {
            //Hide <div> elements initially
            $("#pnlRefer,#pnlTreatment,#pnlBookAppointment,#divTests,#divTestHelper").hide();
     
            //$('#<%=rblDischarge.ClientID%> input[type="radio"]').change(function () {
            //    alert($('#<%=rblDischarge.ClientID%> :checked').val());
     
            // });
     
            //Handles changing any of your radio inputs within your Pathway Outcomes
            $('#<%=rblDischarge.ClientID%> input[type="radio"]').change(function () {
                if ($(this).val() == "Yes") {
                    $("#pnlRefer").show();
                    $("#pnlTreatment").hide();
                }
                else {
                    $("#pnlRefer").hide();
                    $("#pnlTreatment").show();
                }
            });
        });
     
     
        function toggleTests() {
            // alert("Boo");
     
            if (document.getElementById("divTests").style.display == 'none') {
                document.getElementById("divTests").style.display = 'block';
                document.getElementById("divTestHelper").style.display = 'block';
            } else {
                document.getElementById("divTests").style.display = 'none';
                document.getElementById("divTestHelper").style.display = 'none';
            }
        }
     
     
    </script>
     
     <table cellpadding="4" cellspacing="0"width="100%" >
                    <tr>
                        <td rowspan="2" width="1%">
                            <img alt="" src="../App_Themes/Images/patient.gif"/>
                        </td>
                        <td>Patient No:</td>
                        <td><asp:Label ID="lblPatNo" runat="server" Text=""></asp:Label></td>
                        <td>NHS No:</td>
                        <td> <asp:Label ID="lblPatNHSNo" runat="server" Text=""></asp:Label></td>
                        <td>DoB:</td>
                        <td><asp:Label ID="lblPatDob" runat="server" Text=""></asp:Label></td>
                        <td align="right">
                            <div id="loading">
                                <telerik:RadAjaxLoadingPanel ID="LoadingPanel" runat="Server" IsSticky="true" >
                                   <img alt="Loading..." src="../App_Themes/Images/loading7.gif" width="25px" height="25px"/>
                                </telerik:RadAjaxLoadingPanel>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>Appointment Details</td>
                        <td><asp:Label ID="lblPatAppt" runat="server" Text=""></asp:Label></td>
                        <td>Previuos RTT:</td>
                        <td><asp:Label ID="lblPreviousRTT" runat="server" Text=""></asp:Label></td>
                        <td>Last updated By:</td>
                        <td><asp:Label ID="lblUpdateBy" runat="server" Text=""></asp:Label></td>
                        <td> </td>
                    </tr>
                </table>
     
     
     
    <telerik:RadPanelBar runat="server" ID="rpbOutcomes" Width="100%" ExpandMode="MultipleExpandedItems"
     
            <Items>
                <telerik:RadPanelItem Text="Procedures" >
                    <ContentTemplate>
     
                            Procedures
     
                    </ContentTemplate>
     
                </telerik:RadPanelItem>
     
                <telerik:RadPanelItem Text="Pathway Outcome"   >
                    <ContentTemplate>
                         
                        <div class="sectionContainer">
     
                            <table cellpadding="4" cellspacing="0">
                               <tr>
                                   <td valign="top">
                                        Do you wish to discharge patient?
                                        <asp:RadioButtonList ID="rblDischarge" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                                            <asp:ListItem  Text="No" />
                                            <asp:ListItem  Text="Yes"/>
                                        </asp:RadioButtonList>
                                        <asp:RequiredFieldValidator ID="rfvDischarge" runat="server" ControlToValidate="rblDischarge"><img src="../App_Themes/Images/Missing_10.gif" alt="Missing Field"/></asp:RequiredFieldValidator>
                                   </td>
     
                                   <td>
                                        <div id="pnlRefer">
     
                                            <asp:RadioButtonList ID="rblRefer" runat="server"  RepeatLayout="Flow"  DataTextField="Name" DataValueField="Value"></asp:RadioButtonList>
                               
                                            <telerik:RadComboBox ID="cboReferrerSpeciality" runat="server" Width="250px" CausesValidation="false" DataTextField="Name" DataValueField="Value" style="display:none;" ></telerik:RadComboBox>
                                            <telerik:RadComboBox ID="cboReferralDetails" runat="server" Width="250px"  DataTextField="Name" DataValueField="Value" style="display:none;"></telerik:RadComboBox>
          
                                        </div>
                                    
                                        <div id="pnlTreatment">
     
                                            <asp:RadioButtonList ID="rblTreat" runat="server" RepeatLayout="Flow"  DataTextField="Name" DataValueField="Value"></asp:RadioButtonList>
      
                                        </div>
                                   </td>
     
                                   <td>
                                        <asp:Panel ID="pnlPathwayOutcomeHelper" runat="server">
                                            <asp:Label ID="lblReferHelper" runat="server"></asp:Label>
                                            <asp:Label ID="lblTreatmentHelper" runat="server"></asp:Label>
                                        </asp:Panel>
                                   </td>
     
                               </tr>
                           </table>
     
                        </div>
     
                    </ContentTemplate>
                </telerik:RadPanelItem>
     
                <telerik:RadPanelItem Text="Attendance Outcome" Expanded="true">
                    <ContentTemplate>
     
                        <div class="sectionContainer">
     
                            <table cellpadding="4" cellspacing="0">
                                <tr>
                                    <td valign="top">
                                        Book another appointment?
                                        <asp:RadioButtonList ID="rblBookAppointment" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                                            <asp:ListItem Text="No" Selected="True" onclick="toggleAttendance();" />
                                            <asp:ListItem Text="Yes"  onclick="toggleAttendance();" />
                                        </asp:RadioButtonList>
                                        <asp:RequiredFieldValidator ID="rfvBookAppointment" runat="server" ControlToValidate="rblBookAppointment"><img src="../App_Themes/Images/Missing_10.gif" alt="Missing Field"/></asp:RequiredFieldValidator>
                                    </td>
                                 
                                    <td>
                                        <div id="pnlBookAppointment">
     
                                            <table cellpadding="4" cellspacing="0" border="0">
                                                <tr>
                                                    <td valign="top">Appointment Type:</td>
                                                    <td>
                                                        <asp:RadioButtonList ID="rblApptType" runat="server" RepeatDirection="Horizontal"  RepeatLayout="Flow" ClientIDMode="Static">
                                                            <asp:ListItem Text="New" Selected="True" Value="N" onclick="setRoutineFollowupTime('');" />
                                                            <asp:ListItem Text="Follow-up" Value="F" onclick="setRoutineFollowupTime(6);" />
                                                        </asp:RadioButtonList>
                                                    </td>
                                                    <td></td>
                                                </tr>
     
     
     
     
                                                <tr>
     
                                                    <td>Specialty to book into:</td>
                                                    <td><telerik:RadComboBox ID="ddlSpecialty" runat="server"   EnableEmbeddedSkins="false" Skin="Activity" Width="300px"  emptyMessage=" " AutoPostBack="true" CausesValidation="false" AppendDataBoundItems="true"></telerik:RadComboBox></td>
                                                    <td></td>
                                                </tr>
     
                                                     <tr>
     
                                                    <td>Clinic to be seen in:</td>
                                                    <td><telerik:RadComboBox ID="ddlClinic" Runat="server" Width="185px" EnableEmbeddedSkins="false" Skin="Activity"  emptyMessage=" " ></telerik:RadComboBox></td>
                                                    <td></td>
                                                     </tr>
     
                                                     <tr>
     
                                                    <td>Clinician to see:</td>
                                                    <td>
                                                        <telerik:RadComboBox ID="ddlConsultant" Runat="server" Width="185px" EnableEmbeddedSkins="false" Skin="Activity" emptyMessage=" " AllowCustomText="true" >
                                                             <Items>
                                                                <telerik:RadComboBoxItem Text="" Value="" />
                                                                <telerik:RadComboBoxItem Text="Consultant Only" Value="Consultant Only" />
                                                            </Items>
     
                                                        </telerik:RadComboBox>
                                                        Either select from list ot type new
                                                    </td>
                                                         <td></td>
                                                </tr>
     
                                                     <tr>
     
                                                    <td>Priority:</td>
                                                    <td>
                                                        <asp:RadioButtonList ID="rblPriority" runat="server" RepeatDirection="Horizontal"   RepeatLayout="Flow" ClientIDMode="Static">
                                                            <asp:ListItem Text="Routine" Selected="True" Value="R" />
                                                            <asp:ListItem Text="Urgent" Value="U" />
                                                        </asp:RadioButtonList>
                                                   </td>
                                                         <td></td>
                                                </tr>
     
                                                     <tr>
     
                                                    <td valign="top">Book Appointment in:</td>
                                                    <td>
                                                        <asp:TextBox ID="txtAppointmentIn" runat="server" ClientIDMode="Static" Width="40px"></asp:TextBox>
     
                                                        <asp:RadioButtonList ID="rdoApptIn" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                                                            <asp:ListItem Text="Days" Value="D" onclick="toggleBookAppt(false);" />
                                                            <asp:ListItem Text="Weeks" Selected="True" Value="W" onclick="toggleBookAppt(false);" />
                                                            <asp:ListItem Text="Months" Value="M" onclick="toggleBookAppt(false);" />
                                                        </asp:RadioButtonList>
                                                        <br />Or
                                                        <asp:CheckBox ID="chkTests" runat="server" Text="Appointment to be made after results" TextAlign="Right" onClick="toggleTests();"   />
                                                    </td>
                                                         <td></td>
                                                </tr>
     
     
     
     
     
                                                
                                                 
                                                    <tr>
     
                                                        <td></td>
                                                        <td>
                                                            <div id="divTests" style=" border:1px solid #ccc;">
                                                                <asp:CheckBoxList ID="clbTests" runat="server"  RepeatDirection="Horizontal" RepeatColumns="5">
                                                                    <asp:ListItem Text="Imaging" Value="1" />
                                                                            </asp:CheckBoxList>
                                                            </div>
                                                        </td>
                                                        <td><div id="divTestHelper"></div></td>
                                                    </tr>
                                                 
                                               
     
     
     
     
                                                       <tr>
     
                                                    <td>Transport required:</td>
                                                    <td>
                                                        <asp:RadioButtonList ID="rdoApptTransport" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                                                            <asp:ListItem Text="No" Selected="True" onclick="enableTransport(false);" />
                                                            <asp:ListItem Text="Yes" onclick="enableTransport(true);" />
                                                        </asp:RadioButtonList>
     
                                                        <asp:RadioButtonList ID="rdoApptTransportType" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" Enabled="false">
                                                            <asp:ListItem Text="Walking" Selected="True" Value="W" />
                                                            <asp:ListItem Text="Chair" Value="C" />
                                                            <asp:ListItem Text="Stretcher" Value="S" />
                                                        </asp:RadioButtonList>
                                                    </td>
                                                           <td></td>
                                                </tr>
     
     
                                                       <tr>
     
                                                    <td>Translator Required:</td>
                                                    <td>
                                                        <asp:RadioButtonList ID="rdoApptTranslator" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                                                            <asp:ListItem Text="No" Selected="True" onclick="toggleTranslator(false);" />
                                                            <asp:ListItem Text="Yes" onclick="toggleTranslator(true);" />
                                                        </asp:RadioButtonList>
     
                                                        <telerik:RadComboBox ID="cboTranslator" runat="server" Width="200px" Enabled="false">
                                                            <Items>
                                                                <telerik:RadComboBoxItem Text="" />
                                                                <telerik:RadComboBoxItem Text="Akan (Ashanti)" />
                                                                <telerik:RadComboBoxItem Text="Albanian" />
                                                                <telerik:RadComboBoxItem Text="Amharic" />
                                                                <telerik:RadComboBoxItem Text="Arabic" />
        
                                                            </Items>
                                                        </telerik:RadComboBox>
     
                                                         <asp:RequiredFieldValidator ID="valTranslator" CssClass="validator" runat="server"  ControlToValidate="cboTranslator" ErrorMessage="Translator required" Text=""   Width="16px" Height="16px" Enabled="false" Display="Static"> </asp:RequiredFieldValidator>
                                                    </td>
                                                           <td></td>
                                                </tr>
     
     
                                                       <tr>
     
                                                    <td valign="top">Further Instructions:</td>
                                                    <td> <telerik:RadTextBox ID="txtApptNotes" runat="server" Width="500px" Height="75px" TextMode="MultiLine"></telerik:RadTextBox></td>
                                                           <td></td>
                                                </tr>
     
     
     
                                            </table>
     
     
     
     
                                        </div>
                                    </td>
                                </tr>
                                 
                            </table>
     
                        </div>
     
                    </ContentTemplate>
                </telerik:RadPanelItem>
     
                <telerik:RadPanelItem Text="Complete"  >
                    <ContentTemplate>
     
                        <div class="sectionContainer">
                            <asp:RadioButtonList ID="rblCompleteOutcome" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                                <asp:ListItem Text="No" Selected="True" onclick="toggleSave();" />
                                <asp:ListItem Text="Yes"  onclick="toggleSave();" />
                            </asp:RadioButtonList>
                        </div>
     
                    </ContentTemplate>
                </telerik:RadPanelItem>
     
            </Items>
     
        </telerik:RadPanelBar>
     
        <div id="butPanel">
            <table>
                <tr>
                    <td>
                        <telerik:RadButton ID="butSaveDraft" runat="server" Text="Save Draft"  OnClick="butSave_Click" CommandArgument="false" OnClientClicked="disableSubmit" CausesValidation="false" EnableEmbeddedSkins="False" Skin="Activity">
                            <Icon PrimaryIconUrl="../App_Themes/Images/Add_Orange_16.png"/>
                        </telerik:RadButton>
                        <telerik:RadButton ID="butSave" runat="server" Text="Save"  OnClick="butSave_Click" CommandArgument="true" OnClientClicked="disableSubmit" style="display:none;" EnableEmbeddedSkins="False" Skin="Activity">
                            <Icon PrimaryIconUrl="../App_Themes/Images/Add_16.png"/>
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="butCancel" runat="server" AutoPostBack="false" CausesValidation="true" Text="Cancel"  OnClientClicked="Close" EnableEmbeddedSkins="False" Skin="Activity">
                            <Icon PrimaryIconUrl="../App_Themes/Images/Cancel_16.png"/>
                        </telerik:RadButton>
                    </td>
                </tr>
            </table>
        </div>
     
     
        </form>
    </body>
    </html>
  5. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 02 Apr 2013 Link to this post

    I have removed the RAD Panel, and its still the same, If I remove the AKAX settings it works OK.

    What is happening, is that he first AJAX call to refresh the grid, the RADCombo box wont allow any further selecting, It drops down OK, but I cant make a selection.

    Any Ideas?

    Andy
  6. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 03 Apr 2013 Link to this post

    Hello Andy,

    I tried running the page that you provided but since there was code missing (for instance, skins, scripts and definitions of the following functions toggleSave, toggleTranslator, enableTransport, toggleBookAppt, setRoutineFollowupTime, toggleAttendance, AjaxManager_AjaxRequest) I was not able to inspect the exact issue that you describe. However, I took the time to create a very simplified runnable project that involves RadPanelBar, RadComboBox and RadAjaxManager controls that resemble the scenario that you have.

    Please take a look at it and let me know if the proposed solution complies with your scenario. In any other case I would suggest that you open a support ticket where you can your runnable project so we can test it locally and help you out in your particular scenario.

    Regards,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  7. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 03 Apr 2013 Link to this post

    Thanks Kate, your example works, but my case has moved on I have removed the panel that I believed to be causing the problem and the RADcombo box still stops working following a postback.

    If I remove my ajax declartion its fine.

    telerik:RadAjaxManager ID="AjaxManager" runat="server" UpdatePanelsRenderMode="Inline" DefaultLoadingPanelID="LoadingPanel" >
            <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ddlSpecialty">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgProcedures" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
     </telerik:RadAjaxManager>



    I do have similar functionality working OK in the app so its a case of single stepping everything, unless you have seen this before and can point me in the right direction.

    Andy







  8. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 08 Apr 2013 Link to this post

    Hello Andy,

    Unfortunately the information that you provide is not sufficient to determine what might be the cause for getting the issue that you currently have. Therefore I would suggest that you open a support ticket where you can attach a very simplified runnable project that we can test locally and check what is causing the issue that you get.

    Greetings,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017