Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#9794 closed defect (fixed)

ContentPane: TabContainer --> BorderContainer --> ContentPane --> Grid display problem

Reported by: bill Owned by: bill
Priority: high Milestone: 1.4
Component: Dijit Version: 1.3.2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

See attached test case from Jose Noheda. The hidden tab has a grid that doesn't get displayed properly.

The hidden tab is the hierarchy:

BorderContainer --> ContentPane --> Grid

The cause is:

  1. on page load, the BorderContainer's ContentPane thinks it's shown but actually it's hidden indirectly, because the BorderContainer is hidden. ContentPane.startup() calls _scheduleLayout(), which calls _isShown(), and since _isShown() returns true it tries to layout instantly. Besides being inefficient, this leads to the next problem.
  1. selecting the BorderContainer pane calls ContentPane.resize() but ContentPane.resize() doesn't recurse to it's children since it thinks they've already been laid out.

There's also another problem/inefficiency but it's not the cause of this error: _Grid.startup() calls _render(). _render() shouldn't really be called until resize(). The layout widgets have code where startup() calls resize() but only if the layout widget is "top level", not if the parent widget is going to call child.resize(). Grid would benefit from this.

Attachments (1)

testtabs.html (2.7 KB) - added by bill 12 years ago.
test case, put as sibling to dojo and dijit directories

Download all attachments as: .zip

Change History (10)

Changed 12 years ago by bill

Attachment: testtabs.html added

test case, put as sibling to dojo and dijit directories

comment:1 Changed 12 years ago by bill

Description: modified (diff)

comment:2 Changed 12 years ago by bill

Resolution: fixed
Status: newclosed

(In [20000]) Make nested ContentPanes defer loading of href and resizing of child widgets until the ContentPane is shown. Specifically addressing complicated cases like nested TabContainers or TabContainer --> BorderContainer --> ContentPane. When ContentPane is a child of a layout container it's hard to efficiently determine whether it's shown or not, but we know that resize() will be called the first time it's shown (perhaps on page load), so if resize() _hasn't_ been called then defer loading of href and resizing of child widgets.

comment:3 Changed 12 years ago by Nathan Toone

(In [20007]) Refs #5528 #9794 - changelist r20000 means that resize does not get called for already-selected (default) values - so we need to ensure that _transition is called for these items

comment:4 Changed 12 years ago by Nathan Toone

(In [20009]) Refs #5528, #9794 - If we have an open value, we should use that if we have been resized - so that we honor at least that flag, since it is fast to check !strict

comment:5 Changed 12 years ago by bill

Note that [20007] (listed above) is for a problem limited to _SelectedStackMixin.js, that (as far as we know) resize() is getting called fine in the general case.

comment:6 Changed 12 years ago by bill

(In [20012]) Bunch of tests to make sure that resize() gets called correctly on ContentPane? children, when ContentPane? is the child of a layout widget.

Refs #9794

comment:7 Changed 11 years ago by bill

(In [20099]) Various TabContainer? href-loading and children resizing fixes, centered around ContentPane?'s role as a layout widget:

  • Fix doLayout=false TabContainer? (broken by recent checkins for #5528, #9794)
  • Fix problem where resizing the TabContainer? would refresh a pane with refreshOnShow=true. It's only supposed to refresh when the pane is hidden then shown again. (fixes #8969 !strict)

Differentiated between onShow(), which indicates that the ContentPane? is being shown, and resize(), which, when the ContentPane? is in a layout widget hierarchy, occurs both when the ContentPane? is shown but also when it changes size.

It's complicated because a ContentPane? being made visible is indicated in different ways depending on the situation:

Refs #5528, #9794 !strict

Also added a bunch of tests including one for a TitlePane? with a single layout child (refs #8197).

comment:8 Changed 11 years ago by bill

(In [20905]) Update comments for isContainer and isLayoutContainer flags for how they are currently being used (specifically since ContentPane defines them now, even though it's not a typical layout widget).

Refs #5528, #9794 !strict

comment:9 Changed 11 years ago by bill

(In [20926]) Fix comment for getParent(), refs #5528, #9794 !strict

Note: See TracTickets for help on using tickets.