Project

General

Profile

Actions

Support #6348

open

Wt::WFileUpload::setDisplayWidget

Added by Maximilian Kleinert almost 6 years ago. Updated almost 6 years ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
-
Start date:
04/23/2018
Due date:
% Done:

0%

Estimated time:

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

main.cpp (3.92 KB) main.cpp Maximilian Kleinert, 05/02/2018 02:44 PM
Actions #1

Updated by Roel Standaert almost 6 years ago

  • Assignee set to Korneel Dumon
Actions #2

Updated by Korneel Dumon almost 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

Actions #3

Updated by Maximilian Kleinert almost 6 years ago

Thank you Korneel,

now the ProgressBar is back again.

Max

Actions #4

Updated by Maximilian Kleinert almost 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

Actions #5

Updated by Korneel Dumon almost 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

Actions #6

Updated by Maximilian Kleinert almost 6 years ago

Hi Korneel,

thanks again!

Max

Actions

Also available in: Atom PDF