Opened 10 years ago
Closed 8 years ago
#11866 closed defect (wontfix)
TabContainer: odd behavior in canceling in-flight XHRs
Reported by: | kpkeerthi | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.9 |
Component: | Dijit | Version: | 1.4.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Please see sample code attached.
What it is? It is a tabcontainer with 3 tabs and one nested tab.
What does it (the code) do? When a tab is clicked, any in-flight XHR pending with the previously selected tab is canceled. This is achieved subscribing to "<tabcontainer-widgetId>-selectChild" topic. We do this to save unnecessary hits from the tabs that are not currently selected.
What is the issue? The code cancels in-flight XHR of a tab (say t1) when a new tab t2 is clicked/selected. When the same tab t1 is selected again, dojo fires a new XHR and loads t1 with its content. This is the expected behavior. But this works only for the tabs that are not nested. Dojo cancels the inflight XHR of a nest tab n1 just fine. But when n1 is selected again, it does not fire new XHR and n1 is stuck at 'Loading...' indefinitely.
Attachments (4)
Change History (12)
comment:1 Changed 10 years ago by
Changed 10 years ago by
Attachment: | DelayedContentServlet.java added |
---|
comment:2 Changed 10 years ago by
Steps to reproduce:
- Deploy the attached war file in Tomcat v6 and point your browser (Firefox) to http://<host>:<port>/DojoTabs?/index.html
- Tab-1 will begin loading. Click on Tab-2 and watch Tab-1's XHR getting canceled in Firebug.
- Click on Tab-1 again and wait until its content load.
- Now click on the tab 'Nested'. A nested tab Tab-4 will begin loading. Click on tab-3 and watch Tab-4's XHR getting canceled.
- Click on the tab 'Nested' again. The nested tab Tab-4 will never load again.
Changed 10 years ago by
Attachment: | DojoTabs.war added |
---|
comment:3 Changed 10 years ago by
Sounds like you are talking about dijit, not dojox?
I don't have tomcat installed. Can you attach a test case using a simple HTML file? It can access getResponse.php in dijit/tests.
comment:4 Changed 10 years ago by
Tomcat is optional. All you need is change the href values of the content panes (4 instances) in the attached file inflight-xhr.html.
Save this file to your disk and change the href values and run this file off your disk directly. 'Steps to reproduce' would remain the same except for Step-1.
comment:5 Changed 10 years ago by
Component: | DojoX Widgets → Dijit |
---|---|
Owner: | changed from dante to bill |
Priority: | highest → normal |
severity: | critical → minor |
Summary: | Odd behavior in canceling in-flight XHRs in TabContainer → TabContainer: odd behavior in canceling in-flight XHRs |
OK, then please change the URL's and reattach the test file. Then we will know we are looking at the exact same test file.
The workaround is to not call cancel().
Changed 10 years ago by
Attachment: | inflight-xhr.html added |
---|
comment:7 Changed 8 years ago by
Milestone: | tbd → 1.9 |
---|
comment:8 Changed 8 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
TabContainer by itself is working fine. The problem only happens when you manually cancel an in-flight XHR. Manually canceling an in-flight XHR is not supported.
In your test case, when the nested TabContainer is deselected, you are manually calling:
lastSelectedTab.cancel()
on the nested TabContainer's ContentPane. Then, you are expecting the XHR to magically reexecute when the nested TabContainer is selected again. TabContainer doesn't have code to do this. Actually, I don't remember TabContainer having any code to cancel XHR's. I'll attach my test case.
Changed 8 years ago by
Attachment: | working.html added |
---|
working test case because the manual canceling of the XHR is commented out
This is an issue with dojo 1.5 as well