XMLHttpPanel OnServiceRequest Null

2 posts, 0 answers
  1. Jeff
    Jeff avatar
    2 posts
    Member since:
    Oct 2012

    Posted 17 Jul 2012 Link to this post

    I have a xmlhttppanel loading inside a radajaxloading panel and then a radgrid inside the xmlpanel. When there is a selection in the radgrid made it triggers a grid selected function which is where the onservicerequest is made. The problem is the panel.set_value is showing the panel null even though I am using the var panel = $find("<%=xmlPanel1.ClientID %>"); any ideas??

    <asp:Content ID="Content1" ContentPlaceHolderID="cphHead" Runat="Server">
       
        <script type="text/javascript">
            function rdGrid1_RowSelected(sender, args) {
                var StartDate = args.getDataKeyValue("Start Date");
                var EndDate = args.getDataKeyValue("End Date");
                var panel = $find("<%=xmlPanel1.ClientID %>");
                panel.set_value(StartDate + '|' + EndDate);
            }
            </script>

       
        <style type="text/css">
            .style1
            {
                font-size: medium;
                font-weight: bold;
            }

            .divContainer
            {
                width: 100%;
                height: 160px;
                position: relative;
            }
            .divGrid, .divXmlHttpPanel
            {
                position: absolute;
                top: 2px;
                left: 0px;
            }
            .divXmlHttpPanel
            {
                top: 2px;
                left: 170px;
            }
            .lblstyle
            {
                font-weight: bold;
                font-size: medium;
            }
        </style>
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="CPH_LeftNav" Runat="Server">
    </asp:Content>
    <asp:Content ID="Content3" ContentPlaceHolderID="CPH_MainContent" Runat="Server">
        <%--<p>--%>
            <br />

            <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="chkComplete">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="chkComplete" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="radGrids">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="rdGrid1" LoadingPanelID="rdPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="rdGrid2" LoadingPanelID="rdPanel2" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManagerProxy>
    <div class="lblstyle">
        <asp:Label ID="lblSelect" runat="server" Font-Size="Smaller"></asp:Label>
        </div>
        <div class="divContainer">
            <div class="divGrid">
                <telerik:RadAjaxLoadingPanel ID="rdPanel1" runat="server" Skin="WebBlue"></telerik:RadAjaxLoadingPanel>
                    <telerik:RadGrid ID="rdGrid1" runat="server" Skin="WebBlue" Height="150px" OnNeedDataSource="rdGrid1_DataSource"
                        GridLines="None" CellSpacing="0" Width="165px" AutoGenerateColumns="false">
                            <MasterTableView ClientDataKeyNames="Start Date, End Date" Width="100%" Summary="rdGrid1 table">
                                <Columns>
                                    <telerik:GridBoundColumn HeaderText="Start Date" DataField="Start Date"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn HeaderText="End Date" DataField="End Date"></telerik:GridBoundColumn>
                                </Columns>
                            </MasterTableView>
                            <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="false" ClientEvents-OnRowSelected="rdGrid1_RowSelected">
                                <Selecting AllowRowSelect="True" />
                                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                                <Resizing EnableRealTimeResize="True" />
                            </ClientSettings>
                    </telerik:RadGrid>
            </div>         
            <div class="divXmlHttpPanel">
                <telerik:RadAjaxLoadingPanel ID="rdPanel2" runat="server" Skin="WebBlue"></telerik:RadAjaxLoadingPanel>
                    <telerik:RadXmlHttpPanel ID="xmlPanel1" Runat="server" RenderMode="Block" LoadingPanelID="rdPanel2"
                            Value="FRANAR" OnServiceRequest="xmlPanel1_ServiceRequest" ClientIDMode="Inherit" EnableClientScriptEvaluation="true">
                        <telerik:RadGrid ID="rdGrid2" runat="server" Skin="WebBlue" GridLines="None" CellSpacing="0"
                                OnNeedDataSource="rdGrid1_DataSource" EnableClientScriptEvaluation="true">
                            <MasterTableView  AutoGenerateColumns="true" Summary="rdGrid2 table" Width="100%">
                            </MasterTableView>
                        </telerik:RadGrid>
                    </telerik:RadXmlHttpPanel>
            </div>
        </div>
    <div class="lblstyle">
    <asp:Label ID="lblSelect2" runat="server" Font-Size="Smaller"></asp:Label>
    </div>
        <p>
            &nbsp;</p>
    </asp:Content>



  2. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 20 Jul 2012 Link to this post

    Hello Jeff,

    I created a sample page with the code you provided, but I am unable to reproduce your problem. The client-side object of the RadXmlHttpPanel appears to be referenced correctly.  Please check the attached test page and let me know if there are any differences, compared to your project. Here you can find a screen capture of the RadXmlHttpPanel on my end.

    I will need to reproduce the problem on my end in order to help you accordingly. Please try modifying the attached sample so that it matches your case. If this is not possible, you can also send a simple, runnable page that isolates the issue so that I can examine it locally and provide a more to the point answer. I would suggest opening a support ticket in order to send a sample.

    All the best,
    Slav
    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
Back to Top