Project

General

Profile

Actions

Support #8108

open

Embedded widget

Added by Alex Fedorov over 3 years ago. Updated over 3 years 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?

Actions #1

Updated by Korneel Dumon over 3 years ago

Hi Alex,

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

Actions #2

Updated by Alex Fedorov over 3 years 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)?

Actions #3

Updated by Alex Fedorov over 3 years 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

Actions #4

Updated by Korneel Dumon over 3 years 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.

Actions #5

Updated by Alex Fedorov over 3 years 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?

Actions #6

Updated by Alex Fedorov over 3 years 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

Actions #7

Updated by Korneel Dumon over 3 years ago

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

Actions #8

Updated by Alex Fedorov over 3 years 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.

Actions

Also available in: Atom PDF