reset dropdown also for a list containing text

ccambre shared this idea 7 years ago


SetValue[<list>,<index>] works fine when the dropdownlist contains numbers, but doesn't work when it consists of texts (eg for multiple choice answers about slope).

Is there a reason for it or can it be made possible?



Comments (3)



I confirm this defizit.

But the problem-context is not Text or not Text. I think it's a bug.

Because the following workaround work correct (with text). I hope he can help the developers to find the bug:

lijstonder = Zip[T, T, {tekst0, tekst1, tekst2, tekst3}]



thanks for the confirmation and the workaround.

I'm unfamiliar with the ZIP-command, but indeed it does the job and I should take a look to the applications of it.




the problem is not whether the list contains numeric or text values.

It seems to be a bug in the display of the Lists.

I've tested this with a list containing numbers

    L1 = Sequence[n]

and a list containing the numbers as Strings

    L2 = Zip["" + (v), v, Sequence[n]]

as DropDownLists.

Here the commands (*)



work as expected.


After changing the number n of the Elements in the lists, the commands SetValue[L1,k] or SetValue[L1,k] had no effect on the DropDown lists, although

    i1 = SelectedIndex[L1]

    e1 = SelectedElement[L1]

were still updated!!

After saving this file and reopening it, using the commands (*) did again have the dropdown lists updated!

You can test the effect in this file

n sets the number of the elements for lists L1 and L2,

k sets the index in all lists (SetValue[L*,k])

Copy copies L1 and L2 as free objects to the lists L1a and L2a resp.

Instead of using Copy you can manipulate L1a and L2a by hand.

The TableText shows the values of the SelectedIndex and SelectedElement for all lists.

If you changed the lists and then change the value of k, you can see that the values in the TableText are still updated, the dropdown lists are not.

You must save this file, reopen it (in a new window) and then the dropdown lists are updated again if k changes.

I hope this helps the developers find the cause of this bug.


Lists L1a and L2a both have the entry

<animation step="1" speed="1" type="0" playing="false"/>
which does not show up in the Property Window (since it's rather useless for a list?!).

This entry does not appear in Lists L1, L2.


© 2023 International GeoGebra Institute