Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

navigate to tab using another control?

Last post 09-03-2008 10:47 by [Infragistics] Sung Kim. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 06-27-2008 10:17

    • bjlarsen
    • Top 500 Contributor
    • Joined on 06-19-2008
    • Points 200

    navigate to tab using another control?

    is it possible to switch tabs when the user interacts with another control outside of the tab?  i.e.  we have a web grid or hyperlinks or buttons.  If the user hits one of these, we would like for the tab control to automatically switch to the corresponding tab to that control.  Is this possible?

     

    thank you,

    • Post Points: 20
  • 06-27-2008 16:14 In reply to

    Re: navigate to tab using another control?

    You could make use of our Client Side Object Model and change the selected tab through JavaScript.

    var ultraTab = igtab_getTabById("UltraWebTab1");

    ultraTab.setSelectedIndex(1);

    WebTab CSOM Overview:

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WebTab_CSOM.html

    WebTab CSOM Members:

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WebTab_Object_CSOM.html

    • Post Points: 35
  • 06-27-2008 16:17 In reply to

    • bjlarsen
    • Top 500 Contributor
    • Joined on 06-19-2008
    • Points 200

    Re: navigate to tab using another control?

    thank you!  i will look at those links...ugg..my javascript is horrible :)

    • Post Points: 5
  • 07-01-2008 7:07 In reply to

    • dmalesd
    • Not Ranked
    • Joined on 06-05-2008
    • Points 130

    Re: navigate to tab using another control?

     I have done this also,however I noticed this caused a postback on my page. Can I ensure this postback does not happen?, because if I just click on a tab with the mouse a postback does not seem to occur. David

    • Post Points: 20
  • 07-01-2008 12:35 In reply to

    Re: navigate to tab using another control?

    It may depend on how you are calling your script?  If you are clicking on a button, is it a html button or an asp.net button.  If you are using an asp.net button, then that is what may be causing the postback.

    Here's sample code for doing it for both types of buttons. Notice the return false for the method the asp.net button calls.

    script:

    function Button2_onclick() {var ultraTab = igtab_getTabById('<%=UltraWebTab1.ClientID %>');

    ultraTab.setSelectedIndex(2);

    }

    function gotothirdtab()

    {

    var ultraTab = igtab_getTabById('<%=UltraWebTab1.ClientID %>');

    ultraTab.setSelectedIndex(2);

    return false;

    }

     aspx code:

    <igtab:UltraWebTab ID="UltraWebTab1" runat="server" Height="279px" Width="410px">

    <Tabs>

    <igtab:Tab Text="First">

    <ContentTemplate>

    First Tab Content

    </ContentTemplate>

    </igtab:Tab>

    <igtab:Tab Text="Second">

    <ContentTemplate>

    Second Tab Content

    </ContentTemplate>

    </igtab:Tab>

    <igtab:Tab Text="Third">

    <ContentTemplate>

    Third Tab Content

    </ContentTemplate>

    </igtab:Tab>

    </Tabs>

    </igtab:UltraWebTab>

    <asp:Button ID="Button1" runat="server" Text="Third Tab (asp button)" OnClientClick="return gotothirdtab()" />

    <input id="Button2" type="button" value="Third Tab (html button)" onclick="return Button2_onclick()" />

     

    • Post Points: 20
  • 07-02-2008 5:27 In reply to

    • dmalesd
    • Not Ranked
    • Joined on 06-05-2008
    • Points 130

    Re: navigate to tab using another control?

    Thanks for the reply Sung. That is very useful indeed. I now have it working.  I was missing the return keyword in the OnClientClick call for my asp.net button, and my javascript function did not have return false. Thanks for your help with this. Incidentally this subtle difference between using html and asp.net buttons is not defined in the example Client side events. David 

    • Post Points: 20
  • 09-02-2008 19:17 In reply to

    Re: navigate to tab using another control?

    How can I do this through VB.NET code on the code behind side.  I want to call the page with a parameter, and then switch to different tabs based on that parameter.

    Example, if the user is adding a new record, it goes to detail screen and selects tab 3 for entering new data.  If the user selects the detail screen from an existing record, it shows tab 1 for a summary or something else.

    • Post Points: 20
  • 09-03-2008 10:47 In reply to

    Re: navigate to tab using another control?

    By parameter, do you mean a query string?

    If you are trying to do this on the code behind, based on your query string, select the appropriate tab in one of the page events.

    It would be something like,

    if(adding) then

    ultratab.selectedtabindex=2

    elseif(detail)

    ultratab.selectedtabindex=0

    end if

    • Post Points: 5
Page 1 of 1 (8 items)
Powered by Community Server (Commercial Edition), by Telligent Systems