Wt internal error when widgets(WPushButton) has been replaced on page refresh (initiated form browser)
when a browser reloads the page and a widget have own specialization of WWebWidget::refresh(), where child widgets are replaced, using the new widgets (WPushButton) end up with "Wt internal error". The error message is different depending on the browser.
Wt internal error: TypeError: a is null, code: undefined, description: undefined
When the WWebWidget::refresh() method of the parent widget is called by an explicit button click, let us call that a "local reload", the page reloads properly, i.e., refresh() is propagated to the child widgets and the new widgets work fine. Moreover, when the error occurs the application's functionalities could be recovered using that "local reload".
Wt version: Wt-3.2.3
I narrowed the problem down to a test case (source file attached).
Updated by Стойчо Стефанов Stoycho Stefanov over 7 years ago
sorry, but I cannot see what is missing in this test case. For me it works and can demonstrate the problem. I just added some prints.
The only thing you have to do is to start a new session and click on the button "start (2)" and you'll get the error message. Close the message and click on the application's "refresh" button. A new button is created ("start (3)") which works fine (some processing is done on click). You can further replace the "start" button using "refresh" and the new button will be ok. But if you use the browser's refresh or just press F5 and click the new "start" button you'll get the error massage again.
I found an work around for the special case in my application, but it seems to be a bug and I'll be happy to help to find and fix it.