Opened 9 years ago

Closed 4 years ago

#11989 closed defect (patchwelcome)

_Templated: call resize() on _supportingWidgets

Reported by: Remoun Metyas Owned by:
Priority: high Milestone: 1.13
Component: Dijit Version: 1.5
Keywords: Cc:
Blocked By: Blocking:

Description

Related to #11988.

Patch attached.

Attachments (3)

_Templated.onHide.patch (602 bytes) - added by Remoun Metyas 9 years ago.
Make _Templated channel onHide/_onShow to its _supportingWidgets
test_tabcontainer_templated_grid.html (4.0 KB) - added by Remoun Metyas 8 years ago.
Test Case
_Templated.resize.patch (632 bytes) - added by Remoun Metyas 8 years ago.

Download all attachments as: .zip

Change History (11)

Changed 9 years ago by Remoun Metyas

Attachment: _Templated.onHide.patch added

Make _Templated channel onHide/_onShow to its _supportingWidgets

comment:1 Changed 9 years ago by bill

Hi rem, thanks for the patch, not sure who you are though, does you or your company have a CLA?

comment:2 Changed 9 years ago by bill

Also, this requires some thought, because true child widgets (like inside a Dialog.containerNode) are also not notified on onShow().

The general approach for widgets that need to do something when they are shown is that the parent calls resize() on them. IIRC that's already happening for supportingWidgets and true child widgets.

comment:3 Changed 8 years ago by bill

Resolution: wontfix
Status: newclosed

Closing because of no CLA and because it's unclear if this change makes sense (see above comment).

comment:4 Changed 8 years ago by Remoun Metyas

Resolution: wontfix
Status: closedreopened

Hi bill, sorry I didn't reply sooner; I didn't get any notifications (I somehow missed the Trac Preferences, so neither my name nor email were set.. D'oh!).

I'll sign the CLA and send it ASAP.

I thought this was related to #11991, but I was mistaken. I just tried a TabContainer? with a DataGrid? and the same DataGrid? inside a _Templated widget, and the latter is the only one that doesn't update. As per your suggestion, I tried making the _Templated widget call resize() for its _supportingWidgets, and that makes the grid render. I'm attaching a test case that demonstrates this.

I guess there's no immediate need for _onShow/onHide to be called on _supportingWidgets, but I (still) think it sounds right.

NB: the test file assumes top-level dojo/ dir is a sibling (with dijit, dojo, dojox subdirs underneath); adapted from dojox/grid/tests/test_grid_tab_container.html

Changed 8 years ago by Remoun Metyas

Test Case

comment:5 Changed 8 years ago by bill

Milestone: tbdfuture
Summary: _Templated doesn't notify its _supportingWidgets onHide/_onShow_Templated: call resize() on _supportingWidgets

I'll look into this.

_Templated already calls startup() on the supporting widgets, and for any supporting widget S which is a layout widget, S.startup() willl call S.resize(), unless S's parent is a layout container. So, _Templated should only call resize() on the children in certain cases.

comment:6 Changed 8 years ago by Remoun Metyas

FWIW, a quick look at the _Templated layout widgets (in dijit.layout and dojox.layout), and they either override resize() [without calling this.inherited] and/or don't have any widgetsInTemplate.

To make it more solid, perhaps _Templated's impl just needs to check if(!this.isLayoutContainer)?

Changed 8 years ago by Remoun Metyas

Attachment: _Templated.resize.patch added

comment:7 Changed 8 years ago by Remoun Metyas

I've signed the CLA (Remoun Metyas).

comment:8 Changed 4 years ago by dylan

Milestone: future1.12
Resolution: patchwelcome
Status: reopenedclosed

This would unfortunately need to be revisited given that the patch has sat around for 5 years. If there's still interest in this, please create a new pull request and we'll consider for 1.12. Closing as patchwelcome for now.

Note: See TracTickets for help on using tickets.