Mailinglist Archive: yast-devel (121 mails)

< Previous Next >
Re: [yast-devel] Deleting items from a selectionWidget
  • From: Lukas Ocilka <lukas.ocilka@xxxxxxx>
  • Date: Tue, 28 Jun 2011 16:56:09 +0200
  • Message-id: <4E09EB89.7020505@suse.cz>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dne 25.6.2011 16:04, Manu Gupta napsal(a):
Hi All

I am trying to delete a single item from a selection widget, but I am
unable to find a solution to it directly atleast.

Hi,

According the documentation [#1] [#2] [#3], you need to do this:

UI::ChangeWidget (id, `Items, list_of_items);

* id is the ID of your ComboBox widget
* list_of_items is either list of strings (items) or list of terms

// plain list of entries
list <string> list_of_items = ["a", "b", "c"];
// list of entries with variable name (translations) and fixed ID
list <term> list_of_items = [`item (`id ("a"), _("A")), ... ];

See also filter() [#4] function.

PS: You also might need to remember the selected item and re-select it
after removing that item you wanted to disappear.

#1 http://doc.opensuse.org/projects/YaST/openSUSE11.3/tdg/ComboBox.html
#2 http://doc.opensuse.org/projects/YaST/openSUSE11.3/tdg/ChangeWidget.html
#3 http://doc.opensuse.org/projects/YaST/openSUSE11.3/tdg/QueryWidget.html
#4 http://doc.opensuse.org/projects/YaST/openSUSE11.3/tdg/filter-list.html

HTH
Lukas

- --

Lukas Ocilka, Appliances Department, SUSE LINUX s.r.o.
MD: Jeff Hawn, Jennifer Guild, Alena Hendrichova
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/

iD8DBQFOCeuJVSqMdRCqTiwRAqpfAJ9CuANDLYlnph39KL3ZQRC2ir2BCACfZ1PU
aAKcLRyitZWNHqPgoSFbiUU=
=iWRC
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
References