Thanks,
Erik
What you tried should work just fine, assuming you waited for the DOM to
load before calling getElementById as normal. Could you supply code that
failed?
So the XUL must have loaded because I can access the <grid> by ID but I
cannot access the <rows> by ID. Any thoughts?
My code is below, which causes "strings is null" in the error console
when the final statement tries to append the new row to the <rows> element.
Thanks,
Erik
<grid>
<columns><column/><column flex="1"/><column flex="1"/></columns>
<rows id="locale_strings_rows"/>
</grid>
strings=document.getElementById('locale_strings_rows');
row=document.createElement('row');
row.setAttribute('align','center');
row.setAttribute('contextmenu','locale_strings_menu');
row.addEventListener('mouseover',locale_strings_list_mouse,false);
row.addEventListener('click',locale_strings_list_mouse,false);
row.addEventListener('mouseout',locale_strings_list_mouseout,false);
temp=document.createElement('label');
temp.setAttribute('class','locale_strings_list_string_id');
temp.setAttribute('flex','1');
temp.setAttribute('value',string_id);
row.appendChild(temp);
temp=document.createElement('textbox');
temp.setAttribute('flex','1');
temp.setAttribute('multiline','true');
temp.setAttribute('readonly','true');
temp.setAttribute('value',value);
row.appendChild(temp);
temp=document.createElement('textbox');
temp.setAttribute('flex','1');
temp.setAttribute('multiline','true');
temp.setAttribute('readonly','true');
temp.setAttribute('value',translated_value);
row.appendChild(temp);
strings.appendChild(row);
I don't know what could be going wrong, I just copied that code into a
quick XUL test and it seemed to work ok.