Opened 11 years ago

Closed 11 years ago

#7768 closed defect (fixed)

ContentPane: unable to append to dialog content fetched by href / can't .attr('content', ...) in an onLoad of a dialog (content pane)

Reported by: ben hockey Owned by:
Priority: high Milestone: 1.2
Component: Dijit Version: 1.2beta
Keywords: Cc:
Blocked By: Blocking:

Description

i'm using a dialog as a form that fetches it's "inputs" via href. the document referenced by the href only contains the markup for input widgets and does not contain a submit button.

i'm trying to programmatically add a submit button after the href content has been fetched. i've tried hooking into the onDownloadEnd but the href content is loaded after onDownloadEnd is called so adding content by using .attr('content', ...) in onDownloadEnd gets blasted by the href content since the content hasn't been set at this point. there is no way to just append my button to the href content using onDownloadEnd.

so, i've tried using onLoad but unfortunately, if i call .attr('content', ...) in onLoad an error is thrown because the last line of _setContentAttr in ContentPane?.js calls this._onLoadHandler() which then calls onLoad and creates an infinite loop.

so it appears that i can't append content using .attr('content', ...) when using an href.

if onDownloadEnd was called after the content fetched from the href had been set then i would be able to do what i'm trying to do.

Change History (2)

comment:1 Changed 11 years ago by bill

Component: GeneralDijit
Milestone: tbd1.2
Owner: anonymous deleted
Summary: unable to append to dialog content fetched by href / can't .attr('content', ...) in an onLoad of a dialog (content pane)ContentPane: unable to append to dialog content fetched by href / can't .attr('content', ...) in an onLoad of a dialog (content pane)

Ah, onDownLoadEnd is called too soon, after the downloaded content has arrived but before it's been inserted into the ContentPane. You could workaround w/a setTimeout but I'll fix.

comment:2 Changed 11 years ago by bill

Resolution: fixed
Status: newclosed

(In [15367]) Fixes #7768: don't call onDownloadEnd until after the new content has been set. !strict

Note: See TracTickets for help on using tickets.