Project

General

Profile

Actions

Bug #3075

closed

WComboBox doesn't honour "invalid" selection

Added by Pierluigi Vicinanza almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
05/06/2014
Due date:
% Done:

0%

Estimated time:

Description

When setting invalid index for a WComboBox programmatically, the first item in combo box will be displayed as selected instead.

Repro:

Wt::WComboBox *combo = new Wt::WComboBox(this);
combo->addItem("Apples");
combo->addItem("Oranges");
combo->setCurrentIndex(-1); // ERROR: it will display "Apples" instead of an blank field

Please find attached a patch proposal; it works fine for me, but Wt team might want to tweak it to make it more efficient.

Regards.


Files

WComboBox.patch (725 Bytes) WComboBox.patch Pierluigi Vicinanza, 05/06/2014 03:07 PM
Actions #1

Updated by Koen Deforche almost 10 years ago

  • Status changed from New to Resolved
  • Assignee set to Koen Deforche
  • Target version set to 3.3.3

Hey,

Contrary to what I've been thinking until now, it is indeed supported in most browsers to have 'no selection' in a combo-box (but only using JavaScript).

I've made a change so that setting currentIndex to --1 works properly now.

Thanks for pointing this out.

Regards,

koen

Actions #2

Updated by Koen Deforche almost 10 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF