Feature #3597

Add a method to WSuggestionPopup to expose the selected hint (if any)

Added by Vincenzo Romano almost 8 years ago. Updated over 7 years ago.

Benoit Daccache
Target version:
Start date:
Due date:
% Done:


Estimated time:


Currently the selected hint is known only to the signal handler, not to the class itself.

This makes WSuggestionPopup different from most of other interaction widgets that can usually be inspected to know the current status.

This in turn makes the use of a lambda function as signal handler proxy impossible thus requiring a (uselessly) complex class dependence architecture to let the info reach the handler.

Things get complicated especially when all the logics and data is handled and known to a single class.

class Handler; // Handles the data, the events and coordinates the general behaviour

class MyCheckBox: Wt::WCheckBox {
  MyCheckBox( Handler* handler ): Wt::WCheckBox( ... ) {
    changed().connect( std::bind( [=]() { handler->checkBoxHandler( this ); } ) ); // This works!

class MyPopUp: Wt::Wt::WFormWidget {
  MyPopUp( Handler* handler ): WSuggestionPopup( .. ) {
    activated().connect( std::bind( [=]() { handler->popupHandler( this ); } ) ); // This won't!

As of now the Handler::popupHandler() method won't know anything about the actual hint selected, while the Handler::checkBoxHandler() will.

As an option, the WFormWidget linked to the WSuggestionPopup should in turn fire an event as soon as the WSuggestionPopup fills the text in.

In this case the WLIneEdit signal handler could react to the new input passwd by the WSuggestionPopup.

Currently this only happens upon actual user editing.


Updated by Koen Deforche almost 8 years ago

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche
  • Target version set to 3.3.4

Updated by Koen Deforche almost 8 years ago

  • Assignee changed from Koen Deforche to Pavel Sopher
  • Trigger WLineEdit::changed() when a suggestion popup alters its value
  • Add a method int WSuggestionPopup::currentItem() which returns the last activated item index.

Updated by Koen Deforche over 7 years ago

  • Assignee changed from Pavel Sopher to Benoit Daccache

Updated by Benoit Daccache over 7 years ago

  • Status changed from InProgress to Resolved

Updated by Koen Deforche over 7 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF