Bug #2315
closedDoubleclicking a Button before removing it causes Errors
0%
Updated by Dirk Bauer about 11 years ago
I'm sorry for creating this empty Entry. Please adopt this Update as the intended description:
I'm currently working on a javascript error, that appears after doubleclicking a button, whos widget gets deleted after the background tasks are finished, which gets replaced by a new widget.
After spotting the error message ([error] "Wt: decodeSignal(): signal 's3' not exposed") in the Wt logfiles, I tried replicating the error, which was (to some extend) successful.
In my example the javascript error does not appear, but the "not exposed" error in the logfiles still does.
It would be nice to know wether this behaviour is actually intended or a bug.
#include <Wt/WApplication>
#include <Wt/WPushButton>
#include <Wt/WContainerWidget>
#include <Wt/WVBoxLayout>
#include <Windows.h>
using namespace Wt;
class Minimalbeispiel : public WApplication {
public:
Minimalbeispiel(const WEnvironment& env);
WPushButton* testButton;
WVBoxLayout* layout;
WContainerWidget* layoutContainer;
void OnButtonClick();
};
Minimalbeispiel::Minimalbeispiel ( const WEnvironment& env) : WApplication(env) {
layout = new WVBoxLayout(root());
layoutContainer = new WContainerWidget();
testButton = new WPushButton(layoutContainer);
layout->addWidget(testButton,0);
testButton->setText("Test");
testButton->clicked().connect(this, &Minimalbeispiel::OnButtonClick);
}
void Minimalbeispiel::OnButtonClick () {
layout->removeWidget(testButton);
Sleep(1000);
}
WApplication *createApplication(const WEnvironment& env)
{
return new Minimalbeispiel(env);
}
int main(int argc, char **argv)
{
return WRun(argc, argv, &createApplication);
}
Updated by Wim Dumon about 11 years ago
- Status changed from New to Feedback
What Wt version is this? The example runs in current git version without the warning.
BR,
Wim.
Updated by Dirk Bauer about 11 years ago
The Wt Version would be 3.2.3, sorry for not mentioning it.
Kind Regards,
Dirk
Updated by Koen Deforche about 11 years ago
Hey,
The server-side error is expected: it simply records an event could not be delivered to its target widget (in this case because it got deleted). The JavaScript error sounds like a real problem though, so it would be great if we can understand how to reproduce that.
Regards,
koen
Updated by Dirk Bauer about 11 years ago
Well thanks for the Update, nice to know that the error is no reason to be majorly concerned ;)
Anyway, reproducing the Javascript error is not that easy (at least for me). I'll try to reduce the program I'm working on to the bare minimum that is needed to reproduce it. This will sadly take some time, since I got to work on some other parts, which can't be postponed.
All I can tell you to this point:
- The Javascript error happens when Doubleclicking on a Button that calls another Widget
- When looking at the Error in Firebug, it always happens on the first reparenting in a TreeView Widget, after the div or span has been created.
Kind Regards,
Dirk
Updated by Dirk Bauer almost 11 years ago
Hello Koen,
Sorry for my late update, holiday season, other stuff to work on and all that stuff :P
After some time I'm back to dealing with javascript errors. Since I was not able to find a way to reliably reproduce the error, I cannot give you any code to work with. I'll try to forward you as much information as possible. Maybe there is a way to round down the possible reasons, and find a solution.
1. The error only occurs when clicking a button multiple times or switching widgets rapily, so it could be some sort of timing issue.
2. Its always (JS Error Message):
Wt internal error: TypeError: j* is null, code: undefined, description: undefined
3. Said j* variable can always be connected to the following code (For clarification purposes I use j100 as an example, since the variable is generated on runtime):
var j100=Wt3_2_3.$('<something>');
var j101=document.createElement('div');
j100.parentNode.replaceChild(j101,j100);
Moreover, the div can sometimes be a span (Could not figure out the conditions for this case).
4. In the most recent case, there also is a "Wt3_2_3.unstub(j100,j101,1);" following up the lines above.
5. A more complete version of the code above can be found here: http://nopaste.info/745b42a39d.html (Sorry for the formatting)
The thing that baffles me is the fact that in all cases I can remember, there always was some connection to a Treeview, dont know it this is actually relevant, but I'm just a beginner, so every piece of information might be helpful :P
I'll try to collect some cases in which the error pops up.
greetings,
Dirk bauer
Updated by Wim Dumon almost 11 years ago
That code seems to be the result of rendering a WTableView rather than a WTreeView. Does that ring a bell?
Can you also reproduce the error on a recent version of Wt (3.3.1 or even better the current git version)?
Wim
Updated by Dirk Bauer almost 11 years ago
Well, we were able to find the parts of our code that, when altered, make the error "disappear".
What we found was the following: We are using a LineEdit with a attached TreeView as sort of a ComboBox. The TreeView is created and hidden as the ComboBox is created. Once we moved the creation of the TreeView to when the ComboBox was opened, the error disappeared.
We figured that the creation of the TreeView could be the problem, but were not able to reproduce the error in a standalone program.
I'm going to try wether or not the error still occurs while using the most recent Git version, if the error still is a problem at that point, I'll try to find a way to reproduce it with bare Wt (Input is welcome :P).
greetings,
Dirk Bauer
Updated by Dirk Bauer over 10 years ago
Hello Koen and Wim,
The bug was fixed with the recent Update to WT 3.3.2, no more errors :)
greetings,
Dirk Bauer
Updated by Benoit Daccache over 9 years ago
- Status changed from Feedback to Resolved
Updated by Koen Deforche about 9 years ago
- Status changed from Resolved to Closed