Project

General

Profile

Actions

Bug #14496

closed
RP RM

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

Bug #14496: WSuggestionPopup selection lost on next request when cache-form-data is enabled

Added by Raf Pauwels 4 months ago. Updated 4 months 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

RP Updated by Raf Pauwels 4 months ago Actions #1

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

RM Updated by Romain Mardulyn 4 months ago Actions #2

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

RP Updated by Raf Pauwels 4 months ago Actions #3

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

RM Updated by Romain Mardulyn 4 months ago Actions #4

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

RM Updated by Romain Mardulyn 4 months ago Actions #5

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

RM Updated by Romain Mardulyn 4 months ago Actions #6

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

RM Updated by Romain Mardulyn 4 months ago Actions #7

  • Status changed from InProgress to Closed

RM Updated by Romain Mardulyn 4 months ago Actions #8

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

MV Updated by Matthias Van Ceulebroeck 4 months ago Actions #9

  • Status changed from Closed to InProgress

RM Updated by Romain Mardulyn 4 months ago Actions #10

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

RM Updated by Romain Mardulyn 4 months ago Actions #11

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

Also available in: PDF Atom