Skip to main content

Bug Tracker

Side navigation

#2393 closed enhancement (duplicate)

Opened February 22, 2008 08:16PM UTC

Closed January 16, 2009 06:36AM UTC

[ENH] Add ability to define cookie name for UI/Tabs

Reported by: scottweaver Owned by: klaus
Priority: minor Milestone: 1.2.4
Component: ui Version: 1.2.3
Keywords: ui tabs Cc:
Blocked by: Blocking:
Description

UI/Tabs currently has support for remembering active tabs via a cookie. However, there is no way to define the cookie name so all tabs look at the same cookie (within the same domain). There is a partial solution by using the path property. Unfortunately, this doesn't work in many cases. For example if the path changes or a page contains multiple tab groups .

I have attached a patch that contains the code to look for an optional "cookieName" setting within the cookie:{} option set.

-scott

Attachments (1)
Change History (6)

Changed February 26, 2008 01:02PM UTC by paul comment:1

owner: paulklaus

Changed March 01, 2008 04:15PM UTC by klaus comment:2

resolution: → worksforme
status: newclosed

That is not true. Each tab set uses its own unique cookie name (created via $.data).

Changed March 03, 2008 03:56PM UTC by scottweaver comment:3

resolution: worksforme
status: closedreopened

I probably wasn't completely clear with my usecase. The problem is that if it is the same tab set on different pages. The tab stays selected.

Example:

I have an account page with a tabset. If I select a tab on one account then jump to a different account, that tab that was selected on the previous account is now selected on the current one. For my application, this is behavior is undesired, i.e. the state of the tabset for each account page needs to be independent.

-scott

Changed March 10, 2008 03:46PM UTC by klaus comment:4

resolution: → worksforme
status: reopenedclosed

If I understand correctly you just must not set a global path for the cookie. That way there would be a unique cookie for each single page.

Could you provide a demo to showcase that bug? Apparently I cannot reproduce it.

Changed March 11, 2008 04:08PM UTC by scottweaver comment:5

resolution: worksforme
status: closedreopened

The problem it is always the same page, just displaying a different account in the same tabset. So altering the scope of the cookie won't be effective.

Example:

1. User visits www.somewebpage.com/accounts.html?id=12345, tab 1 is active by default.

2. User selects tab 2, and the state is written to a cookie.

3. User visits www.somewebpage.com/accounts.html?id=56789, tab 1 should be the default however this is not the case since the tabset uses the same cookie as it is the same page and tabset.

I guess what I am trying to get across is the fact that the state of the tabset, for me, needs to be at a higher level than just the page/tabset/cookie scope level. For me it needs to be at the account level (in this example) and I can only do that by controlling the cookie name. So, in this case with my code changes to UI tabs, I can define two cookies: tabs-12345 and tabs-56789 and everything would work correctly. I can then, within the code, look at account number passed in the url and decide which tab is active for that specific account.

Am I making sense?

Thanks,

-scott

Changed January 16, 2009 06:36AM UTC by klaus comment:6

resolution: → duplicate
status: reopenedclosed

moved to jQuery UI bug tracker