Dynamic PageView example not working

3 posts, 1 answers
  1. Damien McCarron
    Damien McCarron avatar
    9 posts
    Member since:
    Jan 2010

    Posted 18 Jan 2010 Link to this post

    I have tried the example code for creating a Pageview via the Client API but it does not appear to work.   There are no error messages, the function is being called but the new PageView is not being created.

    http://www.telerik.com/help/aspnet-ajax/tab_add-pageviews-client-side.html

    My code:

    <script> 
       function pageLoad()  
       {              
           var multiPage = $find("<%=RadMultiPage1.ClientID %>");                          
     
           multiPage.trackChanges();  
     
           var pageView = new Telerik.Web.UI.RadPageView();   
           pageView.set_id("myID");       
           multiPage.get_pageViews().add(pageView);             
           pageView.get_element().innerHTML = "PageView1";              
     
           multiPage.commitChanges();  
       }    
    </script> 
     
    <body> 
        <form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager" runat="server" /> 
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1">  
       <Tabs> 
           <telerik:RadTab runat="server" Text="Root RadTab1">  
           </telerik:RadTab> 
           <telerik:RadTab runat="server" Text="Root RadTab2">  
           </telerik:RadTab> 
           <telerik:RadTab runat="server" Text="Root RadTab3">  
           </telerik:RadTab> 
       </Tabs> 
    </telerik:RadTabStrip>      
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server">              
    </telerik:RadMultiPage>   
        </form> 
    </body> 

  2. Answer
    Yana
    Admin
    Yana avatar
    5043 posts

    Posted 19 Jan 2010 Link to this post

    Hi Damien,

    Actually this is a known issue in RadTabStrip which is already logged and will be fixed. For now, please set the pageview manually to the tab like this:

    <script type="text/javascript">
      function pageLoad() {
          var multiPage = $find("<%=RadMultiPage1.ClientID %>");
          var tabStrip = $find("<%=RadTabStrip1.ClientID %>");
     
          multiPage.trackChanges();
     
          var pageView = new Telerik.Web.UI.RadPageView();
          pageView.set_id("myID");
          multiPage.get_pageViews().add(pageView);
          tabStrip.get_tabs().getTab(0).set_pageViewID("myID");
           
          pageView.get_element().innerHTML = "PageView1";
     
          multiPage.commitChanges();
      }   
    </script>

    Best regards,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Damien McCarron
    Damien McCarron avatar
    9 posts
    Member since:
    Jan 2010

    Posted 19 Jan 2010 Link to this post

    Thanks Yana

    That works
Back to Top