Project

General

Profile

Support #8108

Embedded widget

Added by Alex Fedorov 5 months ago. Updated 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
02/22/2021
Due date:
% Done:

0%

Estimated time:

Description

I'm trying to insert WT-based widget to a HTML page. I found an example that looks like the best solution for me: https://www.webtoolkit.eu/wt/news/2010/12/17/widgetset_mode_and_cross_origin_requests
The first question I have: how can I create JS script file for my widget similar to chat.js that is used in the example?

#1

Updated by Korneel Dumon 5 months ago

Hi Alex,

have a look at the example in 'feature/widgetset'. Wt will create the JS file for you.

#2

Updated by Alex Fedorov 5 months ago

Thank you, but unfortunately the short way didn't work. The example doesn't work as expected. I see no embedded widget on the HTML page. All I see is the empty frame. The application construction function registered in Widgetset entry point is not called. I also can't find "hello.js" file on my disk.
Please explain what WT class/method generates the JS file. What is the location of this file? How to debug this problem (what should I check first)?

#3

Updated by Alex Fedorov 5 months ago

More details:

I start hello console application using these parameters:
"hello.exe --http-address=0.0.0.0 --http-port=8080 --deploy-path=/hello --docroot=."
I can see the widget if I open browser for "http://localhost:8080/hello", but see an empty box if I try to run hello.html from your example

#4

Updated by Korneel Dumon 5 months ago

I'm not sure what is going wrong. Maybe you can use the browser debugger to check the response? The call for 'hello.js' should go to the createWidgetSet() function.

#5

Updated by Alex Fedorov 5 months ago

Browser can't load JS file with this error message "Failed to load resource: net::ERR_FILE_NOT_FOUND"
which means hello.js is not found.
Please explain what WT class/method generates the JS file. What is the location of this file?
Should I change something in server configuration parameters to see something on the webpage?

#6

Updated by Alex Fedorov 5 months ago

I see the same situation like in issue opened 6 years ago: https://redmine.webtoolkit.eu/issues/3580
Is there something about widgetset and localhost combination I don't know

#7

Updated by Korneel Dumon 5 months ago

The file isn't anywhere on the filesystem, it is generated on the fly using createWidgetSet().

#8

Updated by Alex Fedorov 5 months ago

I found the problem solution here: https://witty-interest.narkive.com/eiZA7jY5/wt-interest-wt-interest-using-codemirror-with-wt
Thank you! Please close the issue.

Also available in: Atom PDF