diff --git a/src/Wt/WApplication.C b/src/Wt/WApplication.C index 2215ca6274..fbc579c190 100755 --- a/src/Wt/WApplication.C +++ b/src/Wt/WApplication.C @@ -14,6 +14,7 @@ #include "Wt/WDate" #include "Wt/WDefaultLoadingIndicator" #include "Wt/WException" +#include "Wt/WFileUpload" #include "Wt/WMemoryResource" #include "Wt/WServer" #include "Wt/WTimer" @@ -517,13 +518,11 @@ void WApplication::removeGlobalWidget(WWidget *) bool WApplication::isExposed(WWidget *w) const { - /* - * This not right: for example a file upload is usually hidden while - * uploading, but then could not receive the upload event - - if (!w->isVisible()) + // File uploads may be hidden when emitting a signal. + // Other hidden widgets should not emit signals. + if (!w->isVisible() && !dynamic_cast(w)) return false; - */ + if (!w->isEnabled()) return false; diff --git a/src/web/WebSession.C b/src/web/WebSession.C index fee2e2f18a..0b8072b39d 100644 --- a/src/web/WebSession.C +++ b/src/web/WebSession.C @@ -2850,8 +2850,8 @@ void WebSession::propagateFormValues(const WEvent& e, const std::string& se) if (!request.postDataExceeded()) { WWidget *w = dynamic_cast(obj); - if (w && !w->isEnabled()) - continue; // Do not update form data of a disabled widget + if (w && (!w->isEnabled() || !w->isVisible())) + continue; // Do not update form data of a disabled or invisible widget obj->setFormData(getFormData(request, se + formName)); } else obj->setRequestTooLarge(request.postDataExceeded());