Project

General

Profile

Actions

Bug #14496

closed

WSuggestionPopup selection lost on next request when cache-form-data is enabled

Added by Raf Pauwels 15 days ago. Updated 7 days ago.

Status:
Closed
Priority:
Normal
Target version:
-
Start date:
04/28/2026
Due date:
% Done:

0%

Estimated time:

Description

When a user selects an item from a WSuggestionPopup, the server permanently retains a stale (pre-selection) value for the associated edit widget in formDataCache_. Any subsequent HTTP request that does not re-send the field reads the stale value from the cache.

Minimal reproducible example

        auto* edit = root()->addNew<Wt::WLineEdit>();
        Wt::WSuggestionPopup::Options opts{ "<b>", "</b>", ',', " \n", "-., \"@\n;", "", "" };
        auto* popup = root()->addNew<Wt::WSuggestionPopup>(opts);
        popup->addSuggestion("apple");
        popup->forEdit(edit);
        auto* btn  = root()->addNew<Wt::WPushButton>("Submit");
        auto* result = root()->addNew<Wt::WText>();
        btn->clicked().connect([edit, result] {
            result->setText("Server received: " + edit->text().toUTF8());
        });
  1. Type a
  2. Click apple in the popup
  3. Click Submit

Expected: Server received: apple
Actual: Server received: a
Workaround: set <cache-form-data>false</cache-form-data> in wt_config.xml

Probable root cause

As I can see from the network console, when selecting the suggestion, WSuggestionPopup emits multiple events in a single request, of which the third one, prefixed with e2, contains the new value apple. On the server this is cached with the e2 prefix in formDataCache_ in WebSession. Possibly the value for the unprefixed key in formDataCache_ is not updated, causing subsequent requests to fall back to the old cached value.


Related issues 2 (0 open2 closed)

Related to Feature #7986: Consider optimizing updates by only changing changed form values?ClosedRomain Mardulyn01/19/2021

Actions
Is duplicate of Bug #14490: WPasswordEdit value is not updated with browser autocompleteClosedRomain Mardulyn04/23/2026

Actions
Actions #1

Updated by Raf Pauwels 15 days ago

  • Related to Feature #7986: Consider optimizing updates by only changing changed form values? added
Actions #2

Updated by Romain Mardulyn 15 days ago

  • Related to Bug #14490: WPasswordEdit value is not updated with browser autocomplete added
Actions #3

Updated by Raf Pauwels 14 days ago

  • Is duplicate of Bug #14490: WPasswordEdit value is not updated with browser autocomplete added
Actions #4

Updated by Romain Mardulyn 14 days ago

  • Status changed from New to Implemented @Emweb
  • Assignee set to Romain Mardulyn
Actions #5

Updated by Romain Mardulyn 14 days ago

  • Related to deleted (Bug #14490: WPasswordEdit value is not updated with browser autocomplete)
Actions #6

Updated by Romain Mardulyn 7 days ago

  • Status changed from Implemented @Emweb to InProgress
  • Target version changed from 4.13.2 to 4.13.3
Actions #7

Updated by Romain Mardulyn 7 days ago

  • Status changed from InProgress to Closed
Actions #8

Updated by Romain Mardulyn 7 days ago

  • Is duplicate of deleted (Bug #14490: WPasswordEdit value is not updated with browser autocomplete)
Actions #9

Updated by Matthias Van Ceulebroeck 7 days ago

  • Status changed from Closed to InProgress
Actions #10

Updated by Romain Mardulyn 7 days ago

  • Is duplicate of Bug #14490: WPasswordEdit value is not updated with browser autocomplete added
Actions #11

Updated by Romain Mardulyn 7 days ago

  • Status changed from InProgress to Closed
  • Target version deleted (4.13.3)
Actions

Also available in: Atom PDF