strange behavior with setting hilitedlines in substack
Posted: Sun Dec 23, 2018 11:47 am
I am displaying a substack as a modal window, in order to select a list of items (with multiple selections). The selected items are stored back in a field of the main stack. When the substack is opened, I want to automatically highlite the items that were previously selected and stored in that field. I have written a script, and it "sometimes" works. The substack is opened when I click on a field of the main card:
send "updateList" to card id 1002 of stack "GenreSelection"
toplevel stack "GenreSelection" (I would normally use "modal" but have switched to "toplevel" for testing purposes)
In the "updateList" script, I read the content of the stored list, match it to lines in the substack list field, and highlight the corresponding lines, with this instruction:
set the hilitedlines of field "GenresList2" of card id 1002 of stack "GenreSelection" to cLines
cLines contains the list of items in the format "1,2,3". I have checked that cLines is correctly determined, and if I just replace it with a "constant", I get the same behavior: the lines are not highlighted when the substack is opened the first time, but if i click again on the field of the main card while the substack is open, the update scrip is called again and this time the the highlighting works correctly. If I change the name of the list field in the substack to something else (ex: "GenreList3"), then it works the first time I call the substack, but reverts back to the same behavior after...
Any help would be greatly appreciated!
send "updateList" to card id 1002 of stack "GenreSelection"
toplevel stack "GenreSelection" (I would normally use "modal" but have switched to "toplevel" for testing purposes)
In the "updateList" script, I read the content of the stored list, match it to lines in the substack list field, and highlight the corresponding lines, with this instruction:
set the hilitedlines of field "GenresList2" of card id 1002 of stack "GenreSelection" to cLines
cLines contains the list of items in the format "1,2,3". I have checked that cLines is correctly determined, and if I just replace it with a "constant", I get the same behavior: the lines are not highlighted when the substack is opened the first time, but if i click again on the field of the main card while the substack is open, the update scrip is called again and this time the the highlighting works correctly. If I change the name of the list field in the substack to something else (ex: "GenreList3"), then it works the first time I call the substack, but reverts back to the same behavior after...
Any help would be greatly appreciated!