开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