Cannot access radsplitter that is nested inside of another radsplitter

2 posts, 0 answers
  1. Bruce
    Bruce avatar
    23 posts
    Member since:
    Sep 2008

    Posted 29 Oct 2008 Link to this post

    I am trying to access a radsplitter control via client-side scripting.

    The radsplitter i am trying to reference is nested inside of another radsplitter/radpane.

    Here is an example of how i access the splitter:

    var splitter = $find("<%= innerSplitter.ClientID %>");



    telerik:RadSplitter ID="outterSplitter" runat="server" Orientation="horizontal">
    <telerik:RadPane ID="pane1" runat="server" >
    <telerik:RadSplitter ID="innerSplitter" runat="server" VisibleDuringInit="False">
    <telerik:RadPane ID="pane2" runat="server" Scrolling="none"  OnClientResized="afterResize">
    left pane of the splitter
    right pane of the splitter
    <telerik:RadSplitBar ID="splitbar1" runat="server" />
    <telerik:RadPane ID="pane3" runat="server" OnClientResized="afterResize2"></telerik:RadPane>
    <telerik:RadSplitBar ID="splitbar2" runat="server" CollapseMode="None"/>
    <telerik:RadPane ID="pane4" runat="server" height="20px" Locked ="true" >
    bottom pane of the splitter

    Everything is named appropriately, etc.

    The value of splitter is always null.


  2. Svetlina Anati
    Svetlina Anati avatar
    2795 posts

    Posted 03 Nov 2008 Link to this post

    Hello Bruce,

    I examined your code and it seems to be correct. Possible reasons for the problem can be the following ones:

    1. You get a javascript error before you reference the splitter, e.g in the AfterResize function.
    2. You try to reference the splitter's client object before it is created.

      You should note that in MS ASP.NET AJAX client control objects are created in a manner similar to this:

         <script type="text/javascript">
         Sys.Application.add_init(function() {
             $create(MS.AJAX.SomeControl, {controlparameters : ''}, null, $get("controlelement"));
         // -->

      Here is how the client events are fired in the page life cycle:

      window.onload -> Sys.Application.init -> Sys.Application.load

      You can see that the client object representation of MS AJAX controls are created just as the last code on the page in the Sys.Application.init event, which is raised after the window.onload event. 

      For that reason you can get a reference to RadSplitter no earlier that in the Sys.Application.load event, which is raised after all scripts have been loaded and the objects in the application have been created and initialized.

    In case you need further assistance, please open a new support ticket and send me a sample, fully runnable reproduction demo along with detailed reproduction instructions.

    Sincerely yours,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft R3 2016 release webinar banner
Back to Top