Opened 10 years ago
Closed 10 years ago
#12348 closed defect (fixed)
ContentPane: potential to double-parse when setting value to a widget instance
Reported by: | Kenneth G. Franqueiro | Owned by: | Kenneth G. Franqueiro |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | Dijit | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
If parseOnLoad
is true
on a dijit.layout.ContentPane
instance and you set its value to a widget instance, the parser will still attempt to run on the content of the passed widget's DOM node. If the passed widget happens to have been a templated widget containing non-templated widgets, some nodes may still have lingering dojoType
s which the parser will then incorrectly attempt to instantiate into widgets, potentially causing id errors.
Attachments (4)
Change History (8)
Changed 10 years ago by
Attachment: | testCPparse.html added |
---|
Changed 10 years ago by
Attachment: | 12348.diff added |
---|
simple fix that will only parse if parseOnLoad is true *and* the passed content is *not* already a widget.
comment:1 Changed 10 years ago by
Version: | 1.6.0rc1 → 1.5 |
---|
Forgot to mark the version correctly. Actually this happens even further back than 1.5, but just to be clear, it's *not* a 1.6 regression.
comment:2 Changed 10 years ago by
The fix looks fine to me but you need to add an automated test case (probably in ContentPane.html). Not sure if we have any tests for passing in a widget to set("content", ... ) , or as a parameter to the constructor. We should though.
comment:3 Changed 10 years ago by
Milestone: | tbd → 1.7 |
---|---|
Owner: | set to Kenneth G. Franqueiro |
Looks good to me, feel free to check in after the 1.6 freeze.
comment:4 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [23950]) Add check to ContentPane? to ensure parser is not run if content is set to a widget; tests included. Fixes #12348
simple test that will produce an error due to conflicting id to demonstrate the problem. This example is simplistic and contrived but it's certainly probable for someone to have a ContentPane? that contains a non-templated widget (layout or otherwise) within.