Re: XBL bound tag in a template DOM timing issue
Neil Deakin <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xpfe |
|---|---|
| Message-ID | <[email protected]> |
On 11-10-07 4:10 PM, dave fletcher wrote: > So the issue is with the two attributes with the comment labeled > "problem code" above. Sometimes these attributes read the value from > the attached RDF just fine. Other times, I get back an empty string. > It seems fairly random whether it works or not. > RDF is read is asynchronously and the UI built as it arrives. > I'm thinking the only way to do this correctly is to climb the parents > of the bound element, looking for a .builder property. If I find one, > addListener(), and wait for didRebuild() to get called. If I don't > find one, then I can call getAttribute() immediately. didRebuild will only get called if you rebuild the entire structure, which isn't what is happening here. You may want to just wait for the rdf file to be read first, which unfortunately, isn't that simple. See https://developer.mozilla.org/en/RDF_in_Mozilla_FAQ Neil