Does anyone out there have an example of a properly working <listbox>
which the user can add and remove values to/from, set up inside a
<prefwindow> container to handle the preference work?
<prefwidnow> can contain any control, just like a regular window. Some
of them can be tied to a preference so that the preference is
automatically updated as the control is manipulated. Others, like
<listbox>, cannot be so tied, but one can always write a script that
updates preferences explicitly, via nsIPrefBranch interface.
--
Igor Tandetnik
Okay. What confused me though was the fact that the docs of listbox [1]
say:
" preference
Type: element id
Connects the element to a corresponding preference. This attribute
only has any effect when used inside a prefwindow. The value of the
preference will be updated to match the value property of the element."
Just like the other elements that work, no strings attached, with
prefwindow. Is this a lazy copy/paste?
It works similarly to the menulist control - you can associate values
with your listitems and the listbox's value will be the value of the
selected item. The listbox's value attribute is what gets saved to the
preferences.
Nickolay