Closed Bug 260838 Opened 21 years ago Closed 20 years ago

dynamic listbox items can't be selected

Categories

(SeaMonkey :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED EXPIRED

People

(Reporter: josh-m, Unassigned)

References

()

Details

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; CPT-IE401SP1; .NET CLR 1.0.3705; .NET CLR 1.1.4322) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040910 Firefox/0.10 Dynamically added listbox items can't be dynamically selected, if they come later than the first rows specified by the "rows" attribute. Reproducible: Always Steps to Reproduce: View the url above, or the following xul: <?xml version="1.0"?> <?xml-stylesheet type="text/css" href="chrome://global/skin/"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <listbox id="theList" rows="3"> </listbox> <script><![CDATA[ window.onload = function() { var list = document.documentElement.firstChild; var newItem; newItem = document.createElement("listitem"); newItem.setAttribute("label", "one"); list.appendChild(newItem); newItem = document.createElement("listitem"); newItem.setAttribute("label", "two"); list.appendChild(newItem); newItem = document.createElement("listitem"); newItem.setAttribute("label", "three"); list.appendChild(newItem); newItem = document.createElement("listitem"); newItem.setAttribute("label", "four"); list.appendChild(newItem); list.lastChild.selected=true; }; ]]></script> </window> Actual Results: No listitems were selected. Expected Results: The listitem "four" should have been selected.
Assignee: firefox → general
Component: General → Browser-General
Product: Firefox → Browser
QA Contact: firefox.general → general
Version: unspecified → Trunk
I gave up and turned the profile manager into a tree instead. Here's what happens: You create a <xul:listitem> element. At this point, Mozilla does not know what the element is. You then try and set the selected property on the element. It does not have one, so the property is set on the JavaScript wrapper instead. At some point in the future, the element is displayed. Mozilla then applies CSS to it and discovers, too late, that it has a listitem binding. As a workaround, you can clone an existing listitem. This copies the binding.
Product: Browser → Seamonkey
Bug 265086 should fix this.
Depends on: 265086
This is an automated message, with ID "auto-resolve01". This bug has had no comments for a long time. Statistically, we have found that bug reports that have not been confirmed by a second user after three months are highly unlikely to be the source of a fix to the code. While your input is very important to us, our resources are limited and so we are asking for your help in focussing our efforts. If you can still reproduce this problem in the latest version of the product (see below for how to obtain a copy) or, for feature requests, if it's not present in the latest version and you still believe we should implement it, please visit the URL of this bug (given at the top of this mail) and add a comment to that effect, giving more reproduction information if you have it. If it is not a problem any longer, you need take no action. If this bug is not changed in any way in the next two weeks, it will be automatically resolved. Thank you for your help in this matter. The latest beta releases can be obtained from: Firefox: http://www.mozilla.org/projects/firefox/ Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html Seamonkey: http://www.mozilla.org/projects/seamonkey/
This bug has been automatically resolved after a period of inactivity (see above comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → EXPIRED
You need to log in before you can comment on or make changes to this bug.