06-09-2020 08:20 AM - edited 06-09-2020 08:23 AM
Environment:
Windows 8.1
LabVIEW 2018 SP1 f4
Steps to Reproduce:
Expected Result:
Values match Items option is unchecked, item value is empty, item string is displayed in a Combo Box as default item.
Actual Result:
Values match Items option is checked, item value is the same as item string.
The same happens if you set a single item with an empty value at runtime through the Property Node with a StringsAndValues[] property.
Workarounds:
Reported to NI with SR #7808989.
06-09-2020 09:51 AM
@EvgenKo423 wrote:
Environment:
Windows 8.1
LabVIEW 2018 SP1 f4
Steps to Reproduce:
- Create a new VI;
- Place a Combo Box on a FP;
- Right-click it and select Edit Items...;
- Uncheck the Values match Items option;
- Click Insert button;
- Type anything as Item and leave the Value empty;
- Click OK button;
- Right-click Combo Box again and select Edit Items....
Expected Result:
Values match Items option is unchecked, item value is empty, item string is displayed in a Combo Box as default item.
Actual Result:
Values match Items option is checked, item value is the same as item string.
The same happens if you set a single item with an empty value at runtime through the Property Node with a StringsAndValues[] property.
Workarounds:
- Add more items into a Combo Box;
- Use a " " (space), "." (dot) or another 1-char value as default item.
Reported to NI with SR #7808989.
I think it is a little bit less specific than that. I think it's "as long as all the items match their corresponding values, this happens".
06-09-2020 09:56 AM - edited 06-09-2020 09:57 AM
Sorry, it's actually "two bugs for the price of one".
The first is: If you have "Values match items" set to FALSE and you add the first item with no value, LabVIEW happily adds one that matches the item.
The second is: If all the items match their corresponding values, the "Values match items" is automatically set to TRUE.
06-09-2020 10:19 AM - edited 06-09-2020 10:26 AM
@billko wrote:
The second is: If all the items match their corresponding values, the "Values match items" is automatically set to TRUE.
Well, it's rather a feature, if you think about it. If all the items match values, it is indeed True. 😉
Values match Items option is probably only exist in the interface to restrict user actions, under the hood there are only string-value pairs and LabVIEW sets this value dynamically by analyzing the list.
06-09-2020 12:23 PM
@EvgenKo423 wrote:
@billko wrote:
The second is: If all the items match their corresponding values, the "Values match items" is automatically set to TRUE.
Well, it's rather a feature, if you think about it. If all the items match values, it is indeed True. 😉
Values match Items option is probably only exist in the interface to restrict user actions, under the hood there are only string-value pairs and LabVIEW sets this value dynamically by analyzing the list.
I'm going to stick with "bug" as there is no way it can predict whether or not programmatically added items would have matching items and values. Unless - and I haven't tried it yet - it's just an input limiter, somewhat like how placing limits on your numeric controls just limits the user from entering certain values.