Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

listbox in prefwindow?

31 views
Skip to first unread message

Anthony Lieuallen

unread,
Nov 9, 2006, 11:42:32 AM11/9/06
to
I've successfully set up a <prefwindow> with <checkbox> and <textbox>
items. Now, I want a <listbox> containing a list of multiple string
values. I haven't figured out any way to get that to work.

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?

Igor Tandetnik

unread,
Nov 9, 2006, 5:21:22 PM11/9/06
to

<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


Anthony Lieuallen

unread,
Nov 9, 2006, 7:42:57 PM11/9/06
to
On 11/9/2006 5:21 PM, Igor Tandetnik wrote:
> <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.

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?

[1] http://developer.mozilla.org/en/docs/XUL:listbox

Nickolay Ponomarev

unread,
Nov 10, 2006, 7:45:13 AM11/10/06
to Anthony Lieuallen, dev-te...@lists.mozilla.org

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

0 new messages