This is a migrated thread and some comments may be shown as answers.

I can't return to the previous tab...

13 Answers 161 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Ruben Vera
Top achievements
Rank 1
Ruben Vera asked on 15 Feb 2010, 11:24 AM
Hello, i'm having some problems with the TabStrip control...

I'm trying to make a tabstrip linked to a MultiPageView using Ajax... the fact is that when I load the page, i can see the first tab with everything ok; when I click on the second tab, I get all the data and is working OK... but if I try to return to the first tab I can't, it simply doesn't do anything.

I'm using a RadAjaxManager like this:
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="Tabs1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="Tabs1" /> 
                    <telerik:AjaxUpdatedControl ControlID="Pages" LoadingPanelID="LoadingPanel" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="Pages">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="Pages" LoadingPanelID="LoadingPanel" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 

If I delete de Manager everything is working fine, excepting the fact that it's reloading the entire page.

This is the code behind:
protected void Page_Load(object sender, EventArgs e)  
        {  
            if (!Page.IsPostBack)  
            {  
                AddTab("Vista en Arbol");  
                AddPageView(Tabs1.FindTabByText("Vista en Arbol"));  
                AddTab("Vista en Tabla");  
            }  
        }  
        private void AddTab(string tabName)  
        {  
            RadTab tab = new RadTab();  
            tab.Text = tabName;  
            Tabs1.Tabs.Add(tab);  
        }  
        private void AddPageView(RadTab tab)  
        {  
            RadPageView pageView = new RadPageView();  
            pageView.ID = tab.Text;  
            Pages.PageViews.Add(pageView);  
            tab.PageViewID = pageView.ID;  
        }  
        protected void Tabs1_TabClick(object sender, RadTabStripEventArgs e)  
        {  
            AddPageView(e.Tab);  
            e.Tab.PageView.Selected = true;  
        }  
        protected void Pages_PageViewCreated(object sender, RadMultiPageEventArgs e)  
        {  
            string userControlName="";  
            if (e.PageView.ID == "Vista en Arbol")  
            {                   
                userControlName ="~/visitas/conexionesAJAX.ascx";  
            }  
            else if (e.PageView.ID == "Vista en Tabla")  
            {  
                userControlName ="~/visitas/conexionesGRID.ascx";  
            }  
 
            Control userControl = Page.LoadControl(userControlName);  
            userControl.ID = e.PageView.ID + "_userControl";  
 
            e.PageView.Controls.Add(userControl);  
        } 

I don't know where is my error... hope u can help me.

Thanks

13 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 15 Feb 2010, 12:24 PM
Hi Ruben Vera,

Please check our online example demonstrating this approach, note that the tabstrip is subscribed to OnClientTabSelecting event and postback is canceled for tabs that already have their pageviews loaded:

function onTabSelecting(sender, args)
{
 if (args.get_tab().get_pageViewID())
 {
  args.get_tab().set_postBack(false);
 }
}


Best regards,
Yana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ruben Vera
Top achievements
Rank 1
answered on 15 Feb 2010, 12:29 PM

Thanks for the quick answer... but i've already tried this... this is what i have in my aspx:

 <script type="text/javascript">  
        function onTabSelecting(sender, args) {  
            if (args.get_tab().get_pageViewID()) {  
                args.get_tab().set_postBack(false);  
            }  
        }  
    </script> 
    <telerik:RadTabStrip OnClientTabSelecting="onTabSelecting" ID="Tabs1" SelectedIndex="0" runat="server" MultiPageID="Pages" OnTabClick="Tabs1_TabClick" CausesValidation="false">          
    </telerik:RadTabStrip>            
    <div style="border-color:#000000; border-width:thin; border-style:solid;">      
 
    <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel" IsSticky="True" Transparency="20">  
        <table style="width:100%;height:100%;">  
            <tr style="height:100%"><td align="center" valign="middle" style="width:100%">  
                 <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' 
                style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" /> 
            </td></tr>  
        </table> 
    </telerik:RadAjaxLoadingPanel> 
 
        <telerik:RadMultiPage ID="Pages" runat="server" SelectedIndex="0" OnPageViewCreated="Pages_PageViewCreated">  
        </telerik:RadMultiPage> 
    </div> 

In fact, i've copied and pasted your demo and then modified it... that's the weird thing -_-

thanks in advance

update:
i've put this in the onTabSelecting function "alert(args.get_tab().get_pageViewID());" and I'm getting an alert with "null" the first time I click on the second tab, but when I click again in the first tab I'm getting nothing...

btw, once i've loaded the second pageview, if i reload the page (F5) i can navigate perfectly...

0
Yana
Telerik team
answered on 17 Feb 2010, 01:38 PM
Hello Ruben Vera,

