Project

General

Profile

Wt::WFileUpload does not hide when required, but hides if required visible

Added by Stefan Kurek about 1 year ago

The default-button and the -text hide (or get removed) upon starting the upload, which is kind of bothersome, so I'm trying to make a reuseable FileUpload-Widget.
I created a class that is derived from Wt::WContainerWidget and adds a Wt::WFileUpload, a Wt::WLabel, a Wt::WPushButton and a Wt::WProgressBar, all of which I connect (using Wt::WFileUpload::setDisplayWidget, Wt:::WFileUpload::setProgressBar and Wt::WLabel::setBuddy) My idea is: when the upload is completed and if the Wt::WFileUpload does not react anymore, I destroy it and create a new one which I connect with the other widgets again. With the custom label I should also be able to write the pre-destruction-spooled and -stolen filename to the label, making it seem that no reset takes place between uploads.

The problem I am encountering is that Wt::WFileUpload::setDisplayWidget should hide the default-button and -label, but it doesn't. https://redmine.webtoolkit.eu/boards/2/topics/16484 Here the solution was to manually hide the widget, but that just makes the Wt::WFileUpload not responding.

Looking back, I just realized, that at one point in my application the default-button and -label do not disappear while at other locations they do, although setup is equal, just adding it to a layout. Is that intended behaviour? I can hardly believe it is, but maybe I'm not seeing something...


Replies (1)

RE: Wt::WFileUpload does not hide when required, but hides if required visible - Added by Stefan Kurek about 1 year ago

Sorry, I just noticed the Wt::WProgressbar hides the default-button and -label as soon as the upload starts (and it even says so in the documentation).
To make it reuseable, I just use Wt::WFileUpload::show() as soon as the upload is complete.

    (1-1/1)