You are welcome.
I just noticed another problem: If you select case1 and B and then change to case2, you get an error as the second listbox remembers the selection (second item) which now doesn't exist.
I added an additional if statement which sets the selection to zero if its greater than allowed.
I am not well versed with scripting and so unfortunately I am not sure how the component could detect that the input list has changed. It would be a better way to always change the selection to the first element whenever the list has changed.