I've tested the provided code with simple user controls and it worked without this problem. What do you have in the user controls?

All the best,
Yana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ruben Vera
Top achievements
Rank 1
answered on 18 Feb 2010, 08:56 AM
Hello,
in the controls I have a Treeview and a Grid, but i'm trying to do it adding no controls to the pageview and i've got the same problem...

when i use the ajaxmanager, it's like the TabStrip is being disabled because it's not even sending the onClientTabSelecting event once i've changed the tab...

i'm not really sure the configuration of the ajaxmanager is OK... maybe there's the problem?
0
Yana
Telerik team
answered on 19 Feb 2010, 12:49 PM
Hello Ruben,

The ajax settings seem ok.  I've attached my test page to demonstrate that it works at our side. Please download it and give it a try.

Regards,
Yana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ruben Vera
Top achievements
Rank 1
answered on 19 Feb 2010, 01:32 PM
Hi again,

i must apologise... everything it's OK, we've been changing some things in the framework and now it seems that's working well... I think we're having a problem with the viewstate.

Anyway i must say thanks a lot!!

Regards,

Rubén
0
Mac P
Top achievements
Rank 1
answered on 18 Mar 2010, 06:44 AM
Yana,

I am running lot of issues with Tabs with latest trial version in VS2010. While researching for solution i came across this forum. When i downloaded your files and added to new RAD Website template in VS2010 it throws an exception on button click.
I made no changes to your files.

Couple of issues i have with tabs

1) Cannot supress the postback of tabs. I always get pageviewId as null in tabclick function.
2) When i use master page it throws an exception on postback
3) When i use master page and the content page loads usercontrol dynamically in pageview on tab click, if the user controls has multiple
datepicker than it will show calender popup for only first control. For other controls it wont show the calender control. When browser is refreshed it will display the JavaScript error.

I can send you my project with all the issues listed above.

Regards
Mac
0
Yana
Telerik team
answered on 23 Mar 2010, 01:24 PM
Hi Mac,

Could you please try to isolate these issues in a simple page and send it to us? Thank you

Best wishes,
Yana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Miche B
Top achievements
Rank 1
answered on 02 Apr 2010, 11:34 PM

 

Hello,

I am also having the same problem where get_pageViewID is always evaluating to null or false and so is always posting back. 

 
function onTabSelecting(sender, args) {  
     if (args.get_tab().get_pageViewID()){  
       args.get_tab().set_postBack(false);  
       }  
 }  
 

I am programmatically loading/binding data to these grids.  I cannot get the functionality to work to suppress postback.  I have also put an alert box there and it shows 'null' every time.  I have also downloaded and used the zipped demos.

Please help
Thank you,
Miche
0
Pams
Top achievements
Rank 1
answered on 08 Nov 2010, 09:04 PM
Hello I have similar problem.
I have tried wizard with the radtabstrip. The link I followed is
http://demos.telerik.com/aspnet-ajax/tabstrip/examples/applicationscenarios/wizard/defaultcs.aspx.
The only things I changed is, I took out the header and footer part.
For me If I use
 <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1" IsSticky="true">
 </telerik:RadAjaxLoadingPanel>        
 <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" LoadingPanelID="LoadingPanel1">

.............................
.......................
 </telerik:RadAjaxPanel>
Then, I am able to validate and go to next tab under button click. But once I go to next tab, If I would like to come to previous tab, then it is not allowing to go to previous tab.
When I remove this ajaxloading panel and ajax panel, I am able to get the functionality.
Could anyone pls tell me what the problem is.
Thanks in advance
0
Mac P
Top achievements
Rank 1
answered on 08 Nov 2010, 09:11 PM
Ruben

Is it trial version of telerik controls? The error i get was fixed when i upgraded to production version.
0
Pams
Top achievements
Rank 1
answered on 08 Nov 2010, 09:16 PM
Hello,
Thanks for ur reply.
 Yes we are currently working with Trial version( Q1 2010).
So, I won't be able to use RadAjaxLoadingPanel or RadAjaxPanel till I get licensed version.
Also, I had such similar problems with RadScriptManager. So, Is it because of the trial version.

Thanks
0
Yana
Telerik team
answered on 11 Nov 2010, 02:09 PM
Hello,

Actually the trial dlls are fully functional, the only difference from licensed dlls is the trial message that appears sometimes on the page.

We cannot tell the exact reasons for the issues you're experiencing without reproducing them. Please send us some sample code.

Best wishes,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TabStrip
Asked by
Ruben Vera
Top achievements
Rank 1
Answers by
Yana
Telerik team
Ruben Vera
Top achievements
Rank 1
Mac P
Top achievements
Rank 1
Miche B
Top achievements
Rank 1
Pams
Top achievements
Rank 1
Share this question
or