CustomUI combobox onChange event called with invalid argumen
Posted: 04 Jul 2016, 21:09
Dear coppelia,
Sometimes, I am having a strange behavior with the CustomUI combobox onChange event.
This event is being called, e.g. with the newIndex being 0 and the number of items in combobox being also 0!
This is erradic, sometimes it happens, other times it does not. Other times the newIndex is e.g. 2....
I noticed it happens when I try to delete items from the combobox in bulk.
I explain below what I do:
On the XML I do, e.g.:
while in the sim_childscriptcall_initialization.
On actuation, I need to clear all the current items and update with new ones.
Since there is no remove all, I do:
Best,
Tiago
Sometimes, I am having a strange behavior with the CustomUI combobox onChange event.
This event is being called, e.g. with the newIndex being 0 and the number of items in combobox being also 0!
This is erradic, sometimes it happens, other times it does not. Other times the newIndex is e.g. 2....
I noticed it happens when I try to delete items from the combobox in bulk.
I explain below what I do:
On the XML I do, e.g.:
Code: Select all
<combobox id="1005" onchange="comboboxChange">
<item>First item</item>
<item>Second item</item>
<item>Third item</item>
</combobox>
On actuation, I need to clear all the current items and update with new ones.
Since there is no remove all, I do:
Code: Select all
--remove all current items
for i=1, simExtCustomUI_getComboboxItemCount(ui, 1005) do
simExtCustomUI_removeComboboxItem(ui, 1005, 0)
end
Tiago