Hi,
I have to add an additional element to the WrkCtrType base enum . I do that, but when I select the new element I noticed that the value stored in the table field is not correct. I began to investigate the problem and found that there is a method which iterate over the base enum elements. It removes an element based on a condition.
The method:
public static void limitComboToIndividualResourceTypes(FormComboBoxControl _comboBox)
{
DictEnum dictEnum = new DictEnum(enumNum(WrkCtrType));
int i;
_comboBox.clear();
for (i=0;i<dictEnum.values();i++)
{
if (dictEnum.index2Value(i) != WrkCtrType::Group)
{
_comboBox.add(dictEnum.index2Label(i));
}
}
_comboBox.update();
}
The Base Enum:

As you can see the method first clear the combobox list and puts all elements except element numer 5 (Group).
combobox.add(...) just add a string value to the combobox list starting from position 0. An element "Group" meets the condition, so it is not included to the list. The next element (NewElement) gets position 6 (not 7). This is the reason that the value stored in the table field is not correct.
How this problem can be solved? Some workaround?
Thanks,
*This post is locked for comments
I have the same question (0)