Project

General

Profile

How to integrate Wt widgets into existing HTML

Added by Vincenzo Romano about 14 years ago

Hi all.

I've just discovered this Wt gem and am starting playing with it.

My question is about having HTML pages already designed where I'd like to embed the widgets.

The pages themselves can be put into text strings (i.e. Wt::WText) from the containing DB.

How can I, for example, put a table within a certain

given its id and then send everything to the browser?

Sorry if this question sounds silly to you all! :-)


Replies (3)

RE: How to integrate Wt widgets into existing HTML - Added by Wim Dumon about 14 years ago

Hello Vincenzo,

That is certainly not a silly question, but is actually covered by a pretty cool feature of Wt, which we call the 'widget-set mode'. In the widget set mode, you can embed any Wt widget in an existing HTML page in the same way as you can embed for example a goolge maps widget in a web page.

One of our examples demonstrates this feature: look in the hello-widgetset directory in the examples directory.

So from my understanding of your setup, the pages from the DB would be similar to the hello.html in that directory, and a div with a predefined ID would be filled with the interactive content of a Wt session.

Regards,

Wim Dumon.

RE: How to integrate Wt widgets into existing HTML - Added by Vincenzo Romano about 14 years ago

Found!

It's called Wt::WTemplate and it's quite powerful.

RE: How to integrate Wt widgets into existing HTML - Added by Vincenzo Romano about 14 years ago

Wim Dumon wrote:

Hello Vincenzo,

That is certainly not a silly question, but is actually covered by a pretty cool feature of Wt, which we call the 'widget-set mode'. In the widget set mode, you can embed any Wt widget in an existing HTML page in the same way as you can embed for example a goolge maps widget in a web page.

One of our examples demonstrates this feature: look in the hello-widgetset directory in the examples directory.

So from my understanding of your setup, the pages from the DB would be similar to the hello.html in that directory, and a div with a predefined ID would be filled with the interactive content of a Wt session.

Regards,

Wim Dumon.

Thanks a lot. There seems to be more than one way to achieve the same thing ... I'll study both.

    (1-3/3)