javascript - XUL Richlistbox selection issue -


i have richlistbox on firefox extension follows:

<richlistbox id="acclist" class="acclist" seltype="single" flex="1">     <richlistitem id ="acclisttemplate" hidden="true">         <listcell class="sessionactivate"/>         <listcell class="nameitem"/>         <listcell class="lastuseditem"/>         <spacer flex="1" />         <listcell class="sessiondelete" />         <listcell class="sessioncomplete" />         <listcell class="sessiondetails" />     </richlistitem> </richlistbox> 

through javascript clone richlistitem , add richlistbox values want.

the result is:

listbox multiple selection

the items appear selected , not able change selection.

another weird thing is, if click on 1 of lines , do:

alert(document.getelementbyid("acclist").selectedcount); 

it says 0.

am missing here?

hidden or not, list selects first item automatically - , when clone "selected" state well. easiest solution: don't put template inside <richlistbox> tag, put somewhere outside.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -