Skip to main content

Search and Top Navigation

#8745 closed bug (notabug)

Opened October 28, 2012 04:36PM UTC

Closed October 28, 2012 05:31PM UTC

JQuery tabs cache issue when content loaded thru ajax?

Reported by: motgupta Owned by:
Priority: minor Milestone: 1.10.0
Component: ui.tabs Version: 1.8.20
Keywords: Cc:
Blocked by: Blocking:

I am facing the issue with jquery tabs when going for cache. The scenario is this. I have got list of customers in table on my jsp page which has customer name has hyperLink. Say i clicked the customer 1 link, that record opens up in jquery tab i.e TAB1 with data loaded thru ajax call.Basically call goes to server side which returns back the CustomerView.jsp content and loaded in tab. CustomerView.jsp has html form associated with it and some javascript functions. Now i clicked the customer 2 link, CustomerView.jsp response is appended to TAB2. As long as i do any activity on that tab, everything works fine. But the moment the comes back to TAB1, javascript function corresponding to TAB2 is executed(Not the functions associated with TAB1). The reason i think is i am using jquery tabs with cache.Because of this javascript functions associated with last tab are on the top and when i come back to Tab1, Functions on the top(asscociated with TAB2) are called. In Nutshell, this is is the issue when i am opening multiple tabs and response in tab comes through server which is the same JSP page. JSP Page has form and javascript functions associated with it. When i cache the tabs contents so that the content already loaded does not go to server again, ideally javascript function associated with same page should be executed but what is happening is javascript function associated with that page is not executed. Ideally when we click the tab, only content specific to that page should be active.

This gets resolved as i don't cache the content. Is there any workaround avaialble for now till this issue gets resolved where i can cache the previuos loaded tabs and javascript functions associated with that corresponding tabs are executed?

to fetch the content only first time

for further calls bring it from cache

$("#tabs_selector").tabs({ ajaxOptions: { cache: true },

cache: true });

Attachments (0)
Change History (1)

Changed October 28, 2012 05:31PM UTC by mikesherov comment:1

resolution: → notabug
status: newclosed

Thanks for contributing! This sounds more like a question that is better suited for or the forums. Please seek help there, and if you discover an actual bug, please come back and report it here. Thanks!