Skip to content

Commit

Permalink
Several changes:
Browse files Browse the repository at this point in the history
 - Issue #5834: do not update form data for widget
                if widget is not enabled
 - Widgets that are not enabled should not be exposed
  • Loading branch information
RockinRoel committed Jul 28, 2017
1 parent 387efbb commit b263ccc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Wt/WApplication.C
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ bool WApplication::isExposed(WWidget *w) const
if (!w->isVisible())
return false;
*/
if (!w->isEnabled())
return false;

if (w == domRoot_)
return true;
Expand Down
7 changes: 5 additions & 2 deletions src/web/WebSession.C
Original file line number Diff line number Diff line change
Expand Up @@ -2848,9 +2848,12 @@ void WebSession::propagateFormValues(const WEvent& e, const std::string& se)
std::string formName = i->first;
WObject *obj = i->second;

if (!request.postDataExceeded())
if (!request.postDataExceeded()) {
WWidget *w = dynamic_cast<WWidget*>(obj);
if (w && !w->isEnabled())
continue; // Do not update form data of a disabled widget
obj->setFormData(getFormData(request, se + formName));
else
} else
obj->setRequestTooLarge(request.postDataExceeded());
}
}
Expand Down

0 comments on commit b263ccc

Please sign in to comment.