开发者

How can I embed a webpage in a GWT/GXT webapp?

开发者 https://www.devze.com 2022-12-19 02:24 出处:网络
I am working to recreate (conceptually) a prototype I\'ve written in Cappuccino in GWT/GXT. Cappuccino made it tri开发者_高级运维vial to display an external webpage as part of the application by using

I am working to recreate (conceptually) a prototype I've written in Cappuccino in GWT/GXT. Cappuccino made it tri开发者_高级运维vial to display an external webpage as part of the application by using a WebView.

However, I cannot find any way to do this with GWT/GXT. There is a HtmlContainer widget, but this seems to be intended for something else. Any suggestions on how to do this?


If you have the html-code and just want to render it use the "HTML"-widget. Form the docs

A widget that can contain arbitrary HTML. This widget uses a element, causing it to be displayed with block layout.

If you want to display a different page e.g. stackoverflow.com in your webapp use the "frame" widget. From the docs:

A widget that wraps an IFRAME element, which can contain an arbitrary web site.


You can set the url of a ContentPanel

e.g.

ContentPanel panel = new ContentPanel();
panel.setUrl("http://www.url.com/page");
panel.setHeaderVisible(false);
panel.setBorders(false);
panel.setBodyBorder(false);

You can also do this for the GXT Window class too.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号