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.
Updated by Maximilian Kleinert over 4 years ago
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
using progress-bar-danger progress-bar-success validation markups.
Updated by Korneel Dumon over 4 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.