Skip to main content

Search and Top Navigation

#7930 closed bug (worksforme)

Opened December 01, 2011 09:00PM UTC

Closed January 20, 2012 05:52PM UTC

Incorrect AJAX call when preselecting a tab

Reported by: palbandoz Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.tabs Version: 1.8.16
Keywords: Cc:
Blocked by: Blocking:
Description

When activating a jQueyUI Tabs with a preselected tab different than the first one, the selected tab is visually correct but the AJAX call done is not the right one, but the previous tab's one.

For instance, in the next example, if the initialActiveTab is 4, the tab titled "EEE" is selected but the AJAX call is './?ajax=3&tab=ddd'. So there is nothing showed in the selected tab.

HTML:

<div id="tabs">
	<ul>
        
<li><a href='./?ajax=3&tab=aaa'>AAA</a></li>
<li><a href='./?ajax=3&tab=bbb'>BBB</a></li>
<li><a href='./?ajax=3&tab=ccc'>CCC</a></li>
<li><a href='./?ajax=3&tab=ddd'>DDD</a></li>
<li><a href='./?ajax=3&tab=eee'>EEE</a></li>
<li><a href='./?ajax=3&tab=fff'>FFF</a></li>
<li><a href='./?ajax=3&tab=ggg'>GGG</a></li>
	</ul>
</div><!--#tabs-->
<input type="hidden" id="initialActiveTab" value="4"/>

Javascript:

$(document).ready( function() {
    $("div#tabs").tabs({ selected: $("#initialActiveTab").val() });
});
Attachments (0)
Change History (2)

Changed December 02, 2011 12:39PM UTC by palbandoz comment:1

I guess the problem starts with the hrefs assigned by jQueryUI, that start in #ui-tabs-1 instead of #ui-tabs-0:

<div class="ui-tabs ui-widget ui-widget-content ui-corner-all" id="tabs">
	<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
        
<li class="ui-state-default ui-corner-top"><a href="#ui-tabs-1">AAA</a></li>
<li class="ui-state-default ui-corner-top"><a href="#ui-tabs-2">BBB</a></li>
...

Changed January 20, 2012 05:52PM UTC by scottgonzalez comment:2

resolution: → worksforme
status: newclosed

I'm not seeing the behavior you describe.