Support #6348
openWt::WFileUpload::setDisplayWidget
0%
Description
Hi,
I tried the new Wt::WFileUpload::setDisplayWidget for a nice upload button (in wt 3.3.10). It works fine, but now the WProgressBar (without parent, so WFileUpload takes it over) indicator is not displayed since it is a child of Wt-fileupload-hidden. When I create a WProgressBar with a parent how can I connect the hide and show events correctly? I tried to connect it on the button clicked event, but then it is shown during the file picking and not hidden again when the user pressed cancel in the file picker.
Thank you
Max
Files
Updated by Korneel Dumon over 6 years ago
Hi Max,
you're right that the progressbar functionality is lost when you set a displaywidget. So if you want to handle it yourself I suggest showing it when you call the WFileUpload::upload() method.
Korneel
Updated by Maximilian Kleinert over 6 years ago
Thank you Korneel,
now the ProgressBar is back again.
Max
Updated by Maximilian Kleinert over 6 years ago
Hi,
as a next step I tried to put the ProgressBar and the Button into a HBoxLayout. Unfortunately if the Button is inside a HBoxLayout the setDisplayWidget has no effect.
See the attached code example.
This examples also demonstrates the problem described in
https://redmine.webtoolkit.eu/boards/2/topics/14942
using progress-bar-danger progress-bar-success validation markups.
Thank you
Max
Updated by Korneel Dumon over 6 years ago
I checked your example and the problem is that when a container has a layout, you can no longer use the WContainerWidget::addWidget method. I will see about adding a warning in Wt when this is done.
So for your example you should either add the WFileUpload to the layout or some other place in the widget tree.
Korneel