Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#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)

dialog_test2.html (868 bytes) - added by guest 12 years ago.
test case 1 of 2: Click the "Test" button in the Dialog to reproduce.
dialog_test3.html (212 bytes) - added by guest 12 years ago.
test case 2 of 2: this is the external Dialog file

Download all attachments as: .zip

Change History (5)

Changed 12 years ago by guest

Attachment: dialog_test2.html added

test case 1 of 2: Click the "Test" button in the Dialog to reproduce.

Changed 12 years ago by guest

Attachment: dialog_test3.html added

test case 2 of 2: this is the external Dialog file

comment:1 Changed 12 years ago by tk

Cc: tk added
Component: GeneralDijit
Milestone: 1.1
Resolution: invalid
Status: newclosed

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 12 years ago by guest

Is there no "proper" way to refer to scripts in the href'd document then?

comment:3 Changed 12 years ago by tk

contentPane in dijit doesnt parse scripts, just widgets...

dojox.layout.ContentPane? will parse scripts...

Note: See TracTickets for help on using tickets.