Hi, is it possible to change from code the popupmenu so that it will show a text that has a given rowtag.
I can not use listindex because the list is alfabethic, so when I get the info back from my DB (which has only stored a pointer to the name, that is the pointer is in a popupmenu rowtag as well),
I would therefore use the rowtag as the value for the listindex.
I can do it with a loop, but is there a more direct way of doing it, and not loop through a search ?
But the list have i.e. 10 names, but the list is alphabetical, and the rowTag and names are from a DB.table.
so the insert into the popupmenu is ok. But how do I choose it after.
i.e
I would like to switch to name with rowtag 7, even if this is listed as name no 2…
The info I have from db is 7 and not 2 so how can I use rowtag as the reference ?
[quote=164153:@Helge Tjelta]But the list have i.e. 10 names, but the list is alphabetical, and the rowTag and names are from a DB.table.
so the insert into the popupmenu is ok. But how do I choose it after.
i.e
I would like to switch to name with rowtag 7, even if this is listed as name no 2…
The info I have from db is 7 and not 2 so how can I use rowtag as the reference ?
As Bob says - looping is the way to do it. If you’ve got so many entries in the PopUpMenu to make the loop slow then you’re probably looking at a fairly horrible user experience anyway!
@Bob Keeney That’s a great tip Bob, thanks. I have been coding loops through each popup menu I use, this code will save me a load of time and keep my code shorter. Thanks again!
Sure, anytime you find yourself repeating the same code over and over again it’s probably time to either subclass it or use extends. I try really hard to be as lazy a programmer as I can be.