Project

General

Profile

Actions

Support #6348

open
MK KD

Wt::WFileUpload::setDisplayWidget

Support #6348: Wt::WFileUpload::setDisplayWidget

Added by Maximilian Kleinert over 8 years ago. Updated over 8 years ago.

Status:
New
Priority:
Normal
Assignee:
Korneel Dumon
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

RS Updated by Roel Standaert over 8 years ago Actions #1

  • Assignee set to Korneel Dumon

KD Updated by Korneel Dumon over 8 years ago Actions #2

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

MK Updated by Maximilian Kleinert over 8 years ago Actions #3

Thank you Korneel,

now the ProgressBar is back again.

Max

MK Updated by Maximilian Kleinert over 8 years ago Actions #4

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

KD Updated by Korneel Dumon over 8 years ago Actions #5

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

MK Updated by Maximilian Kleinert over 8 years ago Actions #6

Hi Korneel,

thanks again!

Max

Actions

Also available in: PDF Atom