Opened 10 years ago

Closed 10 years ago

#8730 closed defect (fixed)

dojo.html.set() won't add <option> tag to <select> tag in IE7

Reported by: Scott Owned by: James Burke
Priority: high Milestone: 1.4
Component: HTML Version: 1.3.0b1
Keywords: dojo.html.set Cc:
Blocked By: Blocking:

Description

See attached code.

Expected that IE7 will create a the following code: <select><option>one</option><option>two</option></select>

Actual results: it appears to create the <select></select> but no <option>s are available.

Succeeded on Mac/FF3 and Mac/Safari3, failed on IE7.0.6000.16764/Vista against dojo 1.3.0b1.

Attachments (1)

test_dojohtml.html (845 bytes) - added by Scott 10 years ago.
test case

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by Scott

Attachment: test_dojohtml.html added

test case

comment:1 Changed 10 years ago by Eugene Lazutkin

Owner: changed from anonymous to James Burke

I was hoping to avoid touching this function at all, and remove it completely in the next version. Its API is complicated and doesn't fit neatly in the new paradigm (dojo._toDom()).

In this particular case dojo.html.set() calls can be replaced with:

//dojo.html.set( dojo.byId('testdiv'), '<select id="testselect"></select>' );
dojo.place('<select id="testselect"></select>', "testdiv", "only");
//dojo.html.set( dojo.byId('testselect'), '<option>one</option><option>two</option>' );
dojo.place('<option>one</option><option>two</option>', "testselect", "only");

I am deferring this ticket to James suggesting to close it as "wontfix", and to mark dojo.html.set() as "deprecated".

comment:2 Changed 10 years ago by bill

Component: GeneralHTML

comment:3 Changed 10 years ago by James Burke

(In [16961]) Refs #8730, mention dojo.place as a viable alternative to dojo.html.set.

comment:4 Changed 10 years ago by James Burke

Milestone: tbd1.4

Noted in the docs for this method (both in API docs and on docs.dojocampus.org) that dojo.place() may be a better choice for straight HTML insertion. Moving this to 1.4 milestone to see if we can convert it to use dojo._toDom() underneath to make the HTML insertion capabilities more robust.

I do not think it is critical to do for 1.3, since this affects ContentPane?, and in all likelyhood, use of dojo.html.set() via ContentPane? will not run into the HTML gotchas that dojo._toDom() handles, since it is more likely to insert larger, more complete blocks of HTML.

comment:5 Changed 10 years ago by James Burke

Resolution: fixed
Status: newclosed

Fixed with latest dojo.html changes.

Note: See TracTickets for help on using tickets.