#5157 closed defect (invalid)
DIalog method not found when source (href) is used
Reported by: | guest | Owned by: | anonymous |
---|---|---|---|
Priority: | high | Milestone: | 1.1 |
Component: | Dijit | Version: | 1.0 |
Keywords: | Dialog href dojo/method | Cc: | tk |
Blocked By: | Blocking: |
Description
When a Dialog is loaded from an href (external source), and a dojo/method is defined, the method is not found, and produces an error: "dijit.byId("dialogtest").testMe is not a function".
When the same Dialog is created all in one page, without the href, it finds the method as expected.
I'm using FF 2.0.0.8/Mac OS X
Attachments (2)
Change History (5)
Changed 13 years ago by
Attachment: | dialog_test2.html added |
---|
Changed 13 years ago by
Attachment: | dialog_test3.html added |
---|
test case 2 of 2: this is the external Dialog file
comment:1 Changed 13 years ago by
Cc: | tk added |
---|---|
Component: | General → Dijit |
Milestone: | → 1.1 |
Resolution: | → invalid |
Status: | new → closed |
I believe you misunderstand the use of dojo/method...
if you write your dialog like this...
<div id="dialogtest" dojoType="dijit.Dialog" href="./dialog_test3.html"> <script type="dojo/method" event="testMe"> console.log('testMe fired!'); </script> </div>
You will get the desired results...
dojo/method blocks are parsed by the parser when the widget is created, not when setHref() is called...
it is possible that by calling setHref(); then when onLoad for the dialog fires, call dojo.parser.parse(dlg.domNode) this *might* work...
Feel free to contact me if you have any further questions, closing as invalid otherwise.
comment:2 Changed 13 years ago by
Is there no "proper" way to refer to scripts in the href'd document then?
comment:3 Changed 13 years ago by
contentPane in dijit doesnt parse scripts, just widgets...
dojox.layout.ContentPane? will parse scripts...
test case 1 of 2: Click the "Test" button in the Dialog to reproduce.