Actions
Bug #5261
closedWFileUpload::setFilters can be set only once.
Start date:
09/15/2016
Due date:
% Done:
0%
Estimated time:
Description
After the widget is shown, setting the WFileUpload::setFilter will not alter the file browser dialog.
Code:
WFileUpload* upload = new WFileUpload(this);
upload->setFilters(".bad");
upload->setFilters(".txt"); //< switch to .txt
WComboBox* combo = new WComboBox(this);
combo->addItem(".txt");
combo->addItem(".img");
combo->changed().connect(std::bind([combo, upload]()
{
if(combo->currentIndex() == 0)
{
Wt::log("info") << "choose .txt";
upload->setFilters(".txt");
}
else if(combo->currentIndex() == 1)
{
Wt::log("info") << "choose .img";
upload->setFilters(".img"); //< won't switch to .img
}
}));
Step to reproduce
- Click at "Browse..." button.
- Observe file dialog which should show "*.txt" option
- Change the choice in WCombobox to ".img"
- Observe file dialog
Result
The file dialog still shows "*.txt" option
Version
Wt github b8d3cdf9ee0b0bcc16bf9338681ffc9ab27a490b
Environment
Ubuntu 15.10 (FileManager: Nautilus), Windows 10
Updated by Roel Standaert over 7 years ago
- Status changed from New to InProgress
- Assignee set to André Jacobs
Updated by André Jacobs over 7 years ago
- Status changed from InProgress to Implemented @Emweb
Updated by Roel Standaert over 7 years ago
- Status changed from Implemented @Emweb to Resolved
Updated by Roel Standaert about 7 years ago
- Status changed from Resolved to Closed
Actions