How to simply set index value of a dropdown list?

LPH shared this idea 9 years ago
Answered

Hi Markus and developers,


In order to develop some applications with the spreadsheet (see here) I am looking for a way to simply adjust the index of a dropdown list at any position. :confused:

It seems that a command of the following type for one or several cells is missing:

SetIndexValue[<list>,n] » or «SetIndexValue [{<liste1>, …, <listep>},n]


In fact “miir” (Michel) already proposed a workaround with Javascript, but is difficult to implement and slows down the application for a large amount of cells: :?

http://www.geogebra.org/for...


Another suitable thing is to make the dropdown list available in Html5 format, if possible. :D


Thank you in advance for your attention to my requests.


Best regards.

Phil

Comments (11)

photo
1

Hi,


SetValue[list,k]


does that -- at least SelectedElement

  • returns the k-th element of the list afterwards. It seems there is a lack of visual feedback though.


    Cheers,

    Zbynek

photo
1

Hi Zbynek,

SetValue[list,k]


does that -- at least SelectedElement

  • returns the k-th element of the list afterwards. It seems there is a lack of visual feedback though.

As Noël said, that is very surprising (and a very good surprise)! :D


However, we can’t apply the command to a range of cells: If you want to initialize a wide table, it will be painful. Thus, I think something is still missing. :?

Thanks again your answer.


And what about dropdown lists? Are they planned for future versions in Html5 format? :confused:


Best regards,

Phil

photo
1

Hi,


if you export to HTML5, dropdown list should be visible. Possibility to create a new dropdown list using the HTML5 app is also planned.


To do this for range of cells, you still need to use a for loop in JavaScript, but at least you can avoid the scary and sluggish XML tricks.


@Noel: I think it's OK to have SetValue command for this as GeoGebra can make a difference between SetValue[list, number] and SetValue[list, other_list].


Cheers,

Zbynek

photo
1

hello

i have tried SetValue[<list>,<number>,<object>] as in help . i think there is a bug, bad help or i do not understand it

ver4.2 and 4.4

saludos

photo
1

Hi,

if you export to HTML5, dropdown list should be visible. Possibility to create a new dropdown list using the HTML5 app is also planned.
Sorry but as you can verify below: dropdown lists are not visible in HTML5 format (you can also switch to the java version to observe the difference):

http://tube.geogebra.org/st...

Or is there another surprise? :confused:


@mathmagic: the command SetValue[<list>,<number>,<object>] is different and is used mainly to add an object at a defined position in a free list.


Cheers,

Phil

photo
1

Hi,


now I realised you refer to dropdown lists in spreadsheet -- you are right, those are not implemented and we plan to add them. Meanwhile you can use dropdown lists in graphics view, though I can guess they are not too helpful for applet where you need 20 of them.


Cheers,

Zbynek

photo
1

Hi,

now I realised you refer to dropdown lists in spreadsheet -- you are right, those are not implemented and we plan to add them.
Thanks to consider the request. :D


I can guess they are not too helpful for applet where you need 20 of them.
You’re right. The application for a final educational test will have more than a hundred cells. I therefore expect with impatience future improvements. :wink:


Cheers,

Phil

photo
1

Is there any news about simple method to find the index values with a dropdown list? I've searched to see if there is method I could use...


My workaround is as follows...

    funcList0={"Linear","Square","Square Root","Absolute Value"}

    funcList1 = {x,x²,sqrt(x),abs(x)}

    indexFunc=SelectedElement[funcList0]

    f(x)=Element[funcList1,IndexOf[indexFunc,funcList0]]


Tony

https://ggbm.at/568135

photo
1

I need to have the use the position on indexLess to locate the correct element of listLesson to complete this lesson...


Tony

https://ggbm.at/56813975661cc48580fae2bd0ac83008110ba9

photo
1

@acron:


Hi Tony,


I think that you mixed up index and element.

The syntax of the IndexOf-command is

    IndexOf[ <Object>, <List> ]

so your defintion

indexList = Element[listLesson, IndexOf[indexLess]]
must fail as it does not conform to the syntax.


I've changed your file (changes in Magenta)

https://ggbm.at/568145

so that it fullfills the expectations I suppose you expect it to fullfill :) .


Gerhard

photo
1

Thanks, after reviewing your file, my main problem was not knowing the SelectedIndex...


File is working well now...


Tony

© 2023 International GeoGebra Institute