Opened 8 years ago

Closed 8 years ago

#12246 closed defect (wontfix)

TabContainer not working when set as href or content

Reported by: Pete Smith Owned by:
Priority: high Milestone: tbd
Component: Dijit Version: 1.6.0b1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

I have a parent ContentPane where I set the href on it. The contents of that request have dijit.layout.TabContainer in them, and in 1.5.0 they widgetize and work just fine.

In 1.6.0b2, this does not work. There are no tabs in the tablist, even though each subcontainer has a title="foo" on it. I whipped up this test just by setting the content of the pane, and it fails as well. Although the regression I think I have uncovered is, setting the href or content of panes has some problem when it comes to widgetizing and parsing.

Attachments (3)

test_TabContainer_noLayoutbug.html (2.5 KB) - added by Pete Smith 8 years ago.
A simple test case showing the setting of content on a pane does not create working tabs .
test_TabContainer_noLayoutbug_content.html.zip (1.6 KB) - added by Pete Smith 8 years ago.
This shows the regression in 1.6 from 1.5 when setting content from an href on a contenpane that contains tabs.
myResultScreenshot.gif (15.2 KB) - added by bill 8 years ago.
resultant of running on my 1.6 source tree, do you see the same?

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by Pete Smith

A simple test case showing the setting of content on a pane does not create working tabs .

comment:1 Changed 8 years ago by bill

Component: GeneralDijit
Description: modified (diff)
Owner: anonymous deleted

Thanks for the test case, but I don't understand what it's trying to do. You have:

<div dojotype="dijit.layout.TabController">
  <div dojotype="dijit.layout.ContentPane" title="edit">blah</div>
</div>

Strange things are:

  • Why are you creating a TabController directly?
  • Why does your TabController contain ContentPanes rather than TabButtons?

Also, the test has some other apparently spurious things:

  • The makeTab() method isn't ever executed, nor is testClose(). Actually, everything in the <script> tag besides a few dojo.require()'s seem unnecessary for the test.
  • Custom styling in script tag also seems unnecessary, does the problem still happen without that?

comment:2 Changed 8 years ago by Pete Smith

Bill I just robbed the test case from the test_Tabcontainer_noLayout. The exact problem I am seeing is setting an href on a contentPane, when that returned content from the href contains a dijit.layout.TabContainer?. I am sorry I should have put TabContainer? not TabController?.

This worked great on 1.5 no problem. This is what is in my href that is set on the Container.

<div dojotype="dijit.layout.TabContainer?" controllerWidget="dijit.layout.TabController?"> <div dojotype="dijit.layout.ContentPane?" title="Edit"> </div> </div>

Thank you bill as usual.

comment:3 Changed 8 years ago by bill

OK. Guessing from the file you attached, the issue is that you haven't specified a size on your ContentPane. If that's not the issue, then please attach a test file (or actually, two files, the main one and the href it points to) to reproduce the problem.

comment:4 Changed 8 years ago by Pete Smith

Size on which contentpane bill? The one that I am setting the href on, or the one in the retrieved content ? I need 100% width tabs - this would be a regression from 1.5 so we have to work closely on it.

comment:5 Changed 8 years ago by Pete Smith

I have now confirmed, this behavior IS a regression from 1.5 to 1.6. I took these exact two files, and place them in my 1.5 tree. I had to change the djConfig line on the dojo <script> include in order for dojo to be included right. In 1.5, the tabs come in great. In 1.6, they don't. Just load the test file (in your dojo distribution src tree /tests/layout/ ) and click the button in 1.6.

Changed 8 years ago by Pete Smith

This shows the regression in 1.6 from 1.5 when setting content from an href on a contenpane that contains tabs.

comment:6 Changed 8 years ago by bill

I meant to have a size, specifically a height, either on the TabContainer itself, or it's parent ContentPane. But that shouldn't be necessary with doLayout=false. Anyway, I tried your test case in my 1.6 tree and it looks fine to me, I'll attach a screenshot of the results.

Changed 8 years ago by bill

Attachment: myResultScreenshot.gif added

resultant of running on my 1.6 source tree, do you see the same?

comment:7 Changed 8 years ago by Pete Smith

I think I figured this out, and it is related to:

http://bugs.dojotoolkit.org/changeset/23571

I have a hidden row on a table, and when the row is clicked I show the row (via class) and then set the href that loads the tabs ( a sort of "drill in row"). I had to call startup() after the row was shown to get the tabs to start. Then all was well!

comment:8 Changed 8 years ago by bill

Resolution: wontfix
Status: newclosed

OK, glad you got it working. Yes, layout widgets don't work if they are rendered inside of a hidden element, you have to call resize() after they are visible...

Note: See TracTickets for help on using tickets.