MATLAB: Problem with Gui with two Listboxes and a popup menu

guilistbox

Dears, I am building an aplication that has a popupmenu and two listboxes. When user selects a category on the popupmenu, the listbox 1 displays the assets from the category. Next the user can select assets in the listbox, that are sent to the the ohter listbox(2)
The problem arises when the user continues to select categories in the popupmenu, that have few assets. When I want to set the listbox1 to display the assets (for instance, one category has only 3 names), the listbox desapears. If I chose a category (in thte popupmenu) that has many assets it works again.
If I do not choose any item on the listbox1, and just change the selection in the popupmenu, it works ok. Once I choose items on the listbox1, the problem arises.
I have tried to clear the listbox before seting the new list. The listbox clears and is visible, but when next I set(handles.listbox1,'String',list) it desapears anyway.
Any ideas? Thanks in advance.

Best Answer

I would bet that you have the 'value' property of the disappearing listbox set to a number that is more than the number of items it shows. To avoid this, set the value to 1 whenever it is altered.