Project

General

Profile

Wt internal error; code: undefined, description: Wt3_3_5.WPopupWidget is not a constructor

Added by Josh Knox about 8 years ago

Hi,

I'm using Wt 3.3.5 on Ubuntu 14.04. I'm trying to add log in support based on the Hangman example.

After adding an AuthWidget to my app, I get the following javascript error message in the browser when the app loads:

"Wt internal error; code: undefined, description: Wt3_3_5.WPopupWidget is not a constructor"

I do not use any WPopupWidgets in my code, directly.

The AuthWidget is displayed, but if I click any buttons, the following message displays in the browser:

"The application has stopped running, would you like to restart?"

If I restart, the cycle repeats.

If I don't display the AuthWidget, the app runs fine.

There are no additional errors on the console when this occurs. Any ideas what these messages mean or how I can troubleshoot further?

Thanks!

Josh


Replies (4)

RE: Wt internal error; code: undefined, description: Wt3_3_5.WPopupWidget is not a constructor - Added by Josh Knox about 8 years ago

The above errors occur when I place the WAuthWidget in a WStackedWidget on a WContainerWidget.

My thinking was to put the AuthWidget and my app widget in the stacked widget. I would show the AuthWidget initially, then upon successful log in, switch the stack to my main app page.

If I place the AuthWidget directly on a WContainerWidget, then it my app and the authwidget work as expected.

RE: Wt internal error; code: undefined, description: Wt3_3_5.WPopupWidget is not a constructor - Added by Josh Knox about 8 years ago

I have a "workaround" but I'm not too keen on it.

My main app page has a header, mainSection, and footer in a WVBoxLayout.

I want to show the authWidget in the mainSection, then show the appPage in the mainSection after successful login.

A couple things didn't work for me:

1. Place authWidget and appPage in a stackedWiget on the mainSection. In onAuthEvent, toggle the stack layout to show the appPage.

This fails to load properly, with the error "Wt3_3_5.WPopupWidget is not a constructor"

2. Place both authWidget and appPage directly into the mainSection of the layout. Show/hide each, depending on log in state.

This fails to load properly, with the error "Wt3_3_5.WPopupWidget is not a constructor"

What is working:

Insert only the authWidget in the mainSection of the layout. In onAuthEvent, do WVBoxLayout~~removeItem in the mainSection and then use WVBoxLayout~~>insertWidget to put the main app apge in place.

This last attempt works, but feels kludgey.

Still trying to understand why the WStackedWidget approach wont work... :(

RE: Wt internal error; code: undefined, description: Wt3_3_5.WPopupWidget is not a constructor - Added by Koen Deforche about 8 years ago

Hey, I tried to reproduce this and also examined possibilities, but perhaps the origin of the error is not the authwidget, but your hidden 'appPage'.

Do you use any of : WDialog, WSuggestionPopup, WDateEdit, or WTimeEdit any your appPage? How do you instantiate them? Can you isolate that in a test case?

RE: Wt internal error; code: undefined, description: Wt3_3_5.WPopupWidget is not a constructor - Added by Josh Knox about 8 years ago

Hi Koen,

My appPage does create some WDialogs, but those are not instantiated until later, when/if a user clicks a button. They don't exist at the point of login. Not using any of the other widgets you mentioned.

It appears that AuthWidget and my appPage can not coexist happily in the same container (WStackedWidget or WContainer).

Authwidget + some other widget works. (tried with a Wtext and WPanel)

myAppPage + some other widget works.

AuthWidget + myAppPage fails. :(

I'll try to narrow it down some more.

Thanks!

Josh

    (1-4/4)