LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combo Box doesn't allow single item with an empty value

Environment:
Windows 8.1
LabVIEW 2018 SP1 f4

 

Steps to Reproduce:

  1. Create a new VI;
  2. Place a Combo Box on a FP;
  3. Right-click it and select Edit Items...;
  4. Uncheck the Values match Items option;
  5. Click Insert button;
  6. Type anything as Item and leave the Value empty;
  7. Click OK button;
  8. 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.

0 Kudos
Message 1 of 5
(3,214 Views)

@EvgenKo423 wrote:

Environment:
Windows 8.1
LabVIEW 2018 SP1 f4

 

Steps to Reproduce:

  1. Create a new VI;
  2. Place a Combo Box on a FP;
  3. Right-click it and select Edit Items...;
  4. Uncheck the Values match Items option;
  5. Click Insert button;
  6. Type anything as Item and leave the Value empty;
  7. Click OK button;
  8. 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".

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 5
(3,170 Views)

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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 5
(3,162 Views)

@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.

0 Kudos
Message 4 of 5
(3,145 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 5
(3,127 Views)