Open Bug 536174 Opened 16 years ago Updated 3 years ago

Treeview selection data not available

Categories

(Core :: General, defect)

x86
Windows XP
defect

Tracking

()

UNCONFIRMED

People

(Reporter: lfournie, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a1pre) Gecko/20091220 Minefield/3.7a1pre Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a1pre) Gecko/20091220 Minefield/3.7a1pre My application need to preselect a line of a dynamic XUL tree and the treeview data is not available just after a 'replaceChild'. Here a simple XUL code that works if I am setting a delay but raises an error if I call the line selection with no delay. (set comments to change options) Reproducible: Always Steps to Reproduce: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window title="Bug" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript"> <![CDATA[ window.onload = init; function select_line0() { document.getElementById('atree').view.selection.select(0); } function init() { var tree = document.getElementById('atree'); var tc = document.createElement('treechildren'); var c = document.createElement('treecell'); c.setAttribute('label','Line 1'); var r = document.createElement('treerow'); r.appendChild(c); var i = document.createElement('treeitem'); i.appendChild(r); tc.appendChild(i); tree.replaceChild(tc,tree.firstChild.nextSibling); //setTimeout("select_line0()",10); // WORK BUT HAZARDOUS ! select_line0(); // DOES NOT WORK ! } ]]> </script> <tree id="atree" flex="1"><treecols><treecol label="C1" flex="1"/></treecols><treechildren/></tree> </window> Actual Results: error occurs: select_line0::line 8 data:no Expected Results: I would expect to call tree.view.selection just after building the tree. Using a delay (setTimeout) is not a good solution.
Reporter, are you still seeing this issue with Firefox 3.6.13 or later in safe mode? If not, please close. These links can help you in your testing. http://support.mozilla.com/kb/Safe+Mode http://support.mozilla.com/kb/Managing+profiles You can also try to reproduce in Firefox 4 Beta 8 or later, there are many improvements in the new version, http://www.mozilla.com/en-US/firefox/all-beta.html
Whiteboard: [CLOSEME 2011-1-30]
Hello!, I'm sorry but the bug is still there with Minefield 4.09pre(2011-01-02). On my PC, the delay has to be > 20ms to make the selection working. if select_line0() is called, then the line is NOT selected and Laurent
No reply, INCOMPLETE. Please retest with Firefox 3.6.13 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INCOMPLETE
First I do not like seeing a kind of 'Tyler Downer' Robot asking me to test on FF3.6 when it is just said in the previous post that the bug remains on FF4.0 ! SafeMode and new Profile does NOT change anything. Second remark, in few days, it will be harder to produce the bug on FF4.0 without any plugin because by default gecko 2.0 does not allow any remote XUL....so you have to build a small add_on to test it or use an add_on like (https://github.com/jvillalobos/Remote-XUL-Manager) to test it. Please consider seriously this bug ! Again, if I call "view.selection.select(linenumber)" on page load, then there is no line selection and I have to add a 20ms delay to get it to work. Laurent
Severity: normal → critical
Status: RESOLVED → VERIFIED
Priority: -- → P1
Version: unspecified → Trunk
Severity: critical → normal
Status: VERIFIED → UNCONFIRMED
Priority: P1 → --
Product: Firefox → Core
QA Contact: general → general
Resolution: INCOMPLETE → ---
Whiteboard: [CLOSEME 2011-1-30]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.