Is there a way to get buttons in a listcell to work in XUL? I’m not sure what is stopping it from running. The XUL looks like :
<listitem id = "1">
<listcell label = "OK Computer"/>
<listcell label = "Radiohead"/>
<listcell label = "1997"/>
<listcell label = "Platinum"/>
<listcell label = "5/5"/>
<listcell label = "Alternative Rock"/>
<button label = "Edit" oncommand= "alert('Hello World');"/>
<button label = "Delete" oncommand = "deleteItem();"/>
</listitem>
The button works fine outside of the list but my mouse pointer doesn’t even recognize it as a button (by changing to a hand pointer) when it’s in the list. Any ideas?
You need to put the buttons inside the list cell:
A list cell can either have the default contents (which is what you get if you simply add a
labelattribute and no contents) or anything you want – but for the latter you actually have to put the contents into the<listcell>tag explicitly.Edit: Actually, the more important problem is that
<listbox>is rather restricted concerning its contents, it is mostly limited to plain text. Which is why the more generic<richlistbox>widget has been developed. It doesn’t support tabular content however.